proteus  1.7.2
C/C++/Fortran libraries
WaveTools.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.2 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_2"
11 #define CYTHON_HEX_VERSION 0x001D02F0
12 #define CYTHON_FUTURE_DIVISION 1
13 #include <stddef.h>
14 #ifndef offsetof
15  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18  #ifndef __stdcall
19  #define __stdcall
20  #endif
21  #ifndef __cdecl
22  #define __cdecl
23  #endif
24  #ifndef __fastcall
25  #define __fastcall
26  #endif
27 #endif
28 #ifndef DL_IMPORT
29  #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32  #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36  #if PY_VERSION_HEX >= 0x02070000
37  #define HAVE_LONG_LONG
38  #endif
39 #endif
40 #ifndef PY_LONG_LONG
41  #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44  #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47  #define CYTHON_COMPILING_IN_PYPY 1
48  #define CYTHON_COMPILING_IN_PYSTON 0
49  #define CYTHON_COMPILING_IN_CPYTHON 0
50  #undef CYTHON_USE_TYPE_SLOTS
51  #define CYTHON_USE_TYPE_SLOTS 0
52  #undef CYTHON_USE_PYTYPE_LOOKUP
53  #define CYTHON_USE_PYTYPE_LOOKUP 0
54  #if PY_VERSION_HEX < 0x03050000
55  #undef CYTHON_USE_ASYNC_SLOTS
56  #define CYTHON_USE_ASYNC_SLOTS 0
57  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58  #define CYTHON_USE_ASYNC_SLOTS 1
59  #endif
60  #undef CYTHON_USE_PYLIST_INTERNALS
61  #define CYTHON_USE_PYLIST_INTERNALS 0
62  #undef CYTHON_USE_UNICODE_INTERNALS
63  #define CYTHON_USE_UNICODE_INTERNALS 0
64  #undef CYTHON_USE_UNICODE_WRITER
65  #define CYTHON_USE_UNICODE_WRITER 0
66  #undef CYTHON_USE_PYLONG_INTERNALS
67  #define CYTHON_USE_PYLONG_INTERNALS 0
68  #undef CYTHON_AVOID_BORROWED_REFS
69  #define CYTHON_AVOID_BORROWED_REFS 1
70  #undef CYTHON_ASSUME_SAFE_MACROS
71  #define CYTHON_ASSUME_SAFE_MACROS 0
72  #undef CYTHON_UNPACK_METHODS
73  #define CYTHON_UNPACK_METHODS 0
74  #undef CYTHON_FAST_THREAD_STATE
75  #define CYTHON_FAST_THREAD_STATE 0
76  #undef CYTHON_FAST_PYCALL
77  #define CYTHON_FAST_PYCALL 0
78  #undef CYTHON_PEP489_MULTI_PHASE_INIT
79  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80  #undef CYTHON_USE_TP_FINALIZE
81  #define CYTHON_USE_TP_FINALIZE 0
82  #undef CYTHON_USE_DICT_VERSIONS
83  #define CYTHON_USE_DICT_VERSIONS 0
84  #undef CYTHON_USE_EXC_INFO_STACK
85  #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87  #define CYTHON_COMPILING_IN_PYPY 0
88  #define CYTHON_COMPILING_IN_PYSTON 1
89  #define CYTHON_COMPILING_IN_CPYTHON 0
90  #ifndef CYTHON_USE_TYPE_SLOTS
91  #define CYTHON_USE_TYPE_SLOTS 1
92  #endif
93  #undef CYTHON_USE_PYTYPE_LOOKUP
94  #define CYTHON_USE_PYTYPE_LOOKUP 0
95  #undef CYTHON_USE_ASYNC_SLOTS
96  #define CYTHON_USE_ASYNC_SLOTS 0
97  #undef CYTHON_USE_PYLIST_INTERNALS
98  #define CYTHON_USE_PYLIST_INTERNALS 0
99  #ifndef CYTHON_USE_UNICODE_INTERNALS
100  #define CYTHON_USE_UNICODE_INTERNALS 1
101  #endif
102  #undef CYTHON_USE_UNICODE_WRITER
103  #define CYTHON_USE_UNICODE_WRITER 0
104  #undef CYTHON_USE_PYLONG_INTERNALS
105  #define CYTHON_USE_PYLONG_INTERNALS 0
106  #ifndef CYTHON_AVOID_BORROWED_REFS
107  #define CYTHON_AVOID_BORROWED_REFS 0
108  #endif
109  #ifndef CYTHON_ASSUME_SAFE_MACROS
110  #define CYTHON_ASSUME_SAFE_MACROS 1
111  #endif
112  #ifndef CYTHON_UNPACK_METHODS
113  #define CYTHON_UNPACK_METHODS 1
114  #endif
115  #undef CYTHON_FAST_THREAD_STATE
116  #define CYTHON_FAST_THREAD_STATE 0
117  #undef CYTHON_FAST_PYCALL
118  #define CYTHON_FAST_PYCALL 0
119  #undef CYTHON_PEP489_MULTI_PHASE_INIT
120  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121  #undef CYTHON_USE_TP_FINALIZE
122  #define CYTHON_USE_TP_FINALIZE 0
123  #undef CYTHON_USE_DICT_VERSIONS
124  #define CYTHON_USE_DICT_VERSIONS 0
125  #undef CYTHON_USE_EXC_INFO_STACK
126  #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128  #define CYTHON_COMPILING_IN_PYPY 0
129  #define CYTHON_COMPILING_IN_PYSTON 0
130  #define CYTHON_COMPILING_IN_CPYTHON 1
131  #ifndef CYTHON_USE_TYPE_SLOTS
132  #define CYTHON_USE_TYPE_SLOTS 1
133  #endif
134  #if PY_VERSION_HEX < 0x02070000
135  #undef CYTHON_USE_PYTYPE_LOOKUP
136  #define CYTHON_USE_PYTYPE_LOOKUP 0
137  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138  #define CYTHON_USE_PYTYPE_LOOKUP 1
139  #endif
140  #if PY_MAJOR_VERSION < 3
141  #undef CYTHON_USE_ASYNC_SLOTS
142  #define CYTHON_USE_ASYNC_SLOTS 0
143  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144  #define CYTHON_USE_ASYNC_SLOTS 1
145  #endif
146  #if PY_VERSION_HEX < 0x02070000
147  #undef CYTHON_USE_PYLONG_INTERNALS
148  #define CYTHON_USE_PYLONG_INTERNALS 0
149  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150  #define CYTHON_USE_PYLONG_INTERNALS 1
151  #endif
152  #ifndef CYTHON_USE_PYLIST_INTERNALS
153  #define CYTHON_USE_PYLIST_INTERNALS 1
154  #endif
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #if PY_VERSION_HEX < 0x030300F0
159  #undef CYTHON_USE_UNICODE_WRITER
160  #define CYTHON_USE_UNICODE_WRITER 0
161  #elif !defined(CYTHON_USE_UNICODE_WRITER)
162  #define CYTHON_USE_UNICODE_WRITER 1
163  #endif
164  #ifndef CYTHON_AVOID_BORROWED_REFS
165  #define CYTHON_AVOID_BORROWED_REFS 0
166  #endif
167  #ifndef CYTHON_ASSUME_SAFE_MACROS
168  #define CYTHON_ASSUME_SAFE_MACROS 1
169  #endif
170  #ifndef CYTHON_UNPACK_METHODS
171  #define CYTHON_UNPACK_METHODS 1
172  #endif
173  #ifndef CYTHON_FAST_THREAD_STATE
174  #define CYTHON_FAST_THREAD_STATE 1
175  #endif
176  #ifndef CYTHON_FAST_PYCALL
177  #define CYTHON_FAST_PYCALL 1
178  #endif
179  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181  #endif
182  #ifndef CYTHON_USE_TP_FINALIZE
183  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184  #endif
185  #ifndef CYTHON_USE_DICT_VERSIONS
186  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187  #endif
188  #ifndef CYTHON_USE_EXC_INFO_STACK
189  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190  #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196  #include "longintrepr.h"
197  #undef SHIFT
198  #undef BASE
199  #undef MASK
200  #ifdef SIZEOF_VOID_P
201  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202  #endif
203 #endif
204 #ifndef __has_attribute
205  #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208  #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211  #if defined(__GNUC__)
212  #define CYTHON_RESTRICT __restrict__
213  #elif defined(_MSC_VER) && _MSC_VER >= 1400
214  #define CYTHON_RESTRICT __restrict
215  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216  #define CYTHON_RESTRICT restrict
217  #else
218  #define CYTHON_RESTRICT
219  #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
236  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250  #ifndef _MSC_STDINT_H_
251  #if _MSC_VER < 1300
252  typedef unsigned char uint8_t;
253  typedef unsigned int uint32_t;
254  #else
255  typedef unsigned __int8 uint8_t;
256  typedef unsigned __int32 uint32_t;
257  #endif
258  #endif
259 #else
260  #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263  #if defined(__cplusplus) && __cplusplus >= 201103L
264  #if __has_cpp_attribute(fallthrough)
265  #define CYTHON_FALLTHROUGH [[fallthrough]]
266  #elif __has_cpp_attribute(clang::fallthrough)
267  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268  #elif __has_cpp_attribute(gnu::fallthrough)
269  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270  #endif
271  #endif
272  #ifndef CYTHON_FALLTHROUGH
273  #if __has_attribute(fallthrough)
274  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275  #else
276  #define CYTHON_FALLTHROUGH
277  #endif
278  #endif
279  #if defined(__clang__ ) && defined(__apple_build_version__)
280  #if __apple_build_version__ < 7000000
281  #undef CYTHON_FALLTHROUGH
282  #define CYTHON_FALLTHROUGH
283  #endif
284  #endif
285 #endif
286 
287 #ifndef __cplusplus
288  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
289 #endif
290 #ifndef CYTHON_INLINE
291  #if defined(__clang__)
292  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
293  #else
294  #define CYTHON_INLINE inline
295  #endif
296 #endif
297 template<typename T>
298 void __Pyx_call_destructor(T& x) {
299  x.~T();
300 }
301 template<typename T>
302 class __Pyx_FakeReference {
303  public:
304  __Pyx_FakeReference() : ptr(NULL) { }
305  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
306  T *operator->() { return ptr; }
307  T *operator&() { return ptr; }
308  operator T&() { return *ptr; }
309  template<typename U> bool operator ==(U other) { return *ptr == other; }
310  template<typename U> bool operator !=(U other) { return *ptr != other; }
311  private:
312  T *ptr;
313 };
314 
315 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
316  #define Py_OptimizeFlag 0
317 #endif
318 #define __PYX_BUILD_PY_SSIZE_T "n"
319 #define CYTHON_FORMAT_SSIZE_T "z"
320 #if PY_MAJOR_VERSION < 3
321  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
322  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
323  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
324  #define __Pyx_DefaultClassType PyClass_Type
325 #else
326  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
327  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
328  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
329  #define __Pyx_DefaultClassType PyType_Type
330 #endif
331 #ifndef Py_TPFLAGS_CHECKTYPES
332  #define Py_TPFLAGS_CHECKTYPES 0
333 #endif
334 #ifndef Py_TPFLAGS_HAVE_INDEX
335  #define Py_TPFLAGS_HAVE_INDEX 0
336 #endif
337 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
338  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
339 #endif
340 #ifndef Py_TPFLAGS_HAVE_FINALIZE
341  #define Py_TPFLAGS_HAVE_FINALIZE 0
342 #endif
343 #ifndef METH_STACKLESS
344  #define METH_STACKLESS 0
345 #endif
346 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
347  #ifndef METH_FASTCALL
348  #define METH_FASTCALL 0x80
349  #endif
350  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
351  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
352  Py_ssize_t nargs, PyObject *kwnames);
353 #else
354  #define __Pyx_PyCFunctionFast _PyCFunctionFast
355  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
356 #endif
357 #if CYTHON_FAST_PYCCALL
358 #define __Pyx_PyFastCFunction_Check(func)\
359  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
360 #else
361 #define __Pyx_PyFastCFunction_Check(func) 0
362 #endif
363 #if CYTHON_USE_DICT_VERSIONS
364 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
365 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
366  (version_var) = __PYX_GET_DICT_VERSION(dict);\
367  (cache_var) = (value);
368 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
369  static PY_UINT64_T __pyx_dict_version = 0;\
370  static PyObject *__pyx_dict_cached_value = NULL;\
371  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
372  (VAR) = __pyx_dict_cached_value;\
373  } else {\
374  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
375  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
376  }\
377  }
378 #else
379 #define __PYX_GET_DICT_VERSION(dict) (0)
380 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
381 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
382 #endif
383 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
384  #define PyObject_Malloc(s) PyMem_Malloc(s)
385  #define PyObject_Free(p) PyMem_Free(p)
386  #define PyObject_Realloc(p) PyMem_Realloc(p)
387 #endif
388 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
389  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
390  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
391  #define PyMem_RawFree(p) PyMem_Free(p)
392 #endif
393 #if CYTHON_COMPILING_IN_PYSTON
394  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
395  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
396 #else
397  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
398  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
399 #endif
400 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
401  #define __Pyx_PyThreadState_Current PyThreadState_GET()
402 #elif PY_VERSION_HEX >= 0x03060000
403  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
404 #elif PY_VERSION_HEX >= 0x03000000
405  #define __Pyx_PyThreadState_Current PyThreadState_GET()
406 #else
407  #define __Pyx_PyThreadState_Current _PyThreadState_Current
408 #endif
409 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
410 #include "pythread.h"
411 #define Py_tss_NEEDS_INIT 0
412 typedef int Py_tss_t;
413 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
414  *key = PyThread_create_key();
415  return 0; // PyThread_create_key reports success always
416 }
417 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
418  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
419  *key = Py_tss_NEEDS_INIT;
420  return key;
421 }
422 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
423  PyObject_Free(key);
424 }
425 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
426  return *key != Py_tss_NEEDS_INIT;
427 }
428 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
429  PyThread_delete_key(*key);
430  *key = Py_tss_NEEDS_INIT;
431 }
432 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
433  return PyThread_set_key_value(*key, value);
434 }
435 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
436  return PyThread_get_key_value(*key);
437 }
438 #endif // TSS (Thread Specific Storage) API
439 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
440 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
441 #else
442 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
443 #endif
444 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
445  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
446  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
447 #else
448  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
449  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
450 #endif
451 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
452 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
453 #else
454 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
455 #endif
456 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
457  #define CYTHON_PEP393_ENABLED 1
458  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
459  0 : _PyUnicode_Ready((PyObject *)(op)))
460  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
461  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
462  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
463  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
464  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
465  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
466  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
467  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
468 #else
469  #define CYTHON_PEP393_ENABLED 0
470  #define PyUnicode_1BYTE_KIND 1
471  #define PyUnicode_2BYTE_KIND 2
472  #define PyUnicode_4BYTE_KIND 4
473  #define __Pyx_PyUnicode_READY(op) (0)
474  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
475  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
476  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
477  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
478  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
479  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
480  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
481  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
482 #endif
483 #if CYTHON_COMPILING_IN_PYPY
484  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
485  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
486 #else
487  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
488  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
489  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
490 #endif
491 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
492  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
493 #endif
494 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
495  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
496 #endif
497 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
498  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
499 #endif
500 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
501 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
502 #if PY_MAJOR_VERSION >= 3
503  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
504 #else
505  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
506 #endif
507 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
508  #define PyObject_ASCII(o) PyObject_Repr(o)
509 #endif
510 #if PY_MAJOR_VERSION >= 3
511  #define PyBaseString_Type PyUnicode_Type
512  #define PyStringObject PyUnicodeObject
513  #define PyString_Type PyUnicode_Type
514  #define PyString_Check PyUnicode_Check
515  #define PyString_CheckExact PyUnicode_CheckExact
516  #define PyObject_Unicode PyObject_Str
517 #endif
518 #if PY_MAJOR_VERSION >= 3
519  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
520  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
521 #else
522  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
523  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
524 #endif
525 #ifndef PySet_CheckExact
526  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
527 #endif
528 #if CYTHON_ASSUME_SAFE_MACROS
529  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
530 #else
531  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
532 #endif
533 #if PY_MAJOR_VERSION >= 3
534  #define PyIntObject PyLongObject
535  #define PyInt_Type PyLong_Type
536  #define PyInt_Check(op) PyLong_Check(op)
537  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
538  #define PyInt_FromString PyLong_FromString
539  #define PyInt_FromUnicode PyLong_FromUnicode
540  #define PyInt_FromLong PyLong_FromLong
541  #define PyInt_FromSize_t PyLong_FromSize_t
542  #define PyInt_FromSsize_t PyLong_FromSsize_t
543  #define PyInt_AsLong PyLong_AsLong
544  #define PyInt_AS_LONG PyLong_AS_LONG
545  #define PyInt_AsSsize_t PyLong_AsSsize_t
546  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
547  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
548  #define PyNumber_Int PyNumber_Long
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551  #define PyBoolObject PyLongObject
552 #endif
553 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
554  #ifndef PyUnicode_InternFromString
555  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
556  #endif
557 #endif
558 #if PY_VERSION_HEX < 0x030200A4
559  typedef long Py_hash_t;
560  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
561  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
562 #else
563  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
564  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
565 #endif
566 #if PY_MAJOR_VERSION >= 3
567  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
568 #else
569  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
570 #endif
571 #if CYTHON_USE_ASYNC_SLOTS
572  #if PY_VERSION_HEX >= 0x030500B1
573  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
574  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
575  #else
576  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
577  #endif
578 #else
579  #define __Pyx_PyType_AsAsync(obj) NULL
580 #endif
581 #ifndef __Pyx_PyAsyncMethodsStruct
582  typedef struct {
583  unaryfunc am_await;
584  unaryfunc am_aiter;
585  unaryfunc am_anext;
586  } __Pyx_PyAsyncMethodsStruct;
587 #endif
588 
589 #if defined(WIN32) || defined(MS_WINDOWS)
590  #define _USE_MATH_DEFINES
591 #endif
592 #include <math.h>
593 #ifdef NAN
594 #define __PYX_NAN() ((float) NAN)
595 #else
596 static CYTHON_INLINE float __PYX_NAN() {
597  float value;
598  memset(&value, 0xFF, sizeof(value));
599  return value;
600 }
601 #endif
602 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
603 #define __Pyx_truncl trunc
604 #else
605 #define __Pyx_truncl truncl
606 #endif
607 
608 
609 #define __PYX_ERR(f_index, lineno, Ln_error) \
610 { \
611  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
612 }
613 
614 #ifndef __PYX_EXTERN_C
615  #ifdef __cplusplus
616  #define __PYX_EXTERN_C extern "C"
617  #else
618  #define __PYX_EXTERN_C extern
619  #endif
620 #endif
621 
622 #define __PYX_HAVE__WaveTools
623 #define __PYX_HAVE_API__WaveTools
624 /* Early includes */
625 #include <math.h>
626 #include <string.h>
627 #include <stdio.h>
628 #include "numpy/arrayobject.h"
629 #include "numpy/ufuncobject.h"
630 #include "WaveTools.h"
631 #ifdef _OPENMP
632 #include <omp.h>
633 #endif /* _OPENMP */
634 
635 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
636 #define CYTHON_WITHOUT_ASSERTIONS
637 #endif
638 
639 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
640  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
641 
642 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
643 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
644 #define __PYX_DEFAULT_STRING_ENCODING ""
645 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
646 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
647 #define __Pyx_uchar_cast(c) ((unsigned char)c)
648 #define __Pyx_long_cast(x) ((long)x)
649 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
650  (sizeof(type) < sizeof(Py_ssize_t)) ||\
651  (sizeof(type) > sizeof(Py_ssize_t) &&\
652  likely(v < (type)PY_SSIZE_T_MAX ||\
653  v == (type)PY_SSIZE_T_MAX) &&\
654  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
655  v == (type)PY_SSIZE_T_MIN))) ||\
656  (sizeof(type) == sizeof(Py_ssize_t) &&\
657  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
658  v == (type)PY_SSIZE_T_MAX))) )
659 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
660  return (size_t) i < (size_t) limit;
661 }
662 #if defined (__cplusplus) && __cplusplus >= 201103L
663  #include <cstdlib>
664  #define __Pyx_sst_abs(value) std::abs(value)
665 #elif SIZEOF_INT >= SIZEOF_SIZE_T
666  #define __Pyx_sst_abs(value) abs(value)
667 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
668  #define __Pyx_sst_abs(value) labs(value)
669 #elif defined (_MSC_VER)
670  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
671 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
672  #define __Pyx_sst_abs(value) llabs(value)
673 #elif defined (__GNUC__)
674  #define __Pyx_sst_abs(value) __builtin_llabs(value)
675 #else
676  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
677 #endif
678 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
679 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
680 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
681 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
682 #define __Pyx_PyBytes_FromString PyBytes_FromString
683 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
684 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
685 #if PY_MAJOR_VERSION < 3
686  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
687  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
688 #else
689  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
690  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
691 #endif
692 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
693 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
694 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
695 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
696 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
697 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
698 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
699 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
700 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
701 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
702 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
703 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
704 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
705 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
706 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
707 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
708 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
709  const Py_UNICODE *u_end = u;
710  while (*u_end++) ;
711  return (size_t)(u_end - u - 1);
712 }
713 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
714 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
715 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
716 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
717 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
718 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
719 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
720 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
721 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
722 #define __Pyx_PySequence_Tuple(obj)\
723  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
724 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
725 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
726 #if CYTHON_ASSUME_SAFE_MACROS
727 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
728 #else
729 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
730 #endif
731 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
732 #if PY_MAJOR_VERSION >= 3
733 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
734 #else
735 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
736 #endif
737 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
738 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
739 static int __Pyx_sys_getdefaultencoding_not_ascii;
740 static int __Pyx_init_sys_getdefaultencoding_params(void) {
741  PyObject* sys;
742  PyObject* default_encoding = NULL;
743  PyObject* ascii_chars_u = NULL;
744  PyObject* ascii_chars_b = NULL;
745  const char* default_encoding_c;
746  sys = PyImport_ImportModule("sys");
747  if (!sys) goto bad;
748  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
749  Py_DECREF(sys);
750  if (!default_encoding) goto bad;
751  default_encoding_c = PyBytes_AsString(default_encoding);
752  if (!default_encoding_c) goto bad;
753  if (strcmp(default_encoding_c, "ascii") == 0) {
754  __Pyx_sys_getdefaultencoding_not_ascii = 0;
755  } else {
756  char ascii_chars[128];
757  int c;
758  for (c = 0; c < 128; c++) {
759  ascii_chars[c] = c;
760  }
761  __Pyx_sys_getdefaultencoding_not_ascii = 1;
762  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
763  if (!ascii_chars_u) goto bad;
764  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
765  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
766  PyErr_Format(
767  PyExc_ValueError,
768  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
769  default_encoding_c);
770  goto bad;
771  }
772  Py_DECREF(ascii_chars_u);
773  Py_DECREF(ascii_chars_b);
774  }
775  Py_DECREF(default_encoding);
776  return 0;
777 bad:
778  Py_XDECREF(default_encoding);
779  Py_XDECREF(ascii_chars_u);
780  Py_XDECREF(ascii_chars_b);
781  return -1;
782 }
783 #endif
784 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
785 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
786 #else
787 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
788 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
789 static char* __PYX_DEFAULT_STRING_ENCODING;
790 static int __Pyx_init_sys_getdefaultencoding_params(void) {
791  PyObject* sys;
792  PyObject* default_encoding = NULL;
793  char* default_encoding_c;
794  sys = PyImport_ImportModule("sys");
795  if (!sys) goto bad;
796  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
797  Py_DECREF(sys);
798  if (!default_encoding) goto bad;
799  default_encoding_c = PyBytes_AsString(default_encoding);
800  if (!default_encoding_c) goto bad;
801  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
802  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
803  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
804  Py_DECREF(default_encoding);
805  return 0;
806 bad:
807  Py_XDECREF(default_encoding);
808  return -1;
809 }
810 #endif
811 #endif
812 
813 
814 /* Test for GCC > 2.95 */
815 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
816  #define likely(x) __builtin_expect(!!(x), 1)
817  #define unlikely(x) __builtin_expect(!!(x), 0)
818 #else /* !__GNUC__ or GCC < 2.95 */
819  #define likely(x) (x)
820  #define unlikely(x) (x)
821 #endif /* __GNUC__ */
822 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
823 
824 static PyObject *__pyx_m = NULL;
825 static PyObject *__pyx_d;
826 static PyObject *__pyx_b;
827 static PyObject *__pyx_cython_runtime = NULL;
828 static PyObject *__pyx_empty_tuple;
829 static PyObject *__pyx_empty_bytes;
830 static PyObject *__pyx_empty_unicode;
831 static int __pyx_lineno;
832 static int __pyx_clineno = 0;
833 static const char * __pyx_cfilenm= __FILE__;
834 static const char *__pyx_filename;
835 
836 /* Header.proto */
837 #if !defined(CYTHON_CCOMPLEX)
838  #if defined(__cplusplus)
839  #define CYTHON_CCOMPLEX 1
840  #elif defined(_Complex_I)
841  #define CYTHON_CCOMPLEX 1
842  #else
843  #define CYTHON_CCOMPLEX 0
844  #endif
845 #endif
846 #if CYTHON_CCOMPLEX
847  #ifdef __cplusplus
848  #include <complex>
849  #else
850  #include <complex.h>
851  #endif
852 #endif
853 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
854  #undef _Complex_I
855  #define _Complex_I 1.0fj
856 #endif
857 
858 
859 static const char *__pyx_f[] = {
860  "proteus/WaveTools.py",
861  "stringsource",
862  "proteus/WaveTools.pxd",
863  "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd",
864  "linux/lib/python3.7/site-packages/Cython/Includes/cpython/type.pxd",
865 };
866 
867 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
868  * # in Cython to enable them only on the right systems.
869  *
870  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
871  * ctypedef npy_int16 int16_t
872  * ctypedef npy_int32 int32_t
873  */
874 typedef npy_int8 __pyx_t_5numpy_int8_t;
875 
876 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":777
877  *
878  * ctypedef npy_int8 int8_t
879  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
880  * ctypedef npy_int32 int32_t
881  * ctypedef npy_int64 int64_t
882  */
883 typedef npy_int16 __pyx_t_5numpy_int16_t;
884 
885 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
886  * ctypedef npy_int8 int8_t
887  * ctypedef npy_int16 int16_t
888  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
889  * ctypedef npy_int64 int64_t
890  * #ctypedef npy_int96 int96_t
891  */
892 typedef npy_int32 __pyx_t_5numpy_int32_t;
893 
894 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
895  * ctypedef npy_int16 int16_t
896  * ctypedef npy_int32 int32_t
897  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
898  * #ctypedef npy_int96 int96_t
899  * #ctypedef npy_int128 int128_t
900  */
901 typedef npy_int64 __pyx_t_5numpy_int64_t;
902 
903 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":783
904  * #ctypedef npy_int128 int128_t
905  *
906  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
907  * ctypedef npy_uint16 uint16_t
908  * ctypedef npy_uint32 uint32_t
909  */
910 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
911 
912 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
913  *
914  * ctypedef npy_uint8 uint8_t
915  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
916  * ctypedef npy_uint32 uint32_t
917  * ctypedef npy_uint64 uint64_t
918  */
919 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
920 
921 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
922  * ctypedef npy_uint8 uint8_t
923  * ctypedef npy_uint16 uint16_t
924  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
925  * ctypedef npy_uint64 uint64_t
926  * #ctypedef npy_uint96 uint96_t
927  */
928 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
929 
930 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":786
931  * ctypedef npy_uint16 uint16_t
932  * ctypedef npy_uint32 uint32_t
933  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
934  * #ctypedef npy_uint96 uint96_t
935  * #ctypedef npy_uint128 uint128_t
936  */
937 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
938 
939 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
940  * #ctypedef npy_uint128 uint128_t
941  *
942  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
943  * ctypedef npy_float64 float64_t
944  * #ctypedef npy_float80 float80_t
945  */
946 typedef npy_float32 __pyx_t_5numpy_float32_t;
947 
948 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
949  *
950  * ctypedef npy_float32 float32_t
951  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
952  * #ctypedef npy_float80 float80_t
953  * #ctypedef npy_float128 float128_t
954  */
955 typedef npy_float64 __pyx_t_5numpy_float64_t;
956 
957 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":800
958  * # The int types are mapped a bit surprising --
959  * # numpy.int corresponds to 'l' and numpy.long to 'q'
960  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
961  * ctypedef npy_longlong long_t
962  * ctypedef npy_longlong longlong_t
963  */
964 typedef npy_long __pyx_t_5numpy_int_t;
965 
966 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
967  * # numpy.int corresponds to 'l' and numpy.long to 'q'
968  * ctypedef npy_long int_t
969  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
970  * ctypedef npy_longlong longlong_t
971  *
972  */
973 typedef npy_longlong __pyx_t_5numpy_long_t;
974 
975 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
976  * ctypedef npy_long int_t
977  * ctypedef npy_longlong long_t
978  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
979  *
980  * ctypedef npy_ulong uint_t
981  */
982 typedef npy_longlong __pyx_t_5numpy_longlong_t;
983 
984 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":804
985  * ctypedef npy_longlong longlong_t
986  *
987  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
988  * ctypedef npy_ulonglong ulong_t
989  * ctypedef npy_ulonglong ulonglong_t
990  */
991 typedef npy_ulong __pyx_t_5numpy_uint_t;
992 
993 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
994  *
995  * ctypedef npy_ulong uint_t
996  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
997  * ctypedef npy_ulonglong ulonglong_t
998  *
999  */
1000 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1001 
1002 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
1003  * ctypedef npy_ulong uint_t
1004  * ctypedef npy_ulonglong ulong_t
1005  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1006  *
1007  * ctypedef npy_intp intp_t
1008  */
1009 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1010 
1011 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":808
1012  * ctypedef npy_ulonglong ulonglong_t
1013  *
1014  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_uintp uintp_t
1016  *
1017  */
1018 typedef npy_intp __pyx_t_5numpy_intp_t;
1019 
1020 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
1021  *
1022  * ctypedef npy_intp intp_t
1023  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1024  *
1025  * ctypedef npy_double float_t
1026  */
1027 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1028 
1029 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":811
1030  * ctypedef npy_uintp uintp_t
1031  *
1032  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1033  * ctypedef npy_double double_t
1034  * ctypedef npy_longdouble longdouble_t
1035  */
1036 typedef npy_double __pyx_t_5numpy_float_t;
1037 
1038 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
1039  *
1040  * ctypedef npy_double float_t
1041  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1042  * ctypedef npy_longdouble longdouble_t
1043  *
1044  */
1045 typedef npy_double __pyx_t_5numpy_double_t;
1046 
1047 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
1048  * ctypedef npy_double float_t
1049  * ctypedef npy_double double_t
1050  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1051  *
1052  * ctypedef npy_cfloat cfloat_t
1053  */
1054 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1055 /* Declarations.proto */
1056 #if CYTHON_CCOMPLEX
1057  #ifdef __cplusplus
1058  typedef ::std::complex< float > __pyx_t_float_complex;
1059  #else
1060  typedef float _Complex __pyx_t_float_complex;
1061  #endif
1062 #else
1063  typedef struct { float real, imag; } __pyx_t_float_complex;
1064 #endif
1065 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1066 
1067 /* Declarations.proto */
1068 #if CYTHON_CCOMPLEX
1069  #ifdef __cplusplus
1070  typedef ::std::complex< double > __pyx_t_double_complex;
1071  #else
1072  typedef double _Complex __pyx_t_double_complex;
1073  #endif
1074 #else
1075  typedef struct { double real, imag; } __pyx_t_double_complex;
1076 #endif
1077 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1078 
1079 
1080 /*--- Type declarations ---*/
1081 struct __pyx_obj_9WaveTools_SteadyCurrent;
1082 struct __pyx_obj_9WaveTools_SolitaryWave;
1083 struct __pyx_obj_9WaveTools_MonochromaticWaves;
1084 struct __pyx_obj_9WaveTools_NewWave;
1085 struct __pyx_obj_9WaveTools_RandomWaves;
1086 struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves;
1087 struct __pyx_obj_9WaveTools_DirectionalWaves;
1088 struct __pyx_obj_9WaveTools_TimeSeries;
1089 struct __pyx_obj_9WaveTools_RandomNLWaves;
1090 struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__;
1091 struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr;
1092 
1093 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":815
1094  * ctypedef npy_longdouble longdouble_t
1095  *
1096  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1097  * ctypedef npy_cdouble cdouble_t
1098  * ctypedef npy_clongdouble clongdouble_t
1099  */
1100 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1101 
1102 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":816
1103  *
1104  * ctypedef npy_cfloat cfloat_t
1105  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1106  * ctypedef npy_clongdouble clongdouble_t
1107  *
1108  */
1109 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1110 
1111 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":817
1112  * ctypedef npy_cfloat cfloat_t
1113  * ctypedef npy_cdouble cdouble_t
1114  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1115  *
1116  * ctypedef npy_cdouble complex_t
1117  */
1118 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1119 
1120 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":819
1121  * ctypedef npy_clongdouble clongdouble_t
1122  *
1123  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1124  *
1125  * cdef inline object PyArray_MultiIterNew1(a):
1126  */
1127 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1128 struct __pyx_defaults;
1129 typedef struct __pyx_defaults __pyx_defaults;
1130 
1131 /* "WaveTools.pxd":31
1132  *
1133  * # pointer to eta function
1134  * ctypedef double (*cfeta) (MonochromaticWaves, double* , double ) # <<<<<<<<<<<<<<
1135  *
1136  * # pointer to velocity function
1137  */
1138 typedef double (*__pyx_t_9WaveTools_cfeta)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double);
1139 
1140 /* "WaveTools.pxd":34
1141  *
1142  * # pointer to velocity function
1143  * ctypedef void (*cfvel) (MonochromaticWaves, double*, double* , double ) # <<<<<<<<<<<<<<
1144  *
1145  *
1146  */
1147 typedef void (*__pyx_t_9WaveTools_cfvel)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double);
1148 
1149 /* "WaveTools.pxd":186
1150  *
1151  * # pointer to eta function
1152  * ctypedef double (*cfeta2) (TimeSeries, double* , double ) # <<<<<<<<<<<<<<
1153  *
1154  * # pointer to velocity function
1155  */
1156 typedef double (*__pyx_t_9WaveTools_cfeta2)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double);
1157 
1158 /* "WaveTools.pxd":189
1159  *
1160  * # pointer to velocity function
1161  * ctypedef void (*cfvel2) (TimeSeries, double*, double* , double ) # <<<<<<<<<<<<<<
1162  *
1163  * cdef class TimeSeries:
1164  */
1165 typedef void (*__pyx_t_9WaveTools_cfvel2)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double);
1166 struct __pyx_defaults {
1167  PyObject *__pyx_arg_Lgen;
1168 };
1169 
1170 /* "WaveTools.pxd":37
1171  *
1172  *
1173  * cdef class SteadyCurrent: # <<<<<<<<<<<<<<
1174  * cdef public:
1175  * double mwl
1176  */
1177 struct __pyx_obj_9WaveTools_SteadyCurrent {
1178  PyObject_HEAD
1179  double mwl;
1180  PyArrayObject *U;
1181  double ramp;
1182 };
1183 
1184 
1185 /* "WaveTools.pxd":42
1186  * cdef np.ndarray U
1187  * cdef double ramp
1188  * cdef class SolitaryWave: # <<<<<<<<<<<<<<
1189  * cdef double H,gAbs,K,depth,d2,d3
1190  * cdef public:
1191  */
1192 struct __pyx_obj_9WaveTools_SolitaryWave {
1193  PyObject_HEAD
1194  double H;
1195  double gAbs;
1196  double K;
1197  double depth;
1198  double d2;
1199  double d3;
1200  double mwl;
1201  double c;
1202  PyArrayObject *g;
1203  PyArrayObject *waveDir;
1204  PyArrayObject *vDir;
1205  PyArrayObject *trans;
1206  bool fast;
1207 };
1208 
1209 
1210 /* "WaveTools.pxd":49
1211  * cdef bool fast
1212  *
1213  * cdef class MonochromaticWaves: # <<<<<<<<<<<<<<
1214  * cdef bool fast
1215  * cdef np.ndarray g,waveDir,vDir,Ycoeff,Bcoeff,kDir,tanhF,mV
1216  */
1217 struct __pyx_obj_9WaveTools_MonochromaticWaves {
1218  PyObject_HEAD
1219  struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *__pyx_vtab;
1220  bool fast;
1221  PyArrayObject *g;
1222  PyArrayObject *waveDir;
1223  PyArrayObject *vDir;
1224  PyArrayObject *Ycoeff;
1225  PyArrayObject *Bcoeff;
1226  PyArrayObject *kDir;
1227  PyArrayObject *tanhF;
1228  PyArrayObject *mV;
1229  double gAbs;
1230  double phi;
1231  double depth;
1232  double omega;
1233  double k;
1234  double phi0;
1235  double tanhL;
1236  double amplitude;
1237  int Nf;
1238  double *kDir_;
1239  double *waveDir_;
1240  double *vDir_;
1241  double *mV_;
1242  double *Ycoeff_;
1243  double *Bcoeff_;
1244  double *tanhF_;
1245  double kDir_c[3];
1246  double waveDir_c[3];
1247  double vDir_c[3];
1248  double mV_c[3];
1249  double Ycoeff_c[0x3E8];
1250  double Bcoeff_c[0x3E8];
1251  double tanh_c[0x3E8];
1252  double wavelength;
1253  double mwl;
1254  __pyx_t_9WaveTools_cfeta _cpp_eta;
1255  __pyx_t_9WaveTools_cfvel _cpp_u;
1256  PyObject *waveType;
1257 };
1258 
1259 
1260 /* "WaveTools.pxd":79
1261  * cdef void uFenton(self, double* U, double* x, double t)
1262  *
1263  * cdef class NewWave: # <<<<<<<<<<<<<<
1264  * cdef bool fast
1265  * cdef double* waveDir_
1266  */
1267 struct __pyx_obj_9WaveTools_NewWave {
1268  PyObject_HEAD
1269  struct __pyx_vtabstruct_9WaveTools_NewWave *__pyx_vtab;
1270  bool fast;
1271  double *waveDir_;
1272  double *vDir_;
1273  double *tanh_;
1274  double *ai_;
1275  double *phi_;
1276  double *omega_;
1277  double *kDir_;
1278  double *ki_;
1279  double waveDir_c[3];
1280  double vDir_c[3];
1281  double kDir_c[0x7530];
1282  double omega_c[0x2710];
1283  double ki_c[0x2710];
1284  double ai_c[0x2710];
1285  double tanh_c[0x2710];
1286  double phi_c[0x2710];
1287  double mwl;
1288  double depth;
1289  double gAbs;
1290  double Tlag;
1291  double Hs;
1292  double Tp;
1293  double fp;
1294  double bandFactor;
1295  double df;
1296  double focus;
1297  double tfocus;
1298  int N;
1299  PyArrayObject *fi;
1300  PyArrayObject *fim;
1301  PyArrayObject *Si_Jm;
1302  PyArrayObject *ki;
1303  PyArrayObject *omega;
1304  PyArrayObject *tanhF;
1305  PyArrayObject *g;
1306  PyArrayObject *waveDir;
1307  PyArrayObject *vDir;
1308  PyArrayObject *kDir;
1309  PyArrayObject *ai;
1310  PyObject *phi;
1311 };
1312 
1313 
1314 /* "WaveTools.pxd":104
1315  * cdef double _cpp_eta(self , double* x, double t)
1316  * cdef void _cpp_u(self, double *U, double* x, double t)
1317  * cdef class RandomWaves: # <<<<<<<<<<<<<<
1318  * cdef bool fast
1319  * cdef double* waveDir_
1320  */
1321 struct __pyx_obj_9WaveTools_RandomWaves {
1322  PyObject_HEAD
1323  struct __pyx_vtabstruct_9WaveTools_RandomWaves *__pyx_vtab;
1324  bool fast;
1325  double *waveDir_;
1326  double *vDir_;
1327  double *tanh_;
1328  double *ai_;
1329  double *phi_;
1330  double *omega_;
1331  double *kDir_;
1332  double *ki_;
1333  double waveDir_c[3];
1334  double vDir_c[3];
1335  double kDir_c[0x7530];
1336  double omega_c[0x2710];
1337  double ki_c[0x2710];
1338  double ai_c[0x2710];
1339  double tanh_c[0x2710];
1340  double phi_c[0x2710];
1341  double mwl;
1342  double depth;
1343  double gAbs;
1344  double Tlag;
1345  double Hs;
1346  double Tp;
1347  double fp;
1348  double bandFactor;
1349  double df;
1350  double wavelength;
1351  int N;
1352  PyArrayObject *fi;
1353  PyArrayObject *fim;
1354  PyArrayObject *Si_Jm;
1355  PyArrayObject *ki;
1356  PyArrayObject *omega;
1357  PyArrayObject *tanhF;
1358  PyArrayObject *g;
1359  PyArrayObject *waveDir;
1360  PyArrayObject *vDir;
1361  PyArrayObject *kDir;
1362  PyArrayObject *ai;
1363  PyObject *phi;
1364 };
1365 
1366 
1367 /* "WaveTools.pxd":132
1368  *
1369  *
1370  * cdef class MultiSpectraRandomWaves: # <<<<<<<<<<<<<<
1371  * cdef bool fast
1372  * cdef double gAbs
1373  */
1374 struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves {
1375  PyObject_HEAD
1376  struct __pyx_vtabstruct_9WaveTools_MultiSpectraRandomWaves *__pyx_vtab;
1377  bool fast;
1378  double gAbs;
1379  int Nall;
1380  int N;
1381  PyArrayObject *g;
1382  PyArrayObject *vDir;
1383  PyArrayObject *waveDir;
1384  PyArrayObject *omegaM;
1385  PyArrayObject *phiM;
1386  PyArrayObject *kiM;
1387  PyArrayObject *kDirM;
1388  PyArrayObject *tanhFM;
1389  PyArrayObject *aiM;
1390  double *vDir_;
1391  double *omegaM_;
1392  double *phiM_;
1393  double *kiM_;
1394  double *kDirM_;
1395  double *tanhM_;
1396  double *waveDirM_;
1397  double *aiM_;
1398  double vDir_c[3];
1399  double kDir_cM[0x7530];
1400  double waveDir_cM[0x7530];
1401  double omega_cM[0x2710];
1402  double ki_cM[0x2710];
1403  double ai_cM[0x2710];
1404  double tanh_cM[0x2710];
1405  double phi_cM[0x2710];
1406  double mwl;
1407  double depth;
1408 };
1409 
1410 
1411 /* "WaveTools.pxd":158
1412  * cdef void _cpp_u(self, double* U, double* x, double t)
1413  *
1414  * cdef class DirectionalWaves: # <<<<<<<<<<<<<<
1415  * cdef bool fast
1416  * cdef double gAbs
1417  */
1418 struct __pyx_obj_9WaveTools_DirectionalWaves {
1419  PyObject_HEAD
1420  struct __pyx_vtabstruct_9WaveTools_DirectionalWaves *__pyx_vtab;
1421  bool fast;
1422  double gAbs;
1423  int Nall;
1424  int Mtot;
1425  int N;
1426  PyArrayObject *vDir;
1427  PyArrayObject *omega;
1428  PyArrayObject *tanh;
1429  PyArrayObject *waveDir0;
1430  PyArrayObject *waveDirs;
1431  PyArrayObject *phiDirs;
1432  PyArrayObject *aiDirs;
1433  PyArrayObject *ki;
1434  PyArrayObject *kDirs;
1435  PyArrayObject *tanhF;
1436  double *vDir_;
1437  double *omega_;
1438  double *phi_;
1439  double *ki_;
1440  double *kDir_;
1441  double *tanh_;
1442  double *waveDir_;
1443  double *ai_;
1444  double vDir_c[3];
1445  double kDir_c[0x493E0];
1446  double waveDir_c[0x493E0];
1447  double omega_c[0x186A0];
1448  double ki_c[0x186A0];
1449  double ai_c[0x186A0];
1450  double tanh_c[0x186A0];
1451  double phi_c[0x186A0];
1452  double mwl;
1453  double depth;
1454 };
1455 
1456 
1457 /* "WaveTools.pxd":191
1458  * ctypedef void (*cfvel2) (TimeSeries, double*, double* , double )
1459  *
1460  * cdef class TimeSeries: # <<<<<<<<<<<<<<
1461  * cdef bool fast,rec_direct
1462  * cdef np.ndarray g,waveDir,vDir,x0,kDir,tanhF,time,etaS,ai,omega,phi,ki
1463  */
1464 struct __pyx_obj_9WaveTools_TimeSeries {
1465  PyObject_HEAD
1466  struct __pyx_vtabstruct_9WaveTools_TimeSeries *__pyx_vtab;
1467  bool fast;
1468  bool rec_direct;
1469  PyArrayObject *g;
1470  PyArrayObject *waveDir;
1471  PyArrayObject *vDir;
1472  PyArrayObject *x0;
1473  PyArrayObject *kDir;
1474  PyArrayObject *tanhF;
1475  PyArrayObject *time;
1476  PyArrayObject *etaS;
1477  PyArrayObject *ai;
1478  PyArrayObject *omega;
1479  PyArrayObject *phi;
1480  PyArrayObject *ki;
1481  double gAbs;
1482  double depth;
1483  double Tm;
1484  double overlap;
1485  double cutoff;
1486  double setup;
1487  double handover;
1488  double Twindow;
1489  double Tlag;
1490  double Toverlap;
1491  double dt;
1492  double t0;
1493  double tlength;
1494  int N;
1495  int Nall;
1496  int Nf;
1497  int Nwaves;
1498  int Nwindows;
1499  PyObject *windows_handover;
1500  PyObject *windows_rec;
1501  PyObject *decompose_window;
1502  double *kDir_;
1503  double *waveDir_;
1504  double *vDir_;
1505  double *tanh_;
1506  double *whand_;
1507  double *ai_;
1508  double *omega_;
1509  double *phi_;
1510  double *ki_;
1511  double *T0_;
1512  double x0_[3];
1513  double kDir_c[0x2DC6C0];
1514  double ki_c[0xF4240];
1515  double ai_c[0xF4240];
1516  double omega_c[0xF4240];
1517  double phi_c[0xF4240];
1518  double tanh_c[0xF4240];
1519  double waveDir_c[3];
1520  double vDir_c[3];
1521  double x0_c[3];
1522  double whand_c[0xF4240];
1523  double T0[0xF4240];
1524  double wavelength;
1525  double mwl;
1526  PyObject *eta;
1527  PyObject *u;
1528  __pyx_t_9WaveTools_cfeta2 _cpp_eta;
1529  __pyx_t_9WaveTools_cfvel2 _cpp_u;
1530 };
1531 
1532 
1533 /* "WaveTools.pxd":229
1534  * cdef void _cpp_uWindow(self, double* U, double* x, double t)
1535  *
1536  * cdef class RandomNLWaves: # <<<<<<<<<<<<<<
1537  * cdef bool fast
1538  * cdef np.ndarray omega,ki,kDir,phi,tanhKd,sinhKd,waveDir,ai
1539  */
1540 struct __pyx_obj_9WaveTools_RandomNLWaves {
1541  PyObject_HEAD
1542  struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *__pyx_vtab;
1543  bool fast;
1544  PyArrayObject *omega;
1545  PyArrayObject *ki;
1546  PyArrayObject *kDir;
1547  PyArrayObject *phi;
1548  PyArrayObject *tanhKd;
1549  PyArrayObject *sinhKd;
1550  PyArrayObject *waveDir;
1551  PyArrayObject *ai;
1552  int N;
1553  double depth;
1554  double gAbs;
1555  double *tanhKd_;
1556  double *sinhKd_;
1557  double *ai_;
1558  double *phi_;
1559  double *omega_;
1560  double *kDir_;
1561  double *ki_;
1562  double kDir_c[0x7530];
1563  double omega_c[0x2710];
1564  double ki_c[0x2710];
1565  double ai_c[0x2710];
1566  double tanh_c[0x2710];
1567  double sinh_c[0x2710];
1568  double phi_c[0x2710];
1569  PyObject *eta;
1570  PyObject *u;
1571  PyObject *eta_linear;
1572 };
1573 
1574 
1575 /* "WaveTools.py":1200
1576  * Switch for optimised functions
1577  * """
1578  * def __cinit__(self, # <<<<<<<<<<<<<<
1579  * Tp,
1580  * Hs,
1581  */
1582 struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ {
1583  PyObject_HEAD
1584  struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self;
1585  PyObject *__pyx_v_xfocus;
1586 };
1587 
1588 
1589 /* "WaveTools.py":1264
1590  * if(self.N > 10000):
1591  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
1592  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega # <<<<<<<<<<<<<<
1593  *
1594  *
1595  */
1596 struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr {
1597  PyObject_HEAD
1598  struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *__pyx_outer_scope;
1599  PyObject *__pyx_v_j;
1600  PyObject *__pyx_t_0;
1601  Py_ssize_t __pyx_t_1;
1602  PyObject *(*__pyx_t_2)(PyObject *);
1603 };
1604 
1605 
1606 
1607 /* "WaveTools.py":888
1608  *
1609  *
1610  * class MonochromaticWaves(object): # <<<<<<<<<<<<<<
1611  * """
1612  * This class is used for generating regular waves in both linear and nonlinear regimes. See Dean and Dalrymple 1994 for equations.
1613  */
1614 
1615 struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves {
1616  double (*etaLinear)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double);
1617  double (*etaFenton)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double);
1618  void (*uLinear)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double);
1619  void (*uFenton)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double);
1620 };
1621 static struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *__pyx_vtabptr_9WaveTools_MonochromaticWaves;
1622 
1623 
1624 /* "WaveTools.py":1161
1625  * return U
1626  *
1627  * class NewWave(object): # <<<<<<<<<<<<<<
1628  * """
1629  * This class is used for generating the NewWave theory (see Tromans et al. 1991)
1630  */
1631 
1632 struct __pyx_vtabstruct_9WaveTools_NewWave {
1633  double (*_cpp_eta)(struct __pyx_obj_9WaveTools_NewWave *, double *, double);
1634  void (*_cpp_u)(struct __pyx_obj_9WaveTools_NewWave *, double *, double *, double);
1635 };
1636 static struct __pyx_vtabstruct_9WaveTools_NewWave *__pyx_vtabptr_9WaveTools_NewWave;
1637 
1638 
1639 /* "WaveTools.py":1394
1640  * return series
1641  *
1642  * class RandomWaves(object): # <<<<<<<<<<<<<<
1643  * """
1644  * This class is used for generating plane random waves using linear reconstruction of components from a
1645  */
1646 
1647 struct __pyx_vtabstruct_9WaveTools_RandomWaves {
1648  double (*_cpp_eta)(struct __pyx_obj_9WaveTools_RandomWaves *, double *, double);
1649  void (*_cpp_u)(struct __pyx_obj_9WaveTools_RandomWaves *, double *, double *, double);
1650 };
1651 static struct __pyx_vtabstruct_9WaveTools_RandomWaves *__pyx_vtabptr_9WaveTools_RandomWaves;
1652 
1653 
1654 /* "WaveTools.py":1633
1655  *
1656  *
1657  * class MultiSpectraRandomWaves(object): # <<<<<<<<<<<<<<
1658  * """This class is used for generating random waves by combining
1659  * multiple spectra with different distributions and directions
1660  */
1661 
1662 struct __pyx_vtabstruct_9WaveTools_MultiSpectraRandomWaves {
1663  double (*_cpp_eta)(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *, double *, double);
1664  void (*_cpp_u)(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *, double *, double *, double);
1665 };
1666 static struct __pyx_vtabstruct_9WaveTools_MultiSpectraRandomWaves *__pyx_vtabptr_9WaveTools_MultiSpectraRandomWaves;
1667 
1668 
1669 /* "WaveTools.py":1828
1670  *
1671  *
1672  * class DirectionalWaves(object): # <<<<<<<<<<<<<<
1673  * """
1674  * This class is used for generating directional random waves using linear reconstruction of components from a
1675  */
1676 
1677 struct __pyx_vtabstruct_9WaveTools_DirectionalWaves {
1678  double (*_cpp_eta)(struct __pyx_obj_9WaveTools_DirectionalWaves *, double *, double);
1679  void (*_cpp_u)(struct __pyx_obj_9WaveTools_DirectionalWaves *, double *, double *, double);
1680 };
1681 static struct __pyx_vtabstruct_9WaveTools_DirectionalWaves *__pyx_vtabptr_9WaveTools_DirectionalWaves;
1682 
1683 
1684 /* "WaveTools.py":2071
1685  *
1686  *
1687  * class TimeSeries(object): # <<<<<<<<<<<<<<
1688  * """This class is used for generating waves from an arbirtrary free-surface elevation time series
1689  *
1690  */
1691 
1692 struct __pyx_vtabstruct_9WaveTools_TimeSeries {
1693  double (*_cpp_etaDirect)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double);
1694  double (*_cpp_etaWindow)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double);
1695  void (*_cpp_uDirect)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double);
1696  void (*_cpp_uWindow)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double);
1697 };
1698 static struct __pyx_vtabstruct_9WaveTools_TimeSeries *__pyx_vtabptr_9WaveTools_TimeSeries;
1699 
1700 
1701 /* "WaveTools.py":2739
1702  *
1703  *
1704  * class RandomNLWaves(object): # <<<<<<<<<<<<<<
1705  * """
1706  * This class is contains functions for calculating random waves with 2nd order corrections
1707  */
1708 
1709 struct __pyx_vtabstruct_9WaveTools_RandomNLWaves {
1710  double (*_cpp_eta_2ndOrder)(struct __pyx_obj_9WaveTools_RandomNLWaves *, double *, double);
1711  double (*_cpp_eta_short)(struct __pyx_obj_9WaveTools_RandomNLWaves *, double *, double);
1712  double (*_cpp_eta_long)(struct __pyx_obj_9WaveTools_RandomNLWaves *, double *, double);
1713 };
1714 static struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *__pyx_vtabptr_9WaveTools_RandomNLWaves;
1715 
1716 /* --- Runtime support code (head) --- */
1717 /* Refnanny.proto */
1718 #ifndef CYTHON_REFNANNY
1719  #define CYTHON_REFNANNY 0
1720 #endif
1721 #if CYTHON_REFNANNY
1722  typedef struct {
1723  void (*INCREF)(void*, PyObject*, int);
1724  void (*DECREF)(void*, PyObject*, int);
1725  void (*GOTREF)(void*, PyObject*, int);
1726  void (*GIVEREF)(void*, PyObject*, int);
1727  void* (*SetupContext)(const char*, int, const char*);
1728  void (*FinishContext)(void**);
1729  } __Pyx_RefNannyAPIStruct;
1730  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1731  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1732  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1733 #ifdef WITH_THREAD
1734  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1735  if (acquire_gil) {\
1736  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1737  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1738  PyGILState_Release(__pyx_gilstate_save);\
1739  } else {\
1740  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1741  }
1742 #else
1743  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1744  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1745 #endif
1746  #define __Pyx_RefNannyFinishContext()\
1747  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1748  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1749  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1750  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1751  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1752  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1753  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1754  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1755  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1756 #else
1757  #define __Pyx_RefNannyDeclarations
1758  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1759  #define __Pyx_RefNannyFinishContext()
1760  #define __Pyx_INCREF(r) Py_INCREF(r)
1761  #define __Pyx_DECREF(r) Py_DECREF(r)
1762  #define __Pyx_GOTREF(r)
1763  #define __Pyx_GIVEREF(r)
1764  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1765  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1766  #define __Pyx_XGOTREF(r)
1767  #define __Pyx_XGIVEREF(r)
1768 #endif
1769 #define __Pyx_XDECREF_SET(r, v) do {\
1770  PyObject *tmp = (PyObject *) r;\
1771  r = v; __Pyx_XDECREF(tmp);\
1772  } while (0)
1773 #define __Pyx_DECREF_SET(r, v) do {\
1774  PyObject *tmp = (PyObject *) r;\
1775  r = v; __Pyx_DECREF(tmp);\
1776  } while (0)
1777 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1778 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1779 
1780 /* PyObjectGetAttrStr.proto */
1781 #if CYTHON_USE_TYPE_SLOTS
1782 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1783 #else
1784 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1785 #endif
1786 
1787 /* GetBuiltinName.proto */
1788 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1789 
1790 /* RaiseDoubleKeywords.proto */
1791 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1792 
1793 /* ParseKeywords.proto */
1794 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1795  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1796  const char* function_name);
1797 
1798 /* RaiseArgTupleInvalid.proto */
1799 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1800  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1801 
1802 /* GetModuleGlobalName.proto */
1803 #if CYTHON_USE_DICT_VERSIONS
1804 #define __Pyx_GetModuleGlobalName(var, name) {\
1805  static PY_UINT64_T __pyx_dict_version = 0;\
1806  static PyObject *__pyx_dict_cached_value = NULL;\
1807  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1808  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1809  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1810 }
1811 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1812  PY_UINT64_T __pyx_dict_version;\
1813  PyObject *__pyx_dict_cached_value;\
1814  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1815 }
1816 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1817 #else
1818 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1819 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1820 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1821 #endif
1822 
1823 /* PyFunctionFastCall.proto */
1824 #if CYTHON_FAST_PYCALL
1825 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1826  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1827 #if 1 || PY_VERSION_HEX < 0x030600B1
1828 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1829 #else
1830 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1831 #endif
1832 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1833  (sizeof(char [1 - 2*!(cond)]) - 1)
1834 #ifndef Py_MEMBER_SIZE
1835 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1836 #endif
1837  static size_t __pyx_pyframe_localsplus_offset = 0;
1838  #include "frameobject.h"
1839  #define __Pxy_PyFrame_Initialize_Offsets()\
1840  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1841  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1842  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1843  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1844 #endif
1845 
1846 /* PyCFunctionFastCall.proto */
1847 #if CYTHON_FAST_PYCCALL
1848 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1849 #else
1850 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1851 #endif
1852 
1853 /* PyObjectCall.proto */
1854 #if CYTHON_COMPILING_IN_CPYTHON
1855 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1856 #else
1857 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1858 #endif
1859 
1860 /* PyObjectCall2Args.proto */
1861 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1862 
1863 /* PyObjectCallMethO.proto */
1864 #if CYTHON_COMPILING_IN_CPYTHON
1865 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1866 #endif
1867 
1868 /* PyObjectCallOneArg.proto */
1869 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1870 
1871 /* ListAppend.proto */
1872 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1873 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1874  PyListObject* L = (PyListObject*) list;
1875  Py_ssize_t len = Py_SIZE(list);
1876  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1877  Py_INCREF(x);
1878  PyList_SET_ITEM(list, len, x);
1879  Py_SIZE(list) = len+1;
1880  return 0;
1881  }
1882  return PyList_Append(list, x);
1883 }
1884 #else
1885 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1886 #endif
1887 
1888 /* PySequenceContains.proto */
1889 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1890  int result = PySequence_Contains(seq, item);
1891  return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1892 }
1893 
1894 /* None.proto */
1895 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1896 
1897 /* GetItemInt.proto */
1898 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1899  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1900  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1901  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1902  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1903 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1904  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1905  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1906  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1907 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1908  int wraparound, int boundscheck);
1909 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1910  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1911  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1912  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1913 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1914  int wraparound, int boundscheck);
1915 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1916 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1917  int is_list, int wraparound, int boundscheck);
1918 
1919 /* py_abs.proto */
1920 #if CYTHON_USE_PYLONG_INTERNALS
1921 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
1922 #define __Pyx_PyNumber_Absolute(x)\
1923  ((likely(PyLong_CheckExact(x))) ?\
1924  (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
1925  PyNumber_Absolute(x))
1926 #else
1927 #define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x)
1928 #endif
1929 
1930 /* SliceObject.proto */
1931 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
1932  PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
1933  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1934  int has_cstart, int has_cstop, int wraparound);
1935 
1936 /* PyObjectCallNoArg.proto */
1937 #if CYTHON_COMPILING_IN_CPYTHON
1938 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1939 #else
1940 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1941 #endif
1942 
1943 /* ObjectGetItem.proto */
1944 #if CYTHON_USE_TYPE_SLOTS
1945 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1946 #else
1947 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1948 #endif
1949 
1950 /* PyFloatBinop.proto */
1951 #if !CYTHON_COMPILING_IN_PYPY
1952 static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace);
1953 #else
1954 #define __Pyx_PyFloat_AddCObj(op1, op2, floatval, inplace)\
1955  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1956 #endif
1957 
1958 /* PyFloatBinop.proto */
1959 #if !CYTHON_COMPILING_IN_PYPY
1960 static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
1961 #else
1962 #define __Pyx_PyFloat_SubtractObjC(op1, op2, floatval, inplace)\
1963  (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1964 #endif
1965 
1966 /* SliceObject.proto */
1967 #define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
1968  __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
1969 static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
1970  PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
1971  PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
1972  int has_cstart, int has_cstop, int wraparound);
1973 
1974 /* pyobject_as_double.proto */
1975 static double __Pyx__PyObject_AsDouble(PyObject* obj);
1976 #if CYTHON_COMPILING_IN_PYPY
1977 #define __Pyx_PyObject_AsDouble(obj)\
1978 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
1979  likely(PyInt_CheckExact(obj)) ?\
1980  PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
1981 #else
1982 #define __Pyx_PyObject_AsDouble(obj)\
1983 ((likely(PyFloat_CheckExact(obj))) ?\
1984  PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
1985 #endif
1986 
1987 /* PyIntBinop.proto */
1988 #if !CYTHON_COMPILING_IN_PYPY
1989 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1990 #else
1991 #define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
1992  (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
1993 #endif
1994 
1995 /* GetTopmostException.proto */
1996 #if CYTHON_USE_EXC_INFO_STACK
1997 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1998 #endif
1999 
2000 /* PyThreadStateGet.proto */
2001 #if CYTHON_FAST_THREAD_STATE
2002 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2003 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2004 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
2005 #else
2006 #define __Pyx_PyThreadState_declare
2007 #define __Pyx_PyThreadState_assign
2008 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
2009 #endif
2010 
2011 /* SaveResetException.proto */
2012 #if CYTHON_FAST_THREAD_STATE
2013 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2014 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2015 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2016 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2017 #else
2018 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2019 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2020 #endif
2021 
2022 /* GetException.proto */
2023 #if CYTHON_FAST_THREAD_STATE
2024 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2025 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2026 #else
2027 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2028 #endif
2029 
2030 /* ExtTypeTest.proto */
2031 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2032 
2033 /* PyErrExceptionMatches.proto */
2034 #if CYTHON_FAST_THREAD_STATE
2035 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2036 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2037 #else
2038 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2039 #endif
2040 
2041 /* PyErrFetchRestore.proto */
2042 #if CYTHON_FAST_THREAD_STATE
2043 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2044 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2045 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2046 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2047 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2048 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2049 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2050 #if CYTHON_COMPILING_IN_CPYTHON
2051 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2052 #else
2053 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2054 #endif
2055 #else
2056 #define __Pyx_PyErr_Clear() PyErr_Clear()
2057 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2058 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2059 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2060 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2061 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2062 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2063 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2064 #endif
2065 
2066 /* GetAttr.proto */
2067 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2068 
2069 /* GetAttr3.proto */
2070 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2071 
2072 /* PyFloatBinop.proto */
2073 #if !CYTHON_COMPILING_IN_PYPY
2074 static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace);
2075 #else
2076 #define __Pyx_PyFloat_TrueDivideCObj(op1, op2, floatval, inplace)\
2077  (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
2078 #endif
2079 
2080 /* IncludeStringH.proto */
2081 #include <string.h>
2082 
2083 /* BytesEquals.proto */
2084 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2085 
2086 /* UnicodeEquals.proto */
2087 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2088 
2089 /* StrEquals.proto */
2090 #if PY_MAJOR_VERSION >= 3
2091 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2092 #else
2093 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2094 #endif
2095 
2096 /* PyFloatBinop.proto */
2097 #if !CYTHON_COMPILING_IN_PYPY
2098 static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
2099 #else
2100 #define __Pyx_PyFloat_EqObjC(op1, op2, floatval, inplace)\
2101  (PyObject_RichCompare(op1, op2, Py_EQ))
2102  #endif
2103 
2104 /* PyIntBinop.proto */
2105 #if !CYTHON_COMPILING_IN_PYPY
2106 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
2107 #else
2108 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
2109  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2110 #endif
2111 
2112 /* Import.proto */
2113 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2114 
2115 /* ImportFrom.proto */
2116 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2117 
2118 /* DictGetItem.proto */
2119 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
2120 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
2121 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
2122  (likely(PyDict_CheckExact(obj)) ?\
2123  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
2124 #else
2125 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
2126 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
2127 #endif
2128 
2129 /* RaiseTooManyValuesToUnpack.proto */
2130 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2131 
2132 /* RaiseNeedMoreValuesToUnpack.proto */
2133 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2134 
2135 /* IterFinish.proto */
2136 static CYTHON_INLINE int __Pyx_IterFinish(void);
2137 
2138 /* UnpackItemEndCheck.proto */
2139 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2140 
2141 /* SetItemInt.proto */
2142 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2143  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2144  __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2145  (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2146  __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2147 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2148 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2149  int is_list, int wraparound, int boundscheck);
2150 
2151 /* RaiseException.proto */
2152 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2153 
2154 /* None.proto */
2155 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
2156 
2157 /* PyFloatBinop.proto */
2158 #if !CYTHON_COMPILING_IN_PYPY
2159 static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
2160 #else
2161 #define __Pyx_PyFloat_TrueDivideObjC(op1, op2, floatval, inplace)\
2162  (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
2163 #endif
2164 
2165 /* PyIntCompare.proto */
2166 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
2167 
2168 /* PyObjectGetMethod.proto */
2169 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2170 
2171 /* PyObjectCallMethod1.proto */
2172 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
2173 
2174 /* append.proto */
2175 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
2176 
2177 /* PyObjectSetAttrStr.proto */
2178 #if CYTHON_USE_TYPE_SLOTS
2179 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
2180 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
2181 #else
2182 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
2183 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
2184 #endif
2185 
2186 /* HasAttr.proto */
2187 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2188 
2189 /* RaiseNoneIterError.proto */
2190 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2191 
2192 /* PyObject_GenericGetAttrNoDict.proto */
2193 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2194 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2195 #else
2196 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2197 #endif
2198 
2199 /* PyObject_GenericGetAttr.proto */
2200 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2201 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2202 #else
2203 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2204 #endif
2205 
2206 /* SetupReduce.proto */
2207 static int __Pyx_setup_reduce(PyObject* type_obj);
2208 
2209 /* SetVTable.proto */
2210 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2211 
2212 /* TypeImport.proto */
2213 #ifndef __PYX_HAVE_RT_ImportType_proto
2214 #define __PYX_HAVE_RT_ImportType_proto
2215 enum __Pyx_ImportType_CheckSize {
2216  __Pyx_ImportType_CheckSize_Error = 0,
2217  __Pyx_ImportType_CheckSize_Warn = 1,
2218  __Pyx_ImportType_CheckSize_Ignore = 2
2219 };
2220 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2221 #endif
2222 
2223 /* FetchCommonType.proto */
2224 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2225 
2226 /* CythonFunction.proto */
2227 #define __Pyx_CyFunction_USED 1
2228 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2229 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2230 #define __Pyx_CYFUNCTION_CCLASS 0x04
2231 #define __Pyx_CyFunction_GetClosure(f)\
2232  (((__pyx_CyFunctionObject *) (f))->func_closure)
2233 #define __Pyx_CyFunction_GetClassObj(f)\
2234  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2235 #define __Pyx_CyFunction_Defaults(type, f)\
2236  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2237 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2238  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2239 typedef struct {
2240  PyCFunctionObject func;
2241 #if PY_VERSION_HEX < 0x030500A0
2242  PyObject *func_weakreflist;
2243 #endif
2244  PyObject *func_dict;
2245  PyObject *func_name;
2246  PyObject *func_qualname;
2247  PyObject *func_doc;
2248  PyObject *func_globals;
2249  PyObject *func_code;
2250  PyObject *func_closure;
2251  PyObject *func_classobj;
2252  void *defaults;
2253  int defaults_pyobjects;
2254  int flags;
2255  PyObject *defaults_tuple;
2256  PyObject *defaults_kwdict;
2257  PyObject *(*defaults_getter)(PyObject *);
2258  PyObject *func_annotations;
2259 } __pyx_CyFunctionObject;
2260 static PyTypeObject *__pyx_CyFunctionType = 0;
2261 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2262 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
2263  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
2264 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
2265  int flags, PyObject* qualname,
2266  PyObject *self,
2267  PyObject *module, PyObject *globals,
2268  PyObject* code);
2269 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2270  size_t size,
2271  int pyobjects);
2272 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2273  PyObject *tuple);
2274 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2275  PyObject *dict);
2276 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2277  PyObject *dict);
2278 static int __pyx_CyFunction_init(void);
2279 
2280 /* CalculateMetaclass.proto */
2281 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2282 
2283 /* SetNameInClass.proto */
2284 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
2285 #define __Pyx_SetNameInClass(ns, name, value)\
2286  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
2287 #elif CYTHON_COMPILING_IN_CPYTHON
2288 #define __Pyx_SetNameInClass(ns, name, value)\
2289  (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
2290 #else
2291 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
2292 #endif
2293 
2294 /* Py3ClassCreate.proto */
2295 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2296  PyObject *mkw, PyObject *modname, PyObject *doc);
2297 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2298  PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2299 
2300 /* CLineInTraceback.proto */
2301 #ifdef CYTHON_CLINE_IN_TRACEBACK
2302 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2303 #else
2304 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2305 #endif
2306 
2307 /* CodeObjectCache.proto */
2308 typedef struct {
2309  PyCodeObject* code_object;
2310  int code_line;
2311 } __Pyx_CodeObjectCacheEntry;
2312 struct __Pyx_CodeObjectCache {
2313  int count;
2314  int max_count;
2315  __Pyx_CodeObjectCacheEntry* entries;
2316 };
2317 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2318 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2319 static PyCodeObject *__pyx_find_code_object(int code_line);
2320 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2321 
2322 /* AddTraceback.proto */
2323 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2324  int py_line, const char *filename);
2325 
2326 /* CIntToPy.proto */
2327 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2328 
2329 /* CIntToPy.proto */
2330 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2331 
2332 /* CIntToPy.proto */
2333 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
2334 
2335 /* RealImag.proto */
2336 #if CYTHON_CCOMPLEX
2337  #ifdef __cplusplus
2338  #define __Pyx_CREAL(z) ((z).real())
2339  #define __Pyx_CIMAG(z) ((z).imag())
2340  #else
2341  #define __Pyx_CREAL(z) (__real__(z))
2342  #define __Pyx_CIMAG(z) (__imag__(z))
2343  #endif
2344 #else
2345  #define __Pyx_CREAL(z) ((z).real)
2346  #define __Pyx_CIMAG(z) ((z).imag)
2347 #endif
2348 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2349  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2350  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2351  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2352 #else
2353  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2354  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2355 #endif
2356 
2357 /* Arithmetic.proto */
2358 #if CYTHON_CCOMPLEX
2359  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2360  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2361  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2362  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2363  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2364  #define __Pyx_c_neg_float(a) (-(a))
2365  #ifdef __cplusplus
2366  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2367  #define __Pyx_c_conj_float(z) (::std::conj(z))
2368  #if 1
2369  #define __Pyx_c_abs_float(z) (::std::abs(z))
2370  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2371  #endif
2372  #else
2373  #define __Pyx_c_is_zero_float(z) ((z)==0)
2374  #define __Pyx_c_conj_float(z) (conjf(z))
2375  #if 1
2376  #define __Pyx_c_abs_float(z) (cabsf(z))
2377  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2378  #endif
2379  #endif
2380 #else
2381  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2382  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2383  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2384  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2385  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2386  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2387  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2388  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2389  #if 1
2390  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2391  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2392  #endif
2393 #endif
2394 
2395 /* Arithmetic.proto */
2396 #if CYTHON_CCOMPLEX
2397  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2398  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2399  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2400  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2401  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2402  #define __Pyx_c_neg_double(a) (-(a))
2403  #ifdef __cplusplus
2404  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2405  #define __Pyx_c_conj_double(z) (::std::conj(z))
2406  #if 1
2407  #define __Pyx_c_abs_double(z) (::std::abs(z))
2408  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2409  #endif
2410  #else
2411  #define __Pyx_c_is_zero_double(z) ((z)==0)
2412  #define __Pyx_c_conj_double(z) (conj(z))
2413  #if 1
2414  #define __Pyx_c_abs_double(z) (cabs(z))
2415  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2416  #endif
2417  #endif
2418 #else
2419  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2420  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2421  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2422  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2423  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2424  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2425  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2426  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2427  #if 1
2428  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2429  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2430  #endif
2431 #endif
2432 
2433 /* CIntToPy.proto */
2434 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2435 
2436 /* CIntFromPy.proto */
2437 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2438 
2439 /* CIntFromPy.proto */
2440 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2441 
2442 /* CIntFromPy.proto */
2443 static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
2444 
2445 /* FastTypeChecks.proto */
2446 #if CYTHON_COMPILING_IN_CPYTHON
2447 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2448 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2449 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2450 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2451 #else
2452 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2453 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2454 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2455 #endif
2456 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2457 
2458 /* SwapException.proto */
2459 #if CYTHON_FAST_THREAD_STATE
2460 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2461 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2462 #else
2463 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2464 #endif
2465 
2466 /* CoroutineBase.proto */
2467 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
2468 #if CYTHON_USE_EXC_INFO_STACK
2469 #define __Pyx_ExcInfoStruct _PyErr_StackItem
2470 #else
2471 typedef struct {
2472  PyObject *exc_type;
2473  PyObject *exc_value;
2474  PyObject *exc_traceback;
2475 } __Pyx_ExcInfoStruct;
2476 #endif
2477 typedef struct {
2478  PyObject_HEAD
2479  __pyx_coroutine_body_t body;
2480  PyObject *closure;
2481  __Pyx_ExcInfoStruct gi_exc_state;
2482  PyObject *gi_weakreflist;
2483  PyObject *classobj;
2484  PyObject *yieldfrom;
2485  PyObject *gi_name;
2486  PyObject *gi_qualname;
2487  PyObject *gi_modulename;
2488  PyObject *gi_code;
2489  int resume_label;
2490  char is_running;
2491 } __pyx_CoroutineObject;
2492 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
2493  PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2494  PyObject *name, PyObject *qualname, PyObject *module_name);
2495 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
2496  __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
2497  PyObject *name, PyObject *qualname, PyObject *module_name);
2498 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
2499 static int __Pyx_Coroutine_clear(PyObject *self);
2500 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
2501 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
2502 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
2503 #if CYTHON_USE_EXC_INFO_STACK
2504 #define __Pyx_Coroutine_SwapException(self)
2505 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
2506 #else
2507 #define __Pyx_Coroutine_SwapException(self) {\
2508  __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
2509  __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
2510  }
2511 #define __Pyx_Coroutine_ResetAndClearException(self) {\
2512  __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
2513  (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
2514  }
2515 #endif
2516 #if CYTHON_FAST_THREAD_STATE
2517 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2518  __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
2519 #else
2520 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
2521  __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
2522 #endif
2523 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
2524 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
2525 
2526 /* PatchModuleWithCoroutine.proto */
2527 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
2528 
2529 /* PatchGeneratorABC.proto */
2530 static int __Pyx_patch_abc(void);
2531 
2532 /* Generator.proto */
2533 #define __Pyx_Generator_USED
2534 static PyTypeObject *__pyx_GeneratorType = 0;
2535 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
2536 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
2537  __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
2538 static PyObject *__Pyx_Generator_Next(PyObject *self);
2539 static int __pyx_Generator_init(void);
2540 
2541 /* CheckBinaryVersion.proto */
2542 static int __Pyx_check_binary_version(void);
2543 
2544 /* InitStrings.proto */
2545 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2546 
2547 static double __pyx_f_9WaveTools_18MonochromaticWaves_etaLinear(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2548 static double __pyx_f_9WaveTools_18MonochromaticWaves_etaFenton(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2549 static void __pyx_f_9WaveTools_18MonochromaticWaves_uLinear(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2550 static void __pyx_f_9WaveTools_18MonochromaticWaves_uFenton(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2551 static double __pyx_f_9WaveTools_7NewWave__cpp_eta(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2552 static void __pyx_f_9WaveTools_7NewWave__cpp_u(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2553 static double __pyx_f_9WaveTools_11RandomWaves__cpp_eta(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2554 static void __pyx_f_9WaveTools_11RandomWaves__cpp_u(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2555 static double __pyx_f_9WaveTools_23MultiSpectraRandomWaves__cpp_eta(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2556 static void __pyx_f_9WaveTools_23MultiSpectraRandomWaves__cpp_u(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2557 static double __pyx_f_9WaveTools_16DirectionalWaves__cpp_eta(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2558 static void __pyx_f_9WaveTools_16DirectionalWaves__cpp_u(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2559 static double __pyx_f_9WaveTools_10TimeSeries__cpp_etaDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2560 static void __pyx_f_9WaveTools_10TimeSeries__cpp_uDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2561 static double __pyx_f_9WaveTools_10TimeSeries__cpp_etaWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2562 static void __pyx_f_9WaveTools_10TimeSeries__cpp_uWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2563 static double __pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_2ndOrder(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2564 static double __pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_short(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2565 static double __pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_long(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t); /* proto*/
2566 
2567 /* Module declarations from 'cython' */
2568 
2569 /* Module declarations from 'libc.math' */
2570 
2571 /* Module declarations from 'cpython.buffer' */
2572 
2573 /* Module declarations from 'libc.string' */
2574 
2575 /* Module declarations from 'libc.stdio' */
2576 
2577 /* Module declarations from '__builtin__' */
2578 
2579 /* Module declarations from 'cpython.type' */
2580 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2581 
2582 /* Module declarations from 'cpython' */
2583 
2584 /* Module declarations from 'cpython.object' */
2585 
2586 /* Module declarations from 'cpython.ref' */
2587 
2588 /* Module declarations from 'cpython.mem' */
2589 
2590 /* Module declarations from 'numpy' */
2591 
2592 /* Module declarations from 'numpy' */
2593 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2594 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2595 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2596 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2597 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2598 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2599 
2600 /* Module declarations from 'libcpp' */
2601 
2602 /* Module declarations from 'WaveTools' */
2603 static PyTypeObject *__pyx_ptype_9WaveTools_SteadyCurrent = 0;
2604 static PyTypeObject *__pyx_ptype_9WaveTools_SolitaryWave = 0;
2605 static PyTypeObject *__pyx_ptype_9WaveTools_MonochromaticWaves = 0;
2606 static PyTypeObject *__pyx_ptype_9WaveTools_NewWave = 0;
2607 static PyTypeObject *__pyx_ptype_9WaveTools_RandomWaves = 0;
2608 static PyTypeObject *__pyx_ptype_9WaveTools_MultiSpectraRandomWaves = 0;
2609 static PyTypeObject *__pyx_ptype_9WaveTools_DirectionalWaves = 0;
2610 static PyTypeObject *__pyx_ptype_9WaveTools_TimeSeries = 0;
2611 static PyTypeObject *__pyx_ptype_9WaveTools_RandomNLWaves = 0;
2612 static PyTypeObject *__pyx_ptype_9WaveTools___pyx_scope_struct____cinit__ = 0;
2613 static PyTypeObject *__pyx_ptype_9WaveTools___pyx_scope_struct_1_genexpr = 0;
2614 static PyObject *__pyx_f_9WaveTools___pyx_unpickle_SteadyCurrent__set_state(struct __pyx_obj_9WaveTools_SteadyCurrent *, PyObject *); /*proto*/
2615 static PyObject *__pyx_f_9WaveTools___pyx_unpickle_SolitaryWave__set_state(struct __pyx_obj_9WaveTools_SolitaryWave *, PyObject *); /*proto*/
2616 static CYTHON_INLINE PyObject *__Pyx_carray_to_py_double(double *, Py_ssize_t); /*proto*/
2617 static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_double(double *, Py_ssize_t); /*proto*/
2618 #define __Pyx_MODULE_NAME "WaveTools"
2619 extern int __pyx_module_is_main_WaveTools;
2620 int __pyx_module_is_main_WaveTools = 0;
2621 
2622 /* Implementation of 'WaveTools' */
2623 static PyObject *__pyx_builtin_object;
2624 static PyObject *__pyx_builtin_sum;
2625 static PyObject *__pyx_builtin_TypeError;
2626 static PyObject *__pyx_builtin_max;
2627 static PyObject *__pyx_builtin_open;
2628 static PyObject *__pyx_builtin_round;
2629 static PyObject *__pyx_builtin_print;
2630 static PyObject *__pyx_builtin_ValueError;
2631 static PyObject *__pyx_builtin_range;
2632 static PyObject *__pyx_builtin_RuntimeError;
2633 static PyObject *__pyx_builtin_ImportError;
2634 static const char __pyx_k_K[] = "K";
2635 static const char __pyx_k_M[] = "M";
2636 static const char __pyx_k_N[] = "N";
2637 static const char __pyx_k_U[] = "U";
2638 static const char __pyx_k_V[] = "V";
2639 static const char __pyx_k_Z[] = "Z";
2640 static const char __pyx_k_a[] = "a";
2641 static const char __pyx_k_c[] = "c";
2642 static const char __pyx_k_d[] = "d";
2643 static const char __pyx_k_f[] = "f";
2644 static const char __pyx_k_g[] = "g";
2645 static const char __pyx_k_i[] = "i";
2646 static const char __pyx_k_j[] = "j";
2647 static const char __pyx_k_k[] = "k";
2648 static const char __pyx_k_l[] = "l";
2649 static const char __pyx_k_r[] = "r";
2650 static const char __pyx_k_s[] = "s";
2651 static const char __pyx_k_t[] = "t";
2652 static const char __pyx_k_u[] = "u";
2653 static const char __pyx_k_w[] = "w";
2654 static const char __pyx_k_x[] = "x";
2655 static const char __pyx_k_y[] = "y";
2656 static const char __pyx_k_G0[] = "G0";
2657 static const char __pyx_k_Hs[] = "Hs";
2658 static const char __pyx_k_Nf[] = "Nf";
2659 static const char __pyx_k_Np[] = "Np";
2660 static const char __pyx_k_RW[] = "RW";
2661 static const char __pyx_k_TS[] = "TS";
2662 static const char __pyx_k_Tm[] = "Tm";
2663 static const char __pyx_k_Tp[] = "Tp";
2664 static const char __pyx_k_UH[] = "UH";
2665 static const char __pyx_k_UV[] = "UV";
2666 static const char __pyx_k_a1[] = "a1";
2667 static const char __pyx_k_a2[] = "a2";
2668 static const char __pyx_k_aR[] = "aR";
2669 static const char __pyx_k_aa[] = "aa";
2670 static const char __pyx_k_ai[] = "ai";
2671 static const char __pyx_k_bj[] = "bj";
2672 static const char __pyx_k_df[] = "df";
2673 static const char __pyx_k_dt[] = "dt";
2674 static const char __pyx_k_f0[] = "f0";
2675 static const char __pyx_k_fi[] = "fi";
2676 static const char __pyx_k_ho[] = "ho";
2677 static const char __pyx_k_i1[] = "i1";
2678 static const char __pyx_k_i2[] = "i2";
2679 static const char __pyx_k_ii[] = "ii";
2680 static const char __pyx_k_jj[] = "jj";
2681 static const char __pyx_k_np[] = "np";
2682 static const char __pyx_k_pi[] = "pi";
2683 static const char __pyx_k_pp[] = "pp";
2684 static const char __pyx_k_te[] = "te";
2685 static const char __pyx_k_ts[] = "ts";
2686 static const char __pyx_k_tt[] = "tt";
2687 static const char __pyx_k_uR[] = "uR";
2688 static const char __pyx_k_v1[] = "v1";
2689 static const char __pyx_k_v2[] = "v2";
2690 static const char __pyx_k_ww[] = "ww";
2691 static const char __pyx_k_x0[] = "x0";
2692 static const char __pyx_k_xx[] = "xx";
2693 static const char __pyx_k_Er1[] = "Er1 =";
2694 static const char __pyx_k_TMA[] = "TMA";
2695 static const char __pyx_k__43[] = ",";
2696 static const char __pyx_k__52[] = " ";
2697 static const char __pyx_k_aRN[] = "aRN";
2698 static const char __pyx_k_all[] = "all";
2699 static const char __pyx_k_amp[] = "amp";
2700 static const char __pyx_k_cos[] = "cos";
2701 static const char __pyx_k_csv[] = ".csv";
2702 static const char __pyx_k_cut[] = "cut";
2703 static const char __pyx_k_doc[] = "__doc__";
2704 static const char __pyx_k_dom[] = "dom";
2705 static const char __pyx_k_er1[] = "er1";
2706 static const char __pyx_k_eta[] = "eta";
2707 static const char __pyx_k_exp[] = "exp";
2708 static const char __pyx_k_fft[] = "fft";
2709 static const char __pyx_k_fun[] = "fun";
2710 static const char __pyx_k_get[] = "get";
2711 static const char __pyx_k_log[] = "log";
2712 static const char __pyx_k_max[] = "max";
2713 static const char __pyx_k_mwl[] = "mwl";
2714 static const char __pyx_k_new[] = "__new__";
2715 static const char __pyx_k_phi[] = "phi";
2716 static const char __pyx_k_str[] = "str";
2717 static const char __pyx_k_sum[] = "sum";
2718 static const char __pyx_k_sys[] = "sys";
2719 static const char __pyx_k_tma[] = "tma";
2720 static const char __pyx_k_txt[] = ".txt";
2721 static const char __pyx_k_zip[] = "zip";
2722 static const char __pyx_k_Comm[] = "Comm";
2723 static const char __pyx_k_Hs_2[] = "_Hs_";
2724 static const char __pyx_k_Lgen[] = "Lgen";
2725 static const char __pyx_k_Nmax[] = "Nmax";
2726 static const char __pyx_k_Tend[] = "Tend";
2727 static const char __pyx_k_Tlag[] = "Tlag";
2728 static const char __pyx_k_Tmax[] = "Tmax";
2729 static const char __pyx_k_Tp_2[] = "_Tp_";
2730 static const char __pyx_k_args[] = "args";
2731 static const char __pyx_k_cmat[] = "cmat";
2732 static const char __pyx_k_cond[] = "cond";
2733 static const char __pyx_k_cppU[] = "cppU";
2734 static const char __pyx_k_dict[] = "__dict__";
2735 static const char __pyx_k_etaR[] = "etaR";
2736 static const char __pyx_k_exit[] = "exit";
2737 static const char __pyx_k_fast[] = "fast";
2738 static const char __pyx_k_freq[] = "freq";
2739 static const char __pyx_k_func[] = "func";
2740 static const char __pyx_k_gAbs[] = "gAbs";
2741 static const char __pyx_k_iend[] = "iend";
2742 static const char __pyx_k_init[] = "__init__";
2743 static const char __pyx_k_kAbs[] = "kAbs";
2744 static const char __pyx_k_kDir[] = "kDir";
2745 static const char __pyx_k_long[] = "long";
2746 static const char __pyx_k_main[] = "__main__";
2747 static const char __pyx_k_mean[] = "mean";
2748 static const char __pyx_k_mode[] = "mode";
2749 static const char __pyx_k_name[] = "__name__";
2750 static const char __pyx_k_nfft[] = "nfft";
2751 static const char __pyx_k_norm[] = "norm";
2752 static const char __pyx_k_ones[] = "ones";
2753 static const char __pyx_k_open[] = "open";
2754 static const char __pyx_k_phi0[] = "phi0";
2755 static const char __pyx_k_rand[] = "rand";
2756 static const char __pyx_k_real[] = "real";
2757 static const char __pyx_k_self[] = "self";
2758 static const char __pyx_k_send[] = "send";
2759 static const char __pyx_k_sinh[] = "sinh";
2760 static const char __pyx_k_smax[] = "smax";
2761 static const char __pyx_k_sqrt[] = "sqrt";
2762 static const char __pyx_k_tanh[] = "tanh";
2763 static const char __pyx_k_test[] = "__test__";
2764 static const char __pyx_k_time[] = "time";
2765 static const char __pyx_k_vDir[] = "vDir";
2766 static const char __pyx_k_wind[] = "wind";
2767 static const char __pyx_k_Nfreq[] = "Nfreq";
2768 static const char __pyx_k_Nwind[] = "Nwind";
2769 static const char __pyx_k_Uhorz[] = "Uhorz";
2770 static const char __pyx_k_Uvert[] = "Uvert";
2771 static const char __pyx_k_all_2[] = "__all__";
2772 static const char __pyx_k_array[] = "array";
2773 static const char __pyx_k_close[] = "close";
2774 static const char __pyx_k_cmath[] = "cmath";
2775 static const char __pyx_k_cos2s[] = "cos2s";
2776 static const char __pyx_k_depth[] = "depth";
2777 static const char __pyx_k_fft_x[] = "fft_x";
2778 static const char __pyx_k_fname[] = "fname";
2779 static const char __pyx_k_gamma[] = "gamma";
2780 static const char __pyx_k_level[] = "level";
2781 static const char __pyx_k_modes[] = "modes";
2782 static const char __pyx_k_niter[] = "niter";
2783 static const char __pyx_k_numpy[] = "numpy";
2784 static const char __pyx_k_omega[] = "omega";
2785 static const char __pyx_k_overl[] = "overl";
2786 static const char __pyx_k_phase[] = "phase";
2787 static const char __pyx_k_print[] = "print";
2788 static const char __pyx_k_range[] = "range";
2789 static const char __pyx_k_rec_d[] = "rec_d";
2790 static const char __pyx_k_round[] = "round";
2791 static const char __pyx_k_setUp[] = "setUp";
2792 static const char __pyx_k_setup[] = "setup";
2793 static const char __pyx_k_shape[] = "shape";
2794 static const char __pyx_k_short[] = "short";
2795 static const char __pyx_k_sigma[] = "sigma";
2796 static const char __pyx_k_sinus[] = "sinus";
2797 static const char __pyx_k_state[] = "state";
2798 static const char __pyx_k_theta[] = "theta";
2799 static const char __pyx_k_throw[] = "throw";
2800 static const char __pyx_k_trans[] = "trans";
2801 static const char __pyx_k_w_aux[] = "w_aux";
2802 static const char __pyx_k_where[] = "where";
2803 static const char __pyx_k_zeros[] = "zeros";
2804 static const char __pyx_k_Bcoeff[] = "Bcoeff";
2805 static const char __pyx_k_Cutoff[] = "Cutoff";
2806 static const char __pyx_k_Fenton[] = "Fenton";
2807 static const char __pyx_k_Linear[] = "Linear";
2808 static const char __pyx_k_NLongW[] = "NLongW";
2809 static const char __pyx_k_Nwaves[] = "Nwaves";
2810 static const char __pyx_k_PM_mod[] = "PM_mod";
2811 static const char __pyx_k_Period[] = "Period";
2812 static const char __pyx_k_Tstart[] = "Tstart";
2813 static const char __pyx_k_Udrift[] = "Udrift";
2814 static const char __pyx_k_Window[] = "Window";
2815 static const char __pyx_k_Ycoeff[] = "Ycoeff";
2816 static const char __pyx_k_append[] = "append";
2817 static const char __pyx_k_costap[] = "costap";
2818 static const char __pyx_k_cutoff[] = "cutoff";
2819 static const char __pyx_k_dict_2[] = "_dict";
2820 static const char __pyx_k_errors[] = "errors";
2821 static const char __pyx_k_import[] = "__import__";
2822 static const char __pyx_k_interp[] = "interp";
2823 static const char __pyx_k_linalg[] = "linalg";
2824 static const char __pyx_k_linear[] = "linear";
2825 static const char __pyx_k_module[] = "__module__";
2826 static const char __pyx_k_object[] = "object";
2827 static const char __pyx_k_omega0[] = "omega0";
2828 static const char __pyx_k_period[] = "period";
2829 static const char __pyx_k_pickle[] = "pickle";
2830 static const char __pyx_k_random[] = "random";
2831 static const char __pyx_k_reduce[] = "__reduce__";
2832 static const char __pyx_k_series[] = "series";
2833 static const char __pyx_k_tfocus[] = "tfocus";
2834 static const char __pyx_k_tolist[] = "tolist";
2835 static const char __pyx_k_tophat[] = "tophat";
2836 static const char __pyx_k_uCheck[] = "uCheck";
2837 static const char __pyx_k_update[] = "update";
2838 static const char __pyx_k_vector[] = "vector";
2839 static const char __pyx_k_xfocus[] = "xfocus";
2840 static const char __pyx_k_JONSWAP[] = "JONSWAP";
2841 static const char __pyx_k_NewWave[] = "NewWave";
2842 static const char __pyx_k_Nseries[] = "Nseries";
2843 static const char __pyx_k_Overlap[] = "Overlap";
2844 static const char __pyx_k_TWindow[] = "TWindow";
2845 static const char __pyx_k_barrier[] = "barrier";
2846 static const char __pyx_k_depth_2[] = "_depth_";
2847 static const char __pyx_k_fftfreq[] = "fftfreq";
2848 static const char __pyx_k_fim_tmp[] = "fim_tmp";
2849 static const char __pyx_k_genexpr[] = "genexpr";
2850 static const char __pyx_k_loadtxt[] = "loadtxt";
2851 static const char __pyx_k_logFile[] = "logFile";
2852 static const char __pyx_k_ncoeffs[] = "ncoeffs";
2853 static const char __pyx_k_npoints[] = "npoints";
2854 static const char __pyx_k_old_div[] = "old_div";
2855 static const char __pyx_k_periods[] = "periods";
2856 static const char __pyx_k_phiSymm[] = "phiSymm";
2857 static const char __pyx_k_prepare[] = "__prepare__";
2858 static const char __pyx_k_proteus[] = "proteus";
2859 static const char __pyx_k_results[] = "results";
2860 static const char __pyx_k_savetxt[] = "savetxt";
2861 static const char __pyx_k_timelst[] = "timelst";
2862 static const char __pyx_k_uDirect[] = "uDirect";
2863 static const char __pyx_k_uWindow[] = "uWindow";
2864 static const char __pyx_k_waveDir[] = "waveDir";
2865 static const char __pyx_k_windOut[] = "windOut";
2866 static const char __pyx_k_windows[] = "windows";
2867 static const char __pyx_k_wtError[] = "wtError";
2868 static const char __pyx_k_Cutoff_2[] = "Cutoff=";
2869 static const char __pyx_k_End_time[] = "End time= ";
2870 static const char __pyx_k_EtasetUp[] = "EtasetUp";
2871 static const char __pyx_k_Nspectra[] = "Nspectra";
2872 static const char __pyx_k_TOverlap[] = "TOverlap";
2873 static const char __pyx_k_builtins[] = "builtins";
2874 static const char __pyx_k_checkAcc[] = "checkAcc";
2875 static const char __pyx_k_dirCheck[] = "dirCheck";
2876 static const char __pyx_k_dircheck[] = "dircheck";
2877 static const char __pyx_k_duration[] = "duration";
2878 static const char __pyx_k_etaCheck[] = "etaCheck";
2879 static const char __pyx_k_eta_long[] = "eta_long";
2880 static const char __pyx_k_eta_mode[] = "eta_mode";
2881 static const char __pyx_k_funcName[] = "funcName";
2882 static const char __pyx_k_func_ret[] = "func_ret";
2883 static const char __pyx_k_getstate[] = "__getstate__";
2884 static const char __pyx_k_isMaster[] = "isMaster";
2885 static const char __pyx_k_linspace[] = "linspace";
2886 static const char __pyx_k_logEvent[] = "logEvent";
2887 static const char __pyx_k_printOut[] = "printOut";
2888 static const char __pyx_k_pyx_type[] = "__pyx_type";
2889 static const char __pyx_k_qualname[] = "__qualname__";
2890 static const char __pyx_k_rampTime[] = "rampTime";
2891 static const char __pyx_k_setstate[] = "__setstate__";
2892 static const char __pyx_k_skiprows[] = "skiprows";
2893 static const char __pyx_k_vel_mode[] = "vel_mode";
2894 static const char __pyx_k_waveDir0[] = "waveDir0";
2895 static const char __pyx_k_waveList[] = "waveList";
2896 static const char __pyx_k_waveType[] = "waveType";
2897 static const char __pyx_k_NewWave_u[] = "NewWave.u";
2898 static const char __pyx_k_Profiling[] = "Profiling";
2899 static const char __pyx_k_TypeError[] = "TypeError";
2900 static const char __pyx_k_WaveTools[] = "WaveTools";
2901 static const char __pyx_k_amplitude[] = "amplitude";
2902 static const char __pyx_k_arrayData[] = "arrayData";
2903 static const char __pyx_k_condition[] = "condition";
2904 static const char __pyx_k_conv_crit[] = "conv_crit";
2905 static const char __pyx_k_copyFiles[] = "copyFiles";
2906 static const char __pyx_k_delimiter[] = "delimiter";
2907 static const char __pyx_k_etaDirect[] = "etaDirect";
2908 static const char __pyx_k_etaWindow[] = "etaWindow";
2909 static const char __pyx_k_eta_setUp[] = "eta_setUp";
2910 static const char __pyx_k_eta_short[] = "eta_short";
2911 static const char __pyx_k_funcNames[] = "funcNames";
2912 static const char __pyx_k_metaclass[] = "__metaclass__";
2913 static const char __pyx_k_mitsuyasu[] = "mitsuyasu";
2914 static const char __pyx_k_pyx_state[] = "__pyx_state";
2915 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2916 static const char __pyx_k_spectName[] = "spectName";
2917 static const char __pyx_k_wwi_setUp[] = "wwi_setUp";
2918 static const char __pyx_k_Etaoverall[] = "Etaoverall";
2919 static const char __pyx_k_Nwaves_tot[] = "Nwaves_tot";
2920 static const char __pyx_k_Start_Time[] = "Start Time =";
2921 static const char __pyx_k_TimeSeries[] = "TimeSeries";
2922 static const char __pyx_k_ValueError[] = "ValueError";
2923 static const char __pyx_k_autoFenton[] = "autoFenton";
2924 static const char __pyx_k_bandFactor[] = "bandFactor";
2925 static const char __pyx_k_crestFocus[] = "crestFocus";
2926 static const char __pyx_k_cutoff_win[] = "cutoff_win";
2927 static const char __pyx_k_dispersion[] = "dispersion";
2928 static const char __pyx_k_findWindow[] = "findWindow";
2929 static const char __pyx_k_past_utils[] = "past.utils";
2930 static const char __pyx_k_pyx_result[] = "__pyx_result";
2931 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2932 static const char __pyx_k_rec_direct[] = "rec_direct";
2933 static const char __pyx_k_rotation3D[] = "rotation3D";
2934 static const char __pyx_k_runFourier[] = "runFourier";
2935 static const char __pyx_k_setVertDir[] = "setVertDir";
2936 static const char __pyx_k_spreadName[] = "spreadName";
2937 static const char __pyx_k_waveHeight[] = "waveHeight";
2938 static const char __pyx_k_waveheight[] = "waveheight";
2939 static const char __pyx_k_wavelength[] = "wavelength";
2940 static const char __pyx_k_writeInput[] = "writeInput";
2941 static const char __pyx_k_ImportError[] = "ImportError";
2942 static const char __pyx_k_NewWave_eta[] = "NewWave.eta";
2943 static const char __pyx_k_PickleError[] = "PickleError";
2944 static const char __pyx_k_RandomWaves[] = "RandomWaves";
2945 static const char __pyx_k_Tstart_temp[] = "Tstart_temp";
2946 static const char __pyx_k_cutoffTotal[] = "cutoffTotal";
2947 static const char __pyx_k_eta_overall[] = "eta_overall";
2948 static const char __pyx_k_getBYCoeffs[] = "getBYCoeffs";
2949 static const char __pyx_k_seriesArray[] = "seriesArray";
2950 static const char __pyx_k_sigmaReturn[] = "sigmaReturn";
2951 static const char __pyx_k_CombineWaves[] = "CombineWaves";
2952 static const char __pyx_k_RandomSeries[] = "RandomSeries";
2953 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2954 static const char __pyx_k_SolitaryWave[] = "SolitaryWave";
2955 static const char __pyx_k_SpatialTools[] = "SpatialTools";
2956 static const char __pyx_k_coshkzd_test[] = "coshkzd_test";
2957 static const char __pyx_k_eta_2ndOrder[] = "eta_2ndOrder";
2958 static const char __pyx_k_fastcos_test[] = "fastcos_test";
2959 static const char __pyx_k_height_steps[] = "height_steps";
2960 static const char __pyx_k_meanVelocity[] = "meanVelocity";
2961 static const char __pyx_k_normIntegral[] = "normIntegral";
2962 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2963 static const char __pyx_k_setDirVector[] = "setDirVector";
2964 static const char __pyx_k_sinhkzd_test[] = "sinhkzd_test";
2965 static const char __pyx_k_stringsource[] = "stringsource";
2966 static const char __pyx_k_use_setstate[] = "use_setstate";
2967 static const char __pyx_k_RandomNLWaves[] = "RandomNLWaves";
2968 static const char __pyx_k_RandomWaves_u[] = "RandomWaves.u";
2969 static const char __pyx_k_SteadyCurrent[] = "SteadyCurrent";
2970 static const char __pyx_k_fastcosh_test[] = "fastcosh_test";
2971 static const char __pyx_k_fastsinh_test[] = "fastsinh_test";
2972 static const char __pyx_k_getWavelength[] = "getWavelength";
2973 static const char __pyx_k_randomNLWaves[] = "randomNLWaves_";
2974 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2975 static const char __pyx_k_spread_params[] = "spread_params";
2976 static const char __pyx_k_window_params[] = "window_params";
2977 static const char __pyx_k_CombineWaves_u[] = "CombineWaves.u";
2978 static const char __pyx_k_SolitaryWave_u[] = "SolitaryWave.u";
2979 static const char __pyx_k_autoFentonOpts[] = "autoFentonOpts";
2980 static const char __pyx_k_proteus_fenton[] = "proteus.fenton";
2981 static const char __pyx_k_timeSeriesFile[] = "timeSeriesFile";
2982 static const char __pyx_k_validFunctions[] = "validFunctions";
2983 static const char __pyx_k_writeEtaSeries[] = "writeEtaSeries";
2984 static const char __pyx_k_RandomWavesFast[] = "RandomWavesFast";
2985 static const char __pyx_k_RandomWaves_eta[] = "RandomWaves.eta";
2986 static const char __pyx_k_SteadyCurrent_u[] = "SteadyCurrent.u";
2987 static const char __pyx_k_points_velocity[] = "points_velocity";
2988 static const char __pyx_k_points_vertical[] = "points_vertical";
2989 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2990 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2991 static const char __pyx_k_spectral_params[] = "spectral_params";
2992 static const char __pyx_k_CombineWaves_eta[] = "CombineWaves.eta";
2993 static const char __pyx_k_DirectionalWaves[] = "DirectionalWaves";
2994 static const char __pyx_k_SolitaryWave_eta[] = "SolitaryWave.eta";
2995 static const char __pyx_k_returnRectangles[] = "returnRectangles";
2996 static const char __pyx_k_Number_of_windows[] = "Number of windows=";
2997 static const char __pyx_k_RandomNLWavesFast[] = "RandomNLWavesFast";
2998 static const char __pyx_k_SteadyCurrent_eta[] = "SteadyCurrent.eta";
2999 static const char __pyx_k_current_criterion[] = "current_criterion";
3000 static const char __pyx_k_current_magnitude[] = "current_magnitude";
3001 static const char __pyx_k_decompose_tseries[] = "decompose_tseries";
3002 static const char __pyx_k_reduceToIntervals[] = "reduceToIntervals";
3003 static const char __pyx_k_DirectionalWaves_u[] = "DirectionalWaves.u";
3004 static const char __pyx_k_MonochromaticWaves[] = "MonochromaticWaves";
3005 static const char __pyx_k_TimeSeries_uDirect[] = "TimeSeries.uDirect";
3006 static const char __pyx_k_TimeSeries_uWindow[] = "TimeSeries.uWindow";
3007 static const char __pyx_k_TimeSeries_windOut[] = "TimeSeries.windOut";
3008 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3009 static const char __pyx_k_points_freesurface[] = "points_freesurface";
3010 static const char __pyx_k_returnRectangles3D[] = "returnRectangles3D";
3011 static const char __pyx_k_timeSeriesPosition[] = "timeSeriesPosition";
3012 static const char __pyx_k_CombineWaves___init[] = "CombineWaves.__init__";
3013 static const char __pyx_k_RandomNLWavesFast_u[] = "RandomNLWavesFast.u";
3014 static const char __pyx_k_DirectionalWaves_eta[] = "DirectionalWaves.eta";
3015 static const char __pyx_k_MonochromaticWaves_u[] = "MonochromaticWaves.u";
3016 static const char __pyx_k_TimeSeries_etaDirect[] = "TimeSeries.etaDirect";
3017 static const char __pyx_k_TimeSeries_etaWindow[] = "TimeSeries.etaWindow";
3018 static const char __pyx_k_loadExistingFunction[] = "loadExistingFunction";
3019 static const char __pyx_k_proteus_WaveTools_py[] = "proteus/WaveTools.py";
3020 static const char __pyx_k_Direct_reconstruction[] = "Direct reconstruction? ";
3021 static const char __pyx_k_RandomNLWavesFast_eta[] = "RandomNLWavesFast.eta";
3022 static const char __pyx_k_RandomNLWaves_wtError[] = "RandomNLWaves.wtError";
3023 static const char __pyx_k_TimeSeries_findWindow[] = "TimeSeries.findWindow";
3024 static const char __pyx_k_MonochromaticWaves_eta[] = "MonochromaticWaves.eta";
3025 static const char __pyx_k_NewWave_writeEtaSeries[] = "NewWave.writeEtaSeries";
3026 static const char __pyx_k_RandomNLWaves_eta_long[] = "RandomNLWaves.eta_long";
3027 static const char __pyx_k_RandomWavesFast___init[] = "RandomWavesFast.__init__";
3028 static const char __pyx_k_cinit___locals_genexpr[] = "__cinit__.<locals>.genexpr";
3029 static const char __pyx_k_MultiSpectraRandomWaves[] = "MultiSpectraRandomWaves";
3030 static const char __pyx_k_NewWave___reduce_cython[] = "NewWave.__reduce_cython__";
3031 static const char __pyx_k_RandomNLWaves_eta_setUp[] = "RandomNLWaves.eta_setUp";
3032 static const char __pyx_k_RandomNLWaves_eta_short[] = "RandomNLWaves.eta_short";
3033 static const char __pyx_k_RandomNLWavesFast___init[] = "RandomNLWavesFast.__init__";
3034 static const char __pyx_k_RandomWavesFast_printOut[] = "RandomWavesFast.printOut";
3035 static const char __pyx_k_MultiSpectraRandomWaves_u[] = "MultiSpectraRandomWaves.u";
3036 static const char __pyx_k_NewWave___setstate_cython[] = "NewWave.__setstate_cython__";
3037 static const char __pyx_k_RandomNLWaves_eta_overall[] = "RandomNLWaves.eta_overall";
3038 static const char __pyx_k_pyx_unpickle_SolitaryWave[] = "__pyx_unpickle_SolitaryWave";
3039 static const char __pyx_k_RandomNLWaves_eta_2ndOrder[] = "RandomNLWaves.eta_2ndOrder";
3040 static const char __pyx_k_RandomWaves_writeEtaSeries[] = "RandomWaves.writeEtaSeries";
3041 static const char __pyx_k_TimeSeries___reduce_cython[] = "TimeSeries.__reduce_cython__";
3042 static const char __pyx_k_pyx_unpickle_SteadyCurrent[] = "__pyx_unpickle_SteadyCurrent";
3043 static const char __pyx_k_MultiSpectraRandomWaves_eta[] = "MultiSpectraRandomWaves.eta";
3044 static const char __pyx_k_RandomWaves___reduce_cython[] = "RandomWaves.__reduce_cython__";
3045 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
3046 static const char __pyx_k_waves_This_may_take_a_while[] = " waves. This may take a while";
3047 static const char __pyx_k_RandomNLWaves_writeEtaSeries[] = "RandomNLWaves.writeEtaSeries";
3048 static const char __pyx_k_SolitaryWave___reduce_cython[] = "SolitaryWave.__reduce_cython__";
3049 static const char __pyx_k_TimeSeries___setstate_cython[] = "TimeSeries.__setstate_cython__";
3050 static const char __pyx_k_RandomNLWaves___reduce_cython[] = "RandomNLWaves.__reduce_cython__";
3051 static const char __pyx_k_RandomWaves___setstate_cython[] = "RandomWaves.__setstate_cython__";
3052 static const char __pyx_k_SteadyCurrent___reduce_cython[] = "SteadyCurrent.__reduce_cython__";
3053 static const char __pyx_k_SolitaryWave___setstate_cython[] = "SolitaryWave.__setstate_cython__";
3054 static const char __pyx_k_self_Bcoeff__self_Ycoeff__self[] = "self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling";
3055 static const char __pyx_k_ERROR_Wavetools_py_meanVelocity[] = "ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ";
3056 static const char __pyx_k_ERROR_Wavetools_py_phi_argument[] = "ERROR! Wavetools.py: phi argument must be an array with N elements";
3057 static const char __pyx_k_INFO_WaveTools_py_Overlap_entry[] = "INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)";
3058 static const char __pyx_k_RandomNLWaves___setstate_cython[] = "RandomNLWaves.__setstate_cython__";
3059 static const char __pyx_k_SteadyCurrent___setstate_cython[] = "SteadyCurrent.__setstate_cython__";
3060 static const char __pyx_k_This_class_is_used_for_combinin[] = "\n This class is used for combining multiple waveTools classes, thus allowing for the generation of complex wave conditions\n\n Parameters\n ----------\n waveList : list\n List of wave classes\n ";
3061 static const char __pyx_k_This_class_is_used_for_generati[] = "\n This class is used for generating plane random waves in an optimised manner\n using linear reconstruction of components from a wave spectrum\n\n Parameters\n ----------\n Tstart : float\n Start time \n Tend : float\n End time \n x0 : numpy.ndarray\n Position vector for the time series \n Tp : float\n Peak wave period\n Hs : float\n Significant wave height\n mwl : float\n Still water level\n depth : float\n Water depth\n waveDir : numpy.ndarray\n Wave direction vector\n g : Numpy array\n Gravitational acceleration vector\n N : int\n Number of frequency components\n bandFactor : float\n Spectral band factor. fmax = bandFactor/Tp, fmin = 1/(bandFactor*Tp) \n spectName : string\n Name of spectral distribution\n spectral_params : dict\n Dictionary of arguments specific to the spectral distribution\n Example for JONSWAP = {\"gamma\": 3.3, \"TMA\":True,\"depth\": depth}\n TMA=True activates the TMA modification, which in turn needs the depth as a parameter\n phi : numpy.ndarray\n Component phases (if set to None, phases are picked at random)\n Lgen : numpy.ndarray\n Length of the generation zone (np.array([0., 0., 0.]) by default\n Nwaves : int\n Number of waves per window\n Nfreq : int\n Number of Fourier components per window\n checkAcc : bool\n Switch for enabling accuracy checks\n fast : bool\n Switch for enabling optimised functions \n \n\n ";
3062 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
3063 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
3064 static const char __pyx_k_DirectionalWaves___reduce_cython[] = "DirectionalWaves.__reduce_cython__";
3065 static const char __pyx_k_DirectionalWaves___setstate_cyth[] = "DirectionalWaves.__setstate_cython__";
3066 static const char __pyx_k_ERROR_Each_input_list_entry_shou[] = "ERROR!: Each input list entry should be a waveTools function with an eta function";
3067 static const char __pyx_k_ERROR_WaveTools_py_Dictionary_ke[] = "ERROR! WaveTools.py: Dictionary key 'Nwaves' (waves per window) not found in window_params dictionary";
3068 static const char __pyx_k_ERROR_WaveTools_py_Found_large_e[] = "ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors";
3069 static const char __pyx_k_ERROR_WaveTools_py_Found_not_con[] = "ERROR! WaveTools.py: Found not consistent time entry between %s and %s row in %s file. Time variable must be always at the first column of the file and increasing monotonically";
3070 static const char __pyx_k_ERROR_WaveTools_py_Found_too_few[] = "ERROR!: WaveTools.py: Found too few windows in RandomWavesFast. Consider increasing Tend (this is independent from the duration of the simulation)";
3071 static const char __pyx_k_ERROR_WaveTools_py_Reconstructio[] = "ERROR! WaveTools.py: Reconstruction is expected to have two windows or more. Plese reduce the number of waves per window or switch to direct decomposition )";
3072 static const char __pyx_k_ERROR_WaveTools_py_Relaxation_zo[] = "ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone";
3073 static const char __pyx_k_ERROR_WaveTools_py_Set_parameter[] = "ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary";
3074 static const char __pyx_k_ERROR_Wavetools_py_Additional_sp[] = "ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum";
3075 static const char __pyx_k_ERROR_Wavetools_py_File_s_must_b[] = "ERROR! Wavetools.py: File %s must be given in .txt or .csv format";
3076 static const char __pyx_k_ERROR_Wavetools_py_Location_vect[] = "ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction";
3077 static const char __pyx_k_ERROR_Wavetools_py_Maximum_numbe[] = "ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ";
3078 static const char __pyx_k_ERROR_Wavetools_py_Parameters_pa[] = "ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ";
3079 static const char __pyx_k_ERROR_Wavetools_py_Phase_array_m[] = "ERROR! Wavetools.py: Phase array must have N elements";
3080 static const char __pyx_k_ERROR_Wavetools_py_SteadyCurrent[] = "ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3";
3081 static const char __pyx_k_ERROR_Wavetools_py_Timeseries_fi[] = "ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]";
3082 static const char __pyx_k_ERROR_Wavetools_py_Wavelenght_is[] = "ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments";
3083 static const char __pyx_k_ERROR_Wavetools_py_Window_handov[] = "ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap";
3084 static const char __pyx_k_ERROR_Wavetools_py_Wrong_functio[] = "ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s";
3085 static const char __pyx_k_ERROR_Wavetools_py_Ycoeff_and_Bc[] = "ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero";
3086 static const char __pyx_k_ERROR_Wavetools_py_You_are_not_r[] = "ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ";
3087 static const char __pyx_k_ERROR_Wavetools_py_eta_and_u_fun[] = "ERROR! Wavetools.py: eta and u functions not available for this class. Please use RandomNLWavesFast for generating random waves with nonlinear correction";
3088 static const char __pyx_k_ERROR_Wavetools_py_phi_in_Direct[] = "ERROR! Wavetools.py: phi in DirectionalWaves class must be given either as None or as a list with 2*M + 1 numpy arrays with length N";
3089 static const char __pyx_k_ERROR_Wavetools_pyx_Argument_mod[] = "ERROR! Wavetools.pyx: Argument mode in RandomNLWaves.writeEtaSeries should be \"all\", \"setup\", \"short\", \"long\" or \"linear\"";
3090 static const char __pyx_k_ERROR_Wrong_wavetype_given_Valid[] = "ERROR!!: Wrong wavetype given: Valid wavetypes are %s";
3091 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
3092 static const char __pyx_k_INFO_Calculating_nonlinear_corre[] = "INFO: Calculating nonlinear corrections for ";
3093 static const char __pyx_k_INFO_WaveTools_py_Cutoff_entry_i[] = "INFO WaveTools.py: Cutoff entry in window_params dictionary not found. Setting default value of 0.1 (1/10 of the window length)";
3094 static const char __pyx_k_INFO_WaveTools_py_Not_constant_s[] = "INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate";
3095 static const char __pyx_k_INFO_WaveTools_py_performing_a_d[] = "INFO: WaveTools.py: performing a direct series decomposition";
3096 static const char __pyx_k_INFO_WaveTools_py_performing_ser[] = "INFO WaveTools.py: performing series decomposition with spectral windows";
3097 static const char __pyx_k_INFO_Wavetools_py_Checking_durat[] = "INFO: Wavetools.py: Checking duration of windowed time series: %s per cent difference from original duration";
3098 static const char __pyx_k_INFO_Wavetools_py_Correcting_win[] = "INFO: Wavetools.py: Correcting window duration for matching the exact time range of the series. Window duration correspond to %s waves approx.";
3099 static const char __pyx_k_INFO_Wavetools_py_No_phase_array[] = "INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves";
3100 static const char __pyx_k_INFO_Wavetools_py_Reading_spectr[] = "INFO Wavetools.py: Reading spectra No %s";
3101 static const char __pyx_k_INFO_Wavetools_py_Using_s_window[] = "INFO: Wavetools.py: Using %s windows for reconstruction with %s sec duration and %s per cent overlap";
3102 static const char __pyx_k_Incompatible_checksums_s_vs_0x9a[] = "Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))";
3103 static const char __pyx_k_Incompatible_checksums_s_vs_0xe2[] = "Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))";
3104 static const char __pyx_k_MonochromaticWaves___reduce_cyth[] = "MonochromaticWaves.__reduce_cython__";
3105 static const char __pyx_k_MonochromaticWaves___setstate_cy[] = "MonochromaticWaves.__setstate_cython__";
3106 static const char __pyx_k_MultiSpectraRandomWaves___reduce[] = "MultiSpectraRandomWaves.__reduce_cython__";
3107 static const char __pyx_k_MultiSpectraRandomWaves___setsta[] = "MultiSpectraRandomWaves.__setstate_cython__";
3108 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
3109 static const char __pyx_k_Tools_for_working_with_water_wav[] = "Tools for working with water waves.\n\nThe primary objective of this module is to provide solutions (exact and\napproximate) for the free surface deformation and subsurface velocity\ncomponents of water waves. These can be used as boundary conditions, wave\ngeneration sources, and validation solutions for numerical wave codes.\n";
3110 static const char __pyx_k_Wave_direction_is_not_perpendicu[] = "Wave direction is not perpendicular to gravity vector. Check input";
3111 static const char __pyx_k_Wavetools_py_Provide_valid_depth[] = "Wavetools:py. Provide valid depth definition definition for TMA spectrum";
3112 static const char __pyx_k_Wavetools_py_Stopping_simulation[] = "Wavetools:py. Stopping simulation";
3113 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
3114 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3115 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
3116 static const char __pyx_k_self_T0__self__cpp_eta_self__cpp[] = "self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling";
3117 static const char __pyx_k_self_ai__self_kDir__self_ki__sel[] = "self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling";
3118 static const char __pyx_k_This_class_is_used_for_generati_2[] = "\n This class is used for generating plane random waves with 2ns order correction in an optimised manner\n using linear reconstruction of components from a wave spectrum\n\n Parameters\n ----------\n Tstart : float\n Start time \n Tend : float\n End time \n x0 : numpy.ndarray\n Position vector for the time series \n Tp : float\n Peak wave period \n Hs : float\n Significant wave height \n mwl : float\n Still water level \n depth : float\n Water depth \n waveDir : np.ndarray\n Wave direction vector \n g : Numpy array\n Gravitational acceleration vector \n N : int\n Number of frequency components\n bandFactor : float\n Spectral band factor. fmax = bandFactor/Tp, fmin = 1/(bandFactor*Tp) \n spectName : string\n Name of spectral distribution\n spectral_params : dict\n Dictionary of arguments specific to the spectral distribution\n Example for JONSWAP = {\"gamma\": 3.3, \"TMA\":True,\"depth\": depth}\n TMA=True activates the TMA modification, which in turn needs the depth as a parameter \n phi : numpy.ndarray\n Component phases (if set to None, phases are picked at random)\n \n Lgen : numpy.ndarray\n Length of the generation zone (np.array([0., 0., 0.]) by default\n \n Nwaves : int\n Number of waves per window\n Nfreq : int\n Number of Fourier components per window\n NLongw : int\n Estmated ratio of long wave period to Tp\n fast : bool\n Switch for enabling optimised functions \n ";
3119 static const char __pyx_k_ERROR_Each_input_list_entry_shou_2[] = "ERROR!: Each input list entry should be a waveTools function with a u function";
3120 static const char __pyx_k_ERROR_WaveTools_py_Dictionary_ke_2[] = "ERROR! WaveTools.py: Dictionary key 'Tm' (mean or characteristic wave period) not found in window_params dictionary";
3121 static const char __pyx_k_ERROR_WaveTools_py_Dictionary_ke_3[] = "ERROR! WaveTools.py: Dictionary key 'Window' (window function type) not found in window_params dictionary";
3122 static const char __pyx_k_ERROR_Wavetools_py_Additional_sp_2[] = "ERROR! Wavetools.py: Additional spread parameters are not valid for the %s spectrum";
3123 static const char __pyx_k_ERROR_Wavetools_py_Location_vect_2[] = "ERROR! Wavetools.py: Location vector for timeSeries must have three-components";
3124 static const char __pyx_k_ERROR_Wavetools_py_Maximum_numbe_2[] = "ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for MultispectraRandomWaves is 10000 ";
3125 static const char __pyx_k_ERROR_Wavetools_py_Maximum_numbe_3[] = "ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for DirectionalWaves is 100000 ";
3126 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
3127 static PyObject *__pyx_n_s_Bcoeff;
3128 static PyObject *__pyx_n_s_CombineWaves;
3129 static PyObject *__pyx_n_s_CombineWaves___init;
3130 static PyObject *__pyx_n_s_CombineWaves_eta;
3131 static PyObject *__pyx_n_s_CombineWaves_u;
3132 static PyObject *__pyx_n_s_Comm;
3133 static PyObject *__pyx_n_s_Cutoff;
3134 static PyObject *__pyx_kp_s_Cutoff_2;
3135 static PyObject *__pyx_kp_s_Direct_reconstruction;
3136 static PyObject *__pyx_n_s_DirectionalWaves;
3137 static PyObject *__pyx_n_s_DirectionalWaves___reduce_cython;
3138 static PyObject *__pyx_n_s_DirectionalWaves___setstate_cyth;
3139 static PyObject *__pyx_n_s_DirectionalWaves_eta;
3140 static PyObject *__pyx_n_s_DirectionalWaves_u;
3141 static PyObject *__pyx_kp_s_ERROR_Each_input_list_entry_shou;
3142 static PyObject *__pyx_kp_s_ERROR_Each_input_list_entry_shou_2;
3143 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke;
3144 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_2;
3145 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_3;
3146 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Found_large_e;
3147 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Found_not_con;
3148 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Found_too_few;
3149 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Reconstructio;
3150 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Relaxation_zo;
3151 static PyObject *__pyx_kp_s_ERROR_WaveTools_py_Set_parameter;
3152 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Additional_sp;
3153 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Additional_sp_2;
3154 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_File_s_must_b;
3155 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Location_vect;
3156 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Location_vect_2;
3157 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe;
3158 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe_2;
3159 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe_3;
3160 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Parameters_pa;
3161 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Phase_array_m;
3162 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_SteadyCurrent;
3163 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Timeseries_fi;
3164 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Wavelenght_is;
3165 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Window_handov;
3166 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Wrong_functio;
3167 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_Ycoeff_and_Bc;
3168 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_You_are_not_r;
3169 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_eta_and_u_fun;
3170 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_meanVelocity;
3171 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_phi_argument;
3172 static PyObject *__pyx_kp_s_ERROR_Wavetools_py_phi_in_Direct;
3173 static PyObject *__pyx_kp_s_ERROR_Wavetools_pyx_Argument_mod;
3174 static PyObject *__pyx_kp_s_ERROR_Wrong_wavetype_given_Valid;
3175 static PyObject *__pyx_kp_s_End_time;
3176 static PyObject *__pyx_kp_s_Er1;
3177 static PyObject *__pyx_n_s_Etaoverall;
3178 static PyObject *__pyx_n_s_EtasetUp;
3179 static PyObject *__pyx_n_s_Fenton;
3180 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
3181 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
3182 static PyObject *__pyx_n_s_G0;
3183 static PyObject *__pyx_n_s_Hs;
3184 static PyObject *__pyx_n_s_Hs_2;
3185 static PyObject *__pyx_kp_s_INFO_Calculating_nonlinear_corre;
3186 static PyObject *__pyx_kp_s_INFO_WaveTools_py_Cutoff_entry_i;
3187 static PyObject *__pyx_kp_s_INFO_WaveTools_py_Not_constant_s;
3188 static PyObject *__pyx_kp_s_INFO_WaveTools_py_Overlap_entry;
3189 static PyObject *__pyx_kp_s_INFO_WaveTools_py_performing_a_d;
3190 static PyObject *__pyx_kp_s_INFO_WaveTools_py_performing_ser;
3191 static PyObject *__pyx_kp_s_INFO_Wavetools_py_Checking_durat;
3192 static PyObject *__pyx_kp_s_INFO_Wavetools_py_Correcting_win;
3193 static PyObject *__pyx_kp_s_INFO_Wavetools_py_No_phase_array;
3194 static PyObject *__pyx_kp_s_INFO_Wavetools_py_Reading_spectr;
3195 static PyObject *__pyx_kp_s_INFO_Wavetools_py_Using_s_window;
3196 static PyObject *__pyx_n_s_ImportError;
3197 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9a;
3198 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xe2;
3199 static PyObject *__pyx_n_s_JONSWAP;
3200 static PyObject *__pyx_n_s_K;
3201 static PyObject *__pyx_n_s_Lgen;
3202 static PyObject *__pyx_n_s_Linear;
3203 static PyObject *__pyx_n_s_M;
3204 static PyObject *__pyx_n_s_MonochromaticWaves;
3205 static PyObject *__pyx_n_s_MonochromaticWaves___reduce_cyth;
3206 static PyObject *__pyx_n_s_MonochromaticWaves___setstate_cy;
3207 static PyObject *__pyx_n_s_MonochromaticWaves_eta;
3208 static PyObject *__pyx_n_s_MonochromaticWaves_u;
3209 static PyObject *__pyx_n_s_MultiSpectraRandomWaves;
3210 static PyObject *__pyx_n_s_MultiSpectraRandomWaves___reduce;
3211 static PyObject *__pyx_n_s_MultiSpectraRandomWaves___setsta;
3212 static PyObject *__pyx_n_s_MultiSpectraRandomWaves_eta;
3213 static PyObject *__pyx_n_s_MultiSpectraRandomWaves_u;
3214 static PyObject *__pyx_n_s_N;
3215 static PyObject *__pyx_n_s_NLongW;
3216 static PyObject *__pyx_n_s_NewWave;
3217 static PyObject *__pyx_n_s_NewWave___reduce_cython;
3218 static PyObject *__pyx_n_s_NewWave___setstate_cython;
3219 static PyObject *__pyx_n_s_NewWave_eta;
3220 static PyObject *__pyx_n_s_NewWave_u;
3221 static PyObject *__pyx_n_s_NewWave_writeEtaSeries;
3222 static PyObject *__pyx_n_s_Nf;
3223 static PyObject *__pyx_n_s_Nfreq;
3224 static PyObject *__pyx_n_s_Nmax;
3225 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
3226 static PyObject *__pyx_n_s_Np;
3227 static PyObject *__pyx_n_s_Nseries;
3228 static PyObject *__pyx_n_s_Nspectra;
3229 static PyObject *__pyx_kp_s_Number_of_windows;
3230 static PyObject *__pyx_n_s_Nwaves;
3231 static PyObject *__pyx_n_s_Nwaves_tot;
3232 static PyObject *__pyx_n_s_Nwind;
3233 static PyObject *__pyx_n_s_Overlap;
3234 static PyObject *__pyx_n_s_PM_mod;
3235 static PyObject *__pyx_n_s_Period;
3236 static PyObject *__pyx_n_s_PickleError;
3237 static PyObject *__pyx_n_s_Profiling;
3238 static PyObject *__pyx_n_s_RW;
3239 static PyObject *__pyx_n_s_RandomNLWaves;
3240 static PyObject *__pyx_n_s_RandomNLWavesFast;
3241 static PyObject *__pyx_n_s_RandomNLWavesFast___init;
3242 static PyObject *__pyx_n_s_RandomNLWavesFast_eta;
3243 static PyObject *__pyx_n_s_RandomNLWavesFast_u;
3244 static PyObject *__pyx_n_s_RandomNLWaves___reduce_cython;
3245 static PyObject *__pyx_n_s_RandomNLWaves___setstate_cython;
3246 static PyObject *__pyx_n_s_RandomNLWaves_eta_2ndOrder;
3247 static PyObject *__pyx_n_s_RandomNLWaves_eta_long;
3248 static PyObject *__pyx_n_s_RandomNLWaves_eta_overall;
3249 static PyObject *__pyx_n_s_RandomNLWaves_eta_setUp;
3250 static PyObject *__pyx_n_s_RandomNLWaves_eta_short;
3251 static PyObject *__pyx_n_s_RandomNLWaves_writeEtaSeries;
3252 static PyObject *__pyx_n_s_RandomNLWaves_wtError;
3253 static PyObject *__pyx_n_s_RandomSeries;
3254 static PyObject *__pyx_n_s_RandomWaves;
3255 static PyObject *__pyx_n_s_RandomWavesFast;
3256 static PyObject *__pyx_n_s_RandomWavesFast___init;
3257 static PyObject *__pyx_n_s_RandomWavesFast_printOut;
3258 static PyObject *__pyx_n_s_RandomWaves___reduce_cython;
3259 static PyObject *__pyx_n_s_RandomWaves___setstate_cython;
3260 static PyObject *__pyx_n_s_RandomWaves_eta;
3261 static PyObject *__pyx_n_s_RandomWaves_u;
3262 static PyObject *__pyx_n_s_RandomWaves_writeEtaSeries;
3263 static PyObject *__pyx_n_s_RuntimeError;
3264 static PyObject *__pyx_n_s_SolitaryWave;
3265 static PyObject *__pyx_n_s_SolitaryWave___reduce_cython;
3266 static PyObject *__pyx_n_s_SolitaryWave___setstate_cython;
3267 static PyObject *__pyx_n_s_SolitaryWave_eta;
3268 static PyObject *__pyx_n_s_SolitaryWave_u;
3269 static PyObject *__pyx_n_s_SpatialTools;
3270 static PyObject *__pyx_kp_s_Start_Time;
3271 static PyObject *__pyx_n_s_SteadyCurrent;
3272 static PyObject *__pyx_n_s_SteadyCurrent___reduce_cython;
3273 static PyObject *__pyx_n_s_SteadyCurrent___setstate_cython;
3274 static PyObject *__pyx_n_s_SteadyCurrent_eta;
3275 static PyObject *__pyx_n_s_SteadyCurrent_u;
3276 static PyObject *__pyx_n_s_TMA;
3277 static PyObject *__pyx_n_s_TOverlap;
3278 static PyObject *__pyx_n_s_TS;
3279 static PyObject *__pyx_n_s_TWindow;
3280 static PyObject *__pyx_n_s_Tend;
3281 static PyObject *__pyx_kp_s_This_class_is_used_for_combinin;
3282 static PyObject *__pyx_kp_s_This_class_is_used_for_generati;
3283 static PyObject *__pyx_kp_s_This_class_is_used_for_generati_2;
3284 static PyObject *__pyx_n_s_TimeSeries;
3285 static PyObject *__pyx_n_s_TimeSeries___reduce_cython;
3286 static PyObject *__pyx_n_s_TimeSeries___setstate_cython;
3287 static PyObject *__pyx_n_s_TimeSeries_etaDirect;
3288 static PyObject *__pyx_n_s_TimeSeries_etaWindow;
3289 static PyObject *__pyx_n_s_TimeSeries_findWindow;
3290 static PyObject *__pyx_n_s_TimeSeries_uDirect;
3291 static PyObject *__pyx_n_s_TimeSeries_uWindow;
3292 static PyObject *__pyx_n_s_TimeSeries_windOut;
3293 static PyObject *__pyx_n_s_Tlag;
3294 static PyObject *__pyx_n_s_Tm;
3295 static PyObject *__pyx_n_s_Tmax;
3296 static PyObject *__pyx_n_s_Tp;
3297 static PyObject *__pyx_n_s_Tp_2;
3298 static PyObject *__pyx_n_s_Tstart;
3299 static PyObject *__pyx_n_s_Tstart_temp;
3300 static PyObject *__pyx_n_s_TypeError;
3301 static PyObject *__pyx_n_s_U;
3302 static PyObject *__pyx_n_s_UH;
3303 static PyObject *__pyx_n_s_UV;
3304 static PyObject *__pyx_n_s_Udrift;
3305 static PyObject *__pyx_n_s_Uhorz;
3306 static PyObject *__pyx_n_s_Uvert;
3307 static PyObject *__pyx_n_s_V;
3308 static PyObject *__pyx_n_s_ValueError;
3309 static PyObject *__pyx_n_s_WaveTools;
3310 static PyObject *__pyx_kp_s_Wave_direction_is_not_perpendicu;
3311 static PyObject *__pyx_kp_s_Wavetools_py_Provide_valid_depth;
3312 static PyObject *__pyx_kp_s_Wavetools_py_Stopping_simulation;
3313 static PyObject *__pyx_n_s_Window;
3314 static PyObject *__pyx_n_s_Ycoeff;
3315 static PyObject *__pyx_n_s_Z;
3316 static PyObject *__pyx_kp_s__43;
3317 static PyObject *__pyx_kp_s__52;
3318 static PyObject *__pyx_n_s_a;
3319 static PyObject *__pyx_n_s_a1;
3320 static PyObject *__pyx_n_s_a2;
3321 static PyObject *__pyx_n_s_aR;
3322 static PyObject *__pyx_n_s_aRN;
3323 static PyObject *__pyx_n_s_aa;
3324 static PyObject *__pyx_n_s_ai;
3325 static PyObject *__pyx_n_s_all;
3326 static PyObject *__pyx_n_s_all_2;
3327 static PyObject *__pyx_n_s_amp;
3328 static PyObject *__pyx_n_s_amplitude;
3329 static PyObject *__pyx_n_s_append;
3330 static PyObject *__pyx_n_s_args;
3331 static PyObject *__pyx_n_s_array;
3332 static PyObject *__pyx_n_s_arrayData;
3333 static PyObject *__pyx_n_s_autoFenton;
3334 static PyObject *__pyx_n_s_autoFentonOpts;
3335 static PyObject *__pyx_n_s_bandFactor;
3336 static PyObject *__pyx_n_s_barrier;
3337 static PyObject *__pyx_n_s_bj;
3338 static PyObject *__pyx_n_s_builtins;
3339 static PyObject *__pyx_n_s_c;
3340 static PyObject *__pyx_n_s_checkAcc;
3341 static PyObject *__pyx_n_s_cinit___locals_genexpr;
3342 static PyObject *__pyx_n_s_cline_in_traceback;
3343 static PyObject *__pyx_n_s_close;
3344 static PyObject *__pyx_n_s_cmat;
3345 static PyObject *__pyx_n_s_cmath;
3346 static PyObject *__pyx_n_s_cond;
3347 static PyObject *__pyx_n_s_condition;
3348 static PyObject *__pyx_n_s_conv_crit;
3349 static PyObject *__pyx_n_s_copyFiles;
3350 static PyObject *__pyx_n_s_cos;
3351 static PyObject *__pyx_n_s_cos2s;
3352 static PyObject *__pyx_n_s_coshkzd_test;
3353 static PyObject *__pyx_n_s_costap;
3354 static PyObject *__pyx_n_s_cppU;
3355 static PyObject *__pyx_n_s_crestFocus;
3356 static PyObject *__pyx_kp_s_csv;
3357 static PyObject *__pyx_n_s_current_criterion;
3358 static PyObject *__pyx_n_s_current_magnitude;
3359 static PyObject *__pyx_n_s_cut;
3360 static PyObject *__pyx_n_s_cutoff;
3361 static PyObject *__pyx_n_s_cutoffTotal;
3362 static PyObject *__pyx_n_s_cutoff_win;
3363 static PyObject *__pyx_n_s_d;
3364 static PyObject *__pyx_n_s_decompose_tseries;
3365 static PyObject *__pyx_n_s_delimiter;
3366 static PyObject *__pyx_n_s_depth;
3367 static PyObject *__pyx_n_s_depth_2;
3368 static PyObject *__pyx_n_s_df;
3369 static PyObject *__pyx_n_s_dict;
3370 static PyObject *__pyx_n_s_dict_2;
3371 static PyObject *__pyx_n_s_dirCheck;
3372 static PyObject *__pyx_n_s_dircheck;
3373 static PyObject *__pyx_n_s_dispersion;
3374 static PyObject *__pyx_n_s_doc;
3375 static PyObject *__pyx_n_s_dom;
3376 static PyObject *__pyx_n_s_dt;
3377 static PyObject *__pyx_n_s_duration;
3378 static PyObject *__pyx_n_s_er1;
3379 static PyObject *__pyx_n_s_errors;
3380 static PyObject *__pyx_n_s_eta;
3381 static PyObject *__pyx_n_s_etaCheck;
3382 static PyObject *__pyx_n_s_etaDirect;
3383 static PyObject *__pyx_n_s_etaR;
3384 static PyObject *__pyx_n_s_etaWindow;
3385 static PyObject *__pyx_n_s_eta_2ndOrder;
3386 static PyObject *__pyx_n_s_eta_long;
3387 static PyObject *__pyx_n_s_eta_mode;
3388 static PyObject *__pyx_n_s_eta_overall;
3389 static PyObject *__pyx_n_s_eta_setUp;
3390 static PyObject *__pyx_n_s_eta_short;
3391 static PyObject *__pyx_n_s_exit;
3392 static PyObject *__pyx_n_s_exp;
3393 static PyObject *__pyx_n_s_f;
3394 static PyObject *__pyx_n_s_f0;
3395 static PyObject *__pyx_n_s_fast;
3396 static PyObject *__pyx_n_s_fastcos_test;
3397 static PyObject *__pyx_n_s_fastcosh_test;
3398 static PyObject *__pyx_n_s_fastsinh_test;
3399 static PyObject *__pyx_n_s_fft;
3400 static PyObject *__pyx_n_s_fft_x;
3401 static PyObject *__pyx_n_s_fftfreq;
3402 static PyObject *__pyx_n_s_fi;
3403 static PyObject *__pyx_n_s_fim_tmp;
3404 static PyObject *__pyx_n_s_findWindow;
3405 static PyObject *__pyx_n_s_fname;
3406 static PyObject *__pyx_n_s_freq;
3407 static PyObject *__pyx_n_s_fun;
3408 static PyObject *__pyx_n_s_func;
3409 static PyObject *__pyx_n_s_funcName;
3410 static PyObject *__pyx_n_s_funcNames;
3411 static PyObject *__pyx_n_s_func_ret;
3412 static PyObject *__pyx_n_s_g;
3413 static PyObject *__pyx_n_s_gAbs;
3414 static PyObject *__pyx_n_s_gamma;
3415 static PyObject *__pyx_n_s_genexpr;
3416 static PyObject *__pyx_n_s_get;
3417 static PyObject *__pyx_n_s_getBYCoeffs;
3418 static PyObject *__pyx_n_s_getWavelength;
3419 static PyObject *__pyx_n_s_getstate;
3420 static PyObject *__pyx_n_s_height_steps;
3421 static PyObject *__pyx_n_s_ho;
3422 static PyObject *__pyx_n_s_i;
3423 static PyObject *__pyx_n_s_i1;
3424 static PyObject *__pyx_n_s_i2;
3425 static PyObject *__pyx_n_s_iend;
3426 static PyObject *__pyx_n_s_ii;
3427 static PyObject *__pyx_n_s_import;
3428 static PyObject *__pyx_n_s_init;
3429 static PyObject *__pyx_n_s_interp;
3430 static PyObject *__pyx_n_s_isMaster;
3431 static PyObject *__pyx_n_s_j;
3432 static PyObject *__pyx_n_s_jj;
3433 static PyObject *__pyx_n_s_k;
3434 static PyObject *__pyx_n_s_kAbs;
3435 static PyObject *__pyx_n_s_kDir;
3436 static PyObject *__pyx_n_s_l;
3437 static PyObject *__pyx_n_s_level;
3438 static PyObject *__pyx_n_s_linalg;
3439 static PyObject *__pyx_n_s_linear;
3440 static PyObject *__pyx_n_s_linspace;
3441 static PyObject *__pyx_n_s_loadExistingFunction;
3442 static PyObject *__pyx_n_s_loadtxt;
3443 static PyObject *__pyx_n_s_log;
3444 static PyObject *__pyx_n_s_logEvent;
3445 static PyObject *__pyx_n_s_logFile;
3446 static PyObject *__pyx_n_s_long;
3447 static PyObject *__pyx_n_s_main;
3448 static PyObject *__pyx_n_s_max;
3449 static PyObject *__pyx_n_s_mean;
3450 static PyObject *__pyx_n_s_meanVelocity;
3451 static PyObject *__pyx_n_s_metaclass;
3452 static PyObject *__pyx_n_s_mitsuyasu;
3453 static PyObject *__pyx_n_s_mode;
3454 static PyObject *__pyx_n_s_modes;
3455 static PyObject *__pyx_n_s_module;
3456 static PyObject *__pyx_n_s_mwl;
3457 static PyObject *__pyx_n_s_name;
3458 static PyObject *__pyx_n_s_ncoeffs;
3459 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
3460 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
3461 static PyObject *__pyx_n_s_new;
3462 static PyObject *__pyx_n_s_nfft;
3463 static PyObject *__pyx_n_s_niter;
3464 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3465 static PyObject *__pyx_n_s_norm;
3466 static PyObject *__pyx_n_s_normIntegral;
3467 static PyObject *__pyx_n_s_np;
3468 static PyObject *__pyx_n_s_npoints;
3469 static PyObject *__pyx_n_s_numpy;
3470 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
3471 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
3472 static PyObject *__pyx_n_s_object;
3473 static PyObject *__pyx_n_s_old_div;
3474 static PyObject *__pyx_n_s_omega;
3475 static PyObject *__pyx_n_s_omega0;
3476 static PyObject *__pyx_n_s_ones;
3477 static PyObject *__pyx_n_s_open;
3478 static PyObject *__pyx_n_s_overl;
3479 static PyObject *__pyx_n_s_past_utils;
3480 static PyObject *__pyx_n_s_period;
3481 static PyObject *__pyx_n_s_periods;
3482 static PyObject *__pyx_n_s_phase;
3483 static PyObject *__pyx_n_s_phi;
3484 static PyObject *__pyx_n_s_phi0;
3485 static PyObject *__pyx_n_s_phiSymm;
3486 static PyObject *__pyx_n_s_pi;
3487 static PyObject *__pyx_n_s_pickle;
3488 static PyObject *__pyx_n_s_points_freesurface;
3489 static PyObject *__pyx_n_s_points_velocity;
3490 static PyObject *__pyx_n_s_points_vertical;
3491 static PyObject *__pyx_n_s_pp;
3492 static PyObject *__pyx_n_s_prepare;
3493 static PyObject *__pyx_n_s_print;
3494 static PyObject *__pyx_n_s_printOut;
3495 static PyObject *__pyx_n_s_proteus;
3496 static PyObject *__pyx_kp_s_proteus_WaveTools_py;
3497 static PyObject *__pyx_n_s_proteus_fenton;
3498 static PyObject *__pyx_n_s_pyx_PickleError;
3499 static PyObject *__pyx_n_s_pyx_checksum;
3500 static PyObject *__pyx_n_s_pyx_result;
3501 static PyObject *__pyx_n_s_pyx_state;
3502 static PyObject *__pyx_n_s_pyx_type;
3503 static PyObject *__pyx_n_s_pyx_unpickle_SolitaryWave;
3504 static PyObject *__pyx_n_s_pyx_unpickle_SteadyCurrent;
3505 static PyObject *__pyx_n_s_pyx_vtable;
3506 static PyObject *__pyx_n_s_qualname;
3507 static PyObject *__pyx_n_s_r;
3508 static PyObject *__pyx_n_s_rampTime;
3509 static PyObject *__pyx_n_s_rand;
3510 static PyObject *__pyx_n_s_random;
3511 static PyObject *__pyx_n_s_randomNLWaves;
3512 static PyObject *__pyx_n_s_range;
3513 static PyObject *__pyx_n_s_real;
3514 static PyObject *__pyx_n_s_rec_d;
3515 static PyObject *__pyx_n_s_rec_direct;
3516 static PyObject *__pyx_n_s_reduce;
3517 static PyObject *__pyx_n_s_reduceToIntervals;
3518 static PyObject *__pyx_n_s_reduce_cython;
3519 static PyObject *__pyx_n_s_reduce_ex;
3520 static PyObject *__pyx_n_s_results;
3521 static PyObject *__pyx_n_s_returnRectangles;
3522 static PyObject *__pyx_n_s_returnRectangles3D;
3523 static PyObject *__pyx_n_s_rotation3D;
3524 static PyObject *__pyx_n_s_round;
3525 static PyObject *__pyx_n_s_runFourier;
3526 static PyObject *__pyx_n_s_s;
3527 static PyObject *__pyx_n_s_savetxt;
3528 static PyObject *__pyx_n_s_self;
3529 static PyObject *__pyx_kp_s_self_Bcoeff__self_Ycoeff__self;
3530 static PyObject *__pyx_kp_s_self_T0__self__cpp_eta_self__cpp;
3531 static PyObject *__pyx_kp_s_self_ai__self_kDir__self_ki__sel;
3532 static PyObject *__pyx_n_s_send;
3533 static PyObject *__pyx_n_s_series;
3534 static PyObject *__pyx_n_s_seriesArray;
3535 static PyObject *__pyx_n_s_setDirVector;
3536 static PyObject *__pyx_n_s_setUp;
3537 static PyObject *__pyx_n_s_setVertDir;
3538 static PyObject *__pyx_n_s_setstate;
3539 static PyObject *__pyx_n_s_setstate_cython;
3540 static PyObject *__pyx_n_s_setup;
3541 static PyObject *__pyx_n_s_shape;
3542 static PyObject *__pyx_n_s_short;
3543 static PyObject *__pyx_n_s_sigma;
3544 static PyObject *__pyx_n_s_sigmaReturn;
3545 static PyObject *__pyx_n_s_sinh;
3546 static PyObject *__pyx_n_s_sinhkzd_test;
3547 static PyObject *__pyx_n_s_sinus;
3548 static PyObject *__pyx_n_s_skiprows;
3549 static PyObject *__pyx_n_s_smax;
3550 static PyObject *__pyx_n_s_spectName;
3551 static PyObject *__pyx_n_s_spectral_params;
3552 static PyObject *__pyx_n_s_spreadName;
3553 static PyObject *__pyx_n_s_spread_params;
3554 static PyObject *__pyx_n_s_sqrt;
3555 static PyObject *__pyx_n_s_state;
3556 static PyObject *__pyx_n_s_str;
3557 static PyObject *__pyx_kp_s_stringsource;
3558 static PyObject *__pyx_n_s_sum;
3559 static PyObject *__pyx_n_s_sys;
3560 static PyObject *__pyx_n_s_t;
3561 static PyObject *__pyx_n_s_tanh;
3562 static PyObject *__pyx_n_s_te;
3563 static PyObject *__pyx_n_s_test;
3564 static PyObject *__pyx_n_s_tfocus;
3565 static PyObject *__pyx_n_s_theta;
3566 static PyObject *__pyx_n_s_throw;
3567 static PyObject *__pyx_n_s_time;
3568 static PyObject *__pyx_n_s_timeSeriesFile;
3569 static PyObject *__pyx_n_s_timeSeriesPosition;
3570 static PyObject *__pyx_n_s_timelst;
3571 static PyObject *__pyx_n_s_tma;
3572 static PyObject *__pyx_n_s_tolist;
3573 static PyObject *__pyx_n_s_tophat;
3574 static PyObject *__pyx_n_s_trans;
3575 static PyObject *__pyx_n_s_ts;
3576 static PyObject *__pyx_n_s_tt;
3577 static PyObject *__pyx_kp_s_txt;
3578 static PyObject *__pyx_n_s_u;
3579 static PyObject *__pyx_n_s_uCheck;
3580 static PyObject *__pyx_n_s_uDirect;
3581 static PyObject *__pyx_n_s_uR;
3582 static PyObject *__pyx_n_s_uWindow;
3583 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
3584 static PyObject *__pyx_n_s_update;
3585 static PyObject *__pyx_n_s_use_setstate;
3586 static PyObject *__pyx_n_s_v1;
3587 static PyObject *__pyx_n_s_v2;
3588 static PyObject *__pyx_n_s_vDir;
3589 static PyObject *__pyx_n_s_validFunctions;
3590 static PyObject *__pyx_n_s_vector;
3591 static PyObject *__pyx_n_s_vel_mode;
3592 static PyObject *__pyx_n_s_w;
3593 static PyObject *__pyx_n_s_w_aux;
3594 static PyObject *__pyx_n_s_waveDir;
3595 static PyObject *__pyx_n_s_waveDir0;
3596 static PyObject *__pyx_n_s_waveHeight;
3597 static PyObject *__pyx_n_s_waveList;
3598 static PyObject *__pyx_n_s_waveType;
3599 static PyObject *__pyx_n_s_waveheight;
3600 static PyObject *__pyx_n_s_wavelength;
3601 static PyObject *__pyx_kp_s_waves_This_may_take_a_while;
3602 static PyObject *__pyx_n_s_where;
3603 static PyObject *__pyx_n_s_wind;
3604 static PyObject *__pyx_n_s_windOut;
3605 static PyObject *__pyx_n_s_window_params;
3606 static PyObject *__pyx_n_s_windows;
3607 static PyObject *__pyx_n_s_writeEtaSeries;
3608 static PyObject *__pyx_n_s_writeInput;
3609 static PyObject *__pyx_n_s_wtError;
3610 static PyObject *__pyx_n_s_ww;
3611 static PyObject *__pyx_n_s_wwi_setUp;
3612 static PyObject *__pyx_n_s_x;
3613 static PyObject *__pyx_n_s_x0;
3614 static PyObject *__pyx_n_s_xfocus;
3615 static PyObject *__pyx_n_s_xx;
3616 static PyObject *__pyx_n_s_y;
3617 static PyObject *__pyx_n_s_zeros;
3618 static PyObject *__pyx_n_s_zip;
3619 static PyObject *__pyx_pf_9WaveTools_fastcos_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_phase, PyObject *__pyx_v_sinus); /* proto */
3620 static PyObject *__pyx_pf_9WaveTools_2fastcosh_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_fast); /* proto */
3621 static PyObject *__pyx_pf_9WaveTools_4fastsinh_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_fast); /* proto */
3622 static PyObject *__pyx_pf_9WaveTools_6coshkzd_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_d, PyObject *__pyx_v_fast); /* proto */
3623 static PyObject *__pyx_pf_9WaveTools_8sinhkzd_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_d, PyObject *__pyx_v_fast); /* proto */
3624 static PyObject *__pyx_pf_9WaveTools_10loadExistingFunction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcName, PyObject *__pyx_v_validFunctions); /* proto */
3625 static PyObject *__pyx_pf_9WaveTools_12setVertDir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_g); /* proto */
3626 static PyObject *__pyx_pf_9WaveTools_14setDirVector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vector); /* proto */
3627 static PyObject *__pyx_pf_9WaveTools_16dirCheck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v1, PyObject *__pyx_v_v2); /* proto */
3628 static PyObject *__pyx_pf_9WaveTools_18reduceToIntervals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_df); /* proto */
3629 static PyObject *__pyx_pf_9WaveTools_20returnRectangles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_x); /* proto */
3630 static PyObject *__pyx_pf_9WaveTools_22returnRectangles3D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
3631 static PyObject *__pyx_pf_9WaveTools_24normIntegral(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_dom); /* proto */
3632 static PyObject *__pyx_pf_9WaveTools_26eta_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t, PyObject *__pyx_v_kDir, PyObject *__pyx_v_omega, PyObject *__pyx_v_phi, PyObject *__pyx_v_amplitude); /* proto */
3633 static PyObject *__pyx_pf_9WaveTools_28Udrift(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_amp, PyObject *__pyx_v_gAbs, PyObject *__pyx_v_c, PyObject *__pyx_v_d); /* proto */
3634 static PyObject *__pyx_pf_9WaveTools_30vel_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t, PyObject *__pyx_v_kDir, PyObject *__pyx_v_kAbs, PyObject *__pyx_v_omega, PyObject *__pyx_v_phi, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_vDir, PyObject *__pyx_v_gAbs); /* proto */
3635 static PyObject *__pyx_pf_9WaveTools_32sigma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_omega, PyObject *__pyx_v_omega0); /* proto */
3636 static PyObject *__pyx_pf_9WaveTools_34JONSWAP(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_f0, PyObject *__pyx_v_Hs, PyObject *__pyx_v_gamma, PyObject *__pyx_v_TMA, PyObject *__pyx_v_depth); /* proto */
3637 static PyObject *__pyx_pf_9WaveTools_36PM_mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_f0, PyObject *__pyx_v_Hs); /* proto */
3638 static PyObject *__pyx_pf_9WaveTools_38cos2s(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_theta, PyObject *__pyx_v_f, PyObject *__pyx_v_s); /* proto */
3639 static PyObject *__pyx_pf_9WaveTools_40mitsuyasu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_theta, PyObject *__pyx_v_fi, PyObject *__pyx_v_f0, PyObject *__pyx_v_smax); /* proto */
3640 static PyObject *__pyx_pf_9WaveTools_42dispersion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_w, PyObject *__pyx_v_d, PyObject *__pyx_v_g, PyObject *__pyx_v_niter); /* proto */
3641 static PyObject *__pyx_pf_9WaveTools_44tophat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_cutoff); /* proto */
3642 static PyObject *__pyx_pf_9WaveTools_46costap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_cutoff); /* proto */
3643 static PyObject *__pyx_pf_9WaveTools_48decompose_tseries(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time, PyObject *__pyx_v_eta, PyObject *__pyx_v_dt); /* proto */
3644 static int __pyx_pf_9WaveTools_13SteadyCurrent___init__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, PyObject *__pyx_v_U, PyObject *__pyx_v_mwl, PyObject *__pyx_v_rampTime); /* proto */
3645 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_2eta(CYTHON_UNUSED struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
3646 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_4u(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3647 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_3mwl___get__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self); /* proto */
3648 static int __pyx_pf_9WaveTools_13SteadyCurrent_3mwl_2__set__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3649 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_6__reduce_cython__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self); /* proto */
3650 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_8__setstate_cython__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3651 static int __pyx_pf_9WaveTools_12SolitaryWave___init__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_waveHeight, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_g, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_trans, PyObject *__pyx_v_fast); /* proto */
3652 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_2eta(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3653 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_4u(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3654 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_3mwl___get__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self); /* proto */
3655 static int __pyx_pf_9WaveTools_12SolitaryWave_3mwl_2__set__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3656 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_1c___get__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self); /* proto */
3657 static int __pyx_pf_9WaveTools_12SolitaryWave_1c_2__set__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3658 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_6__reduce_cython__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self); /* proto */
3659 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_8__setstate_cython__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3660 static int __pyx_pf_9WaveTools_18MonochromaticWaves___init__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_period, PyObject *__pyx_v_waveHeight, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_g, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_waveType, PyObject *__pyx_v_autoFenton, PyObject *__pyx_v_autoFentonOpts, PyObject *__pyx_v_Ycoeff, PyObject *__pyx_v_Bcoeff, PyObject *__pyx_v_Nf, PyObject *__pyx_v_meanVelocity, PyObject *__pyx_v_phi0, PyObject *__pyx_v_fast); /* proto */
3661 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_2eta(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3662 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_4u(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3663 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_10wavelength___get__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self); /* proto */
3664 static int __pyx_pf_9WaveTools_18MonochromaticWaves_10wavelength_2__set__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3665 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_3mwl___get__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self); /* proto */
3666 static int __pyx_pf_9WaveTools_18MonochromaticWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3667 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self); /* proto */
3668 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3669 static PyObject *__pyx_pf_9WaveTools_7NewWave_9__cinit___genexpr(PyObject *__pyx_self); /* proto */
3670 static int __pyx_pf_9WaveTools_7NewWave___cinit__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, CYTHON_UNUSED PyObject *__pyx_v_crestFocus, PyObject *__pyx_v_xfocus, PyObject *__pyx_v_tfocus, PyObject *__pyx_v_fast, PyObject *__pyx_v_Nmax); /* proto */
3671 static PyObject *__pyx_pf_9WaveTools_7NewWave_2eta(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3672 static PyObject *__pyx_pf_9WaveTools_7NewWave_4u(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3673 static PyObject *__pyx_pf_9WaveTools_7NewWave_6writeEtaSeries(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_fname, PyObject *__pyx_v_Lgen); /* proto */
3674 static PyObject *__pyx_pf_9WaveTools_7NewWave_3mwl___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3675 static int __pyx_pf_9WaveTools_7NewWave_3mwl_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3676 static PyObject *__pyx_pf_9WaveTools_7NewWave_5depth___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3677 static int __pyx_pf_9WaveTools_7NewWave_5depth_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3678 static PyObject *__pyx_pf_9WaveTools_7NewWave_4gAbs___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3679 static int __pyx_pf_9WaveTools_7NewWave_4gAbs_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3680 static PyObject *__pyx_pf_9WaveTools_7NewWave_4Tlag___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3681 static int __pyx_pf_9WaveTools_7NewWave_4Tlag_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3682 static PyObject *__pyx_pf_9WaveTools_7NewWave_2Hs___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3683 static int __pyx_pf_9WaveTools_7NewWave_2Hs_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3684 static PyObject *__pyx_pf_9WaveTools_7NewWave_2Tp___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3685 static int __pyx_pf_9WaveTools_7NewWave_2Tp_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3686 static PyObject *__pyx_pf_9WaveTools_7NewWave_2fp___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3687 static int __pyx_pf_9WaveTools_7NewWave_2fp_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3688 static PyObject *__pyx_pf_9WaveTools_7NewWave_10bandFactor___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3689 static int __pyx_pf_9WaveTools_7NewWave_10bandFactor_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3690 static PyObject *__pyx_pf_9WaveTools_7NewWave_2df___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3691 static int __pyx_pf_9WaveTools_7NewWave_2df_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3692 static PyObject *__pyx_pf_9WaveTools_7NewWave_5focus___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3693 static int __pyx_pf_9WaveTools_7NewWave_5focus_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3694 static PyObject *__pyx_pf_9WaveTools_7NewWave_6tfocus___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3695 static int __pyx_pf_9WaveTools_7NewWave_6tfocus_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3696 static PyObject *__pyx_pf_9WaveTools_7NewWave_1N___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3697 static int __pyx_pf_9WaveTools_7NewWave_1N_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3698 static PyObject *__pyx_pf_9WaveTools_7NewWave_2fi___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3699 static int __pyx_pf_9WaveTools_7NewWave_2fi_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3700 static int __pyx_pf_9WaveTools_7NewWave_2fi_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3701 static PyObject *__pyx_pf_9WaveTools_7NewWave_3fim___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3702 static int __pyx_pf_9WaveTools_7NewWave_3fim_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3703 static int __pyx_pf_9WaveTools_7NewWave_3fim_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3704 static PyObject *__pyx_pf_9WaveTools_7NewWave_5Si_Jm___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3705 static int __pyx_pf_9WaveTools_7NewWave_5Si_Jm_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3706 static int __pyx_pf_9WaveTools_7NewWave_5Si_Jm_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3707 static PyObject *__pyx_pf_9WaveTools_7NewWave_2ki___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3708 static int __pyx_pf_9WaveTools_7NewWave_2ki_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3709 static int __pyx_pf_9WaveTools_7NewWave_2ki_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3710 static PyObject *__pyx_pf_9WaveTools_7NewWave_5omega___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3711 static int __pyx_pf_9WaveTools_7NewWave_5omega_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3712 static int __pyx_pf_9WaveTools_7NewWave_5omega_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3713 static PyObject *__pyx_pf_9WaveTools_7NewWave_5tanhF___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3714 static int __pyx_pf_9WaveTools_7NewWave_5tanhF_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3715 static int __pyx_pf_9WaveTools_7NewWave_5tanhF_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3716 static PyObject *__pyx_pf_9WaveTools_7NewWave_1g___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3717 static int __pyx_pf_9WaveTools_7NewWave_1g_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3718 static int __pyx_pf_9WaveTools_7NewWave_1g_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3719 static PyObject *__pyx_pf_9WaveTools_7NewWave_7waveDir___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3720 static int __pyx_pf_9WaveTools_7NewWave_7waveDir_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3721 static int __pyx_pf_9WaveTools_7NewWave_7waveDir_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3722 static PyObject *__pyx_pf_9WaveTools_7NewWave_4vDir___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3723 static int __pyx_pf_9WaveTools_7NewWave_4vDir_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3724 static int __pyx_pf_9WaveTools_7NewWave_4vDir_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3725 static PyObject *__pyx_pf_9WaveTools_7NewWave_4kDir___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3726 static int __pyx_pf_9WaveTools_7NewWave_4kDir_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3727 static int __pyx_pf_9WaveTools_7NewWave_4kDir_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3728 static PyObject *__pyx_pf_9WaveTools_7NewWave_2ai___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3729 static int __pyx_pf_9WaveTools_7NewWave_2ai_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3730 static int __pyx_pf_9WaveTools_7NewWave_2ai_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3731 static PyObject *__pyx_pf_9WaveTools_7NewWave_3phi___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3732 static int __pyx_pf_9WaveTools_7NewWave_3phi_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3733 static int __pyx_pf_9WaveTools_7NewWave_3phi_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3734 static PyObject *__pyx_pf_9WaveTools_7NewWave_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self); /* proto */
3735 static PyObject *__pyx_pf_9WaveTools_7NewWave_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3736 static int __pyx_pf_9WaveTools_11RandomWaves___cinit__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_fast); /* proto */
3737 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2eta(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3738 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4u(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3739 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_6writeEtaSeries(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_fname, PyObject *__pyx_v_Lgen); /* proto */
3740 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_3mwl___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3741 static int __pyx_pf_9WaveTools_11RandomWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3742 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5depth___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3743 static int __pyx_pf_9WaveTools_11RandomWaves_5depth_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3744 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4gAbs___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3745 static int __pyx_pf_9WaveTools_11RandomWaves_4gAbs_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3746 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4Tlag___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3747 static int __pyx_pf_9WaveTools_11RandomWaves_4Tlag_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3748 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2Hs___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3749 static int __pyx_pf_9WaveTools_11RandomWaves_2Hs_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3750 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2Tp___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3751 static int __pyx_pf_9WaveTools_11RandomWaves_2Tp_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3752 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2fp___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3753 static int __pyx_pf_9WaveTools_11RandomWaves_2fp_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3754 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_10bandFactor___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3755 static int __pyx_pf_9WaveTools_11RandomWaves_10bandFactor_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3756 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2df___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3757 static int __pyx_pf_9WaveTools_11RandomWaves_2df_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3758 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_10wavelength___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3759 static int __pyx_pf_9WaveTools_11RandomWaves_10wavelength_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3760 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_1N___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3761 static int __pyx_pf_9WaveTools_11RandomWaves_1N_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3762 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2fi___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3763 static int __pyx_pf_9WaveTools_11RandomWaves_2fi_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3764 static int __pyx_pf_9WaveTools_11RandomWaves_2fi_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3765 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_3fim___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3766 static int __pyx_pf_9WaveTools_11RandomWaves_3fim_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3767 static int __pyx_pf_9WaveTools_11RandomWaves_3fim_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3768 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5Si_Jm___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3769 static int __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3770 static int __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3771 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2ki___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3772 static int __pyx_pf_9WaveTools_11RandomWaves_2ki_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3773 static int __pyx_pf_9WaveTools_11RandomWaves_2ki_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3774 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5omega___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3775 static int __pyx_pf_9WaveTools_11RandomWaves_5omega_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3776 static int __pyx_pf_9WaveTools_11RandomWaves_5omega_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3777 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5tanhF___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3778 static int __pyx_pf_9WaveTools_11RandomWaves_5tanhF_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3779 static int __pyx_pf_9WaveTools_11RandomWaves_5tanhF_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3780 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_1g___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3781 static int __pyx_pf_9WaveTools_11RandomWaves_1g_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3782 static int __pyx_pf_9WaveTools_11RandomWaves_1g_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3783 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_7waveDir___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3784 static int __pyx_pf_9WaveTools_11RandomWaves_7waveDir_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3785 static int __pyx_pf_9WaveTools_11RandomWaves_7waveDir_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3786 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4vDir___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3787 static int __pyx_pf_9WaveTools_11RandomWaves_4vDir_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3788 static int __pyx_pf_9WaveTools_11RandomWaves_4vDir_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3789 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4kDir___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3790 static int __pyx_pf_9WaveTools_11RandomWaves_4kDir_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3791 static int __pyx_pf_9WaveTools_11RandomWaves_4kDir_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3792 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2ai___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3793 static int __pyx_pf_9WaveTools_11RandomWaves_2ai_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3794 static int __pyx_pf_9WaveTools_11RandomWaves_2ai_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3795 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_3phi___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3796 static int __pyx_pf_9WaveTools_11RandomWaves_3phi_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3797 static int __pyx_pf_9WaveTools_11RandomWaves_3phi_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3798 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self); /* proto */
3799 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3800 static int __pyx_pf_9WaveTools_23MultiSpectraRandomWaves___cinit__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_Nspectra, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_fast); /* proto */
3801 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_2eta(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3802 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_4u(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3803 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_3mwl___get__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self); /* proto */
3804 static int __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3805 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_5depth___get__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self); /* proto */
3806 static int __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_5depth_2__set__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3807 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self); /* proto */
3808 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3809 static int __pyx_pf_9WaveTools_16DirectionalWaves___cinit__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_M, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir0, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spreadName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_spread_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_phiSymm, PyObject *__pyx_v_fast); /* proto */
3810 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_2eta(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3811 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_4u(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3812 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_3mwl___get__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self); /* proto */
3813 static int __pyx_pf_9WaveTools_16DirectionalWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3814 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_5depth___get__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self); /* proto */
3815 static int __pyx_pf_9WaveTools_16DirectionalWaves_5depth_2__set__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3816 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self); /* proto */
3817 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3818 static int __pyx_pf_9WaveTools_10TimeSeries___init__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_timeSeriesFile, PyObject *__pyx_v_skiprows, PyObject *__pyx_v_timeSeriesPosition, PyObject *__pyx_v_depth, PyObject *__pyx_v_N, PyObject *__pyx_v_mwl, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_cutoffTotal, PyObject *__pyx_v_rec_direct, PyObject *__pyx_v_window_params, PyObject *__pyx_v_arrayData, PyObject *__pyx_v_seriesArray, PyObject *__pyx_v_Lgen, PyObject *__pyx_v_fast); /* proto */
3819 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_2windOut(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3820 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_4etaDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3821 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_6uDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3822 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_8findWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_t); /* proto */
3823 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_10etaWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3824 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_12uWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3825 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_10wavelength___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3826 static int __pyx_pf_9WaveTools_10TimeSeries_10wavelength_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3827 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_3mwl___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3828 static int __pyx_pf_9WaveTools_10TimeSeries_3mwl_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3829 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_3eta___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3830 static int __pyx_pf_9WaveTools_10TimeSeries_3eta_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3831 static int __pyx_pf_9WaveTools_10TimeSeries_3eta_4__del__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3832 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_1u___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3833 static int __pyx_pf_9WaveTools_10TimeSeries_1u_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3834 static int __pyx_pf_9WaveTools_10TimeSeries_1u_4__del__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3835 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self); /* proto */
3836 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3837 static PyObject *__pyx_pf_9WaveTools_15RandomWavesFast___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_Lgen, PyObject *__pyx_v_Nwaves, PyObject *__pyx_v_Nfreq, PyObject *__pyx_v_checkAcc, PyObject *__pyx_v_fast); /* proto */
3838 static PyObject *__pyx_pf_9WaveTools_15RandomWavesFast_2printOut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
3839 static int __pyx_pf_9WaveTools_13RandomNLWaves___init__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_Tstart, CYTHON_UNUSED PyObject *__pyx_v_Tend, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_fast); /* proto */
3840 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_2eta_2ndOrder(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3841 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_4eta_short(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3842 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_6eta_long(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3843 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_8eta_setUp(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
3844 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_10eta_overall(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t, PyObject *__pyx_v_setUp); /* proto */
3845 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_12writeEtaSeries(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_dt, PyObject *__pyx_v_x0, PyObject *__pyx_v_fname, PyObject *__pyx_v_mode, PyObject *__pyx_v_setUp, PyObject *__pyx_v_Lgen); /* proto */
3846 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_14wtError(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
3847 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_3eta___get__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3848 static int __pyx_pf_9WaveTools_13RandomNLWaves_3eta_2__set__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3849 static int __pyx_pf_9WaveTools_13RandomNLWaves_3eta_4__del__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3850 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_1u___get__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3851 static int __pyx_pf_9WaveTools_13RandomNLWaves_1u_2__set__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3852 static int __pyx_pf_9WaveTools_13RandomNLWaves_1u_4__del__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3853 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear___get__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3854 static int __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear_2__set__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
3855 static int __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear_4__del__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3856 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self); /* proto */
3857 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3858 static PyObject *__pyx_pf_9WaveTools_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
3859 static PyObject *__pyx_pf_9WaveTools_17RandomNLWavesFast___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_Lgen, PyObject *__pyx_v_Nwaves, PyObject *__pyx_v_Nfreq, PyObject *__pyx_v_NLongW, PyObject *__pyx_v_fast); /* proto */
3860 static PyObject *__pyx_pf_9WaveTools_17RandomNLWavesFast_2eta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3861 static PyObject *__pyx_pf_9WaveTools_17RandomNLWavesFast_4u(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3862 static PyObject *__pyx_pf_9WaveTools_12CombineWaves___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_waveList); /* proto */
3863 static PyObject *__pyx_pf_9WaveTools_12CombineWaves_2eta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3864 static PyObject *__pyx_pf_9WaveTools_12CombineWaves_4u(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t); /* proto */
3865 static PyObject *__pyx_pf_9WaveTools_50__pyx_unpickle_SteadyCurrent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3866 static PyObject *__pyx_pf_9WaveTools_52__pyx_unpickle_SolitaryWave(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3867 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3868 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
3869 static PyObject *__pyx_tp_new_9WaveTools_SteadyCurrent(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3870 static PyObject *__pyx_tp_new_9WaveTools_SolitaryWave(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3871 static PyObject *__pyx_tp_new_9WaveTools_MonochromaticWaves(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3872 static PyObject *__pyx_tp_new_9WaveTools_NewWave(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3873 static PyObject *__pyx_tp_new_9WaveTools_RandomWaves(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3874 static PyObject *__pyx_tp_new_9WaveTools_MultiSpectraRandomWaves(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3875 static PyObject *__pyx_tp_new_9WaveTools_DirectionalWaves(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3876 static PyObject *__pyx_tp_new_9WaveTools_TimeSeries(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3877 static PyObject *__pyx_tp_new_9WaveTools_RandomNLWaves(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3878 static PyObject *__pyx_tp_new_9WaveTools___pyx_scope_struct____cinit__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3879 static PyObject *__pyx_tp_new_9WaveTools___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3880 static PyObject *__pyx_float_0_;
3881 static PyObject *__pyx_float_1_;
3882 static PyObject *__pyx_float_2_;
3883 static PyObject *__pyx_float_4_;
3884 static PyObject *__pyx_float_0_1;
3885 static PyObject *__pyx_float_0_2;
3886 static PyObject *__pyx_float_0_5;
3887 static PyObject *__pyx_float_0_7;
3888 static PyObject *__pyx_float_1_0;
3889 static PyObject *__pyx_float_1_1;
3890 static PyObject *__pyx_float_1_5;
3891 static PyObject *__pyx_float_1_9;
3892 static PyObject *__pyx_float_10_;
3893 static PyObject *__pyx_float_16_;
3894 static PyObject *__pyx_float_2_0;
3895 static PyObject *__pyx_float_3_0;
3896 static PyObject *__pyx_float_3_3;
3897 static PyObject *__pyx_float_4_0;
3898 static PyObject *__pyx_float_5_0;
3899 static PyObject *__pyx_float_50_;
3900 static PyObject *__pyx_float_0_01;
3901 static PyObject *__pyx_float_0_07;
3902 static PyObject *__pyx_float_0_09;
3903 static PyObject *__pyx_float_0_23;
3904 static PyObject *__pyx_float_16_0;
3905 static PyObject *__pyx_float_9_81;
3906 static PyObject *__pyx_float_0_185;
3907 static PyObject *__pyx_float_1eneg_05;
3908 static PyObject *__pyx_float_1eneg_10;
3909 static PyObject *__pyx_float_0_0336;
3910 static PyObject *__pyx_float_neg_2_5;
3911 static PyObject *__pyx_float_neg_5_0;
3912 static PyObject *__pyx_float_neg_1_25;
3913 static PyObject *__pyx_int_0;
3914 static PyObject *__pyx_int_1;
3915 static PyObject *__pyx_int_2;
3916 static PyObject *__pyx_int_3;
3917 static PyObject *__pyx_int_4;
3918 static PyObject *__pyx_int_5;
3919 static PyObject *__pyx_int_10;
3920 static PyObject *__pyx_int_15;
3921 static PyObject *__pyx_int_16;
3922 static PyObject *__pyx_int_20;
3923 static PyObject *__pyx_int_32;
3924 static PyObject *__pyx_int_40;
3925 static PyObject *__pyx_int_50;
3926 static PyObject *__pyx_int_1000;
3927 static PyObject *__pyx_int_161707632;
3928 static PyObject *__pyx_int_237135047;
3929 static PyObject *__pyx_int_neg_1;
3930 static PyObject *__pyx_int_neg_4;
3931 static PyObject *__pyx_k__12;
3932 static PyObject *__pyx_k__13;
3933 static PyObject *__pyx_k__14;
3934 static PyObject *__pyx_k__15;
3935 static PyObject *__pyx_k__22;
3936 static PyObject *__pyx_k__24;
3937 static PyObject *__pyx_k__29;
3938 static PyObject *__pyx_k__40;
3939 static PyObject *__pyx_k__51;
3940 static PyObject *__pyx_tuple_;
3941 static PyObject *__pyx_slice__2;
3942 static PyObject *__pyx_slice__3;
3943 static PyObject *__pyx_slice__4;
3944 static PyObject *__pyx_tuple__5;
3945 static PyObject *__pyx_tuple__6;
3946 static PyObject *__pyx_tuple__7;
3947 static PyObject *__pyx_tuple__8;
3948 static PyObject *__pyx_tuple__9;
3949 static PyObject *__pyx_slice__42;
3950 static PyObject *__pyx_tuple__10;
3951 static PyObject *__pyx_tuple__11;
3952 static PyObject *__pyx_tuple__16;
3953 static PyObject *__pyx_tuple__17;
3954 static PyObject *__pyx_tuple__18;
3955 static PyObject *__pyx_tuple__19;
3956 static PyObject *__pyx_tuple__20;
3957 static PyObject *__pyx_tuple__21;
3958 static PyObject *__pyx_tuple__23;
3959 static PyObject *__pyx_tuple__25;
3960 static PyObject *__pyx_tuple__26;
3961 static PyObject *__pyx_tuple__27;
3962 static PyObject *__pyx_tuple__28;
3963 static PyObject *__pyx_tuple__30;
3964 static PyObject *__pyx_tuple__31;
3965 static PyObject *__pyx_tuple__32;
3966 static PyObject *__pyx_tuple__33;
3967 static PyObject *__pyx_tuple__34;
3968 static PyObject *__pyx_tuple__35;
3969 static PyObject *__pyx_tuple__36;
3970 static PyObject *__pyx_tuple__37;
3971 static PyObject *__pyx_tuple__38;
3972 static PyObject *__pyx_tuple__39;
3973 static PyObject *__pyx_tuple__41;
3974 static PyObject *__pyx_tuple__44;
3975 static PyObject *__pyx_tuple__45;
3976 static PyObject *__pyx_tuple__46;
3977 static PyObject *__pyx_tuple__47;
3978 static PyObject *__pyx_tuple__48;
3979 static PyObject *__pyx_tuple__49;
3980 static PyObject *__pyx_tuple__50;
3981 static PyObject *__pyx_tuple__53;
3982 static PyObject *__pyx_tuple__54;
3983 static PyObject *__pyx_tuple__55;
3984 static PyObject *__pyx_tuple__56;
3985 static PyObject *__pyx_tuple__57;
3986 static PyObject *__pyx_tuple__58;
3987 static PyObject *__pyx_tuple__59;
3988 static PyObject *__pyx_tuple__60;
3989 static PyObject *__pyx_tuple__61;
3990 static PyObject *__pyx_tuple__62;
3991 static PyObject *__pyx_tuple__63;
3992 static PyObject *__pyx_tuple__65;
3993 static PyObject *__pyx_tuple__66;
3994 static PyObject *__pyx_tuple__68;
3995 static PyObject *__pyx_tuple__69;
3996 static PyObject *__pyx_tuple__71;
3997 static PyObject *__pyx_tuple__72;
3998 static PyObject *__pyx_tuple__74;
3999 static PyObject *__pyx_tuple__75;
4000 static PyObject *__pyx_tuple__77;
4001 static PyObject *__pyx_tuple__78;
4002 static PyObject *__pyx_tuple__80;
4003 static PyObject *__pyx_tuple__82;
4004 static PyObject *__pyx_tuple__84;
4005 static PyObject *__pyx_tuple__86;
4006 static PyObject *__pyx_tuple__88;
4007 static PyObject *__pyx_tuple__90;
4008 static PyObject *__pyx_tuple__92;
4009 static PyObject *__pyx_tuple__94;
4010 static PyObject *__pyx_tuple__96;
4011 static PyObject *__pyx_tuple__98;
4012 static PyObject *__pyx_tuple__100;
4013 static PyObject *__pyx_tuple__102;
4014 static PyObject *__pyx_tuple__104;
4015 static PyObject *__pyx_tuple__105;
4016 static PyObject *__pyx_tuple__107;
4017 static PyObject *__pyx_tuple__109;
4018 static PyObject *__pyx_tuple__110;
4019 static PyObject *__pyx_tuple__112;
4020 static PyObject *__pyx_tuple__113;
4021 static PyObject *__pyx_tuple__115;
4022 static PyObject *__pyx_tuple__116;
4023 static PyObject *__pyx_tuple__118;
4024 static PyObject *__pyx_tuple__120;
4025 static PyObject *__pyx_tuple__121;
4026 static PyObject *__pyx_tuple__123;
4027 static PyObject *__pyx_tuple__125;
4028 static PyObject *__pyx_tuple__127;
4029 static PyObject *__pyx_tuple__129;
4030 static PyObject *__pyx_tuple__131;
4031 static PyObject *__pyx_tuple__132;
4032 static PyObject *__pyx_tuple__134;
4033 static PyObject *__pyx_tuple__136;
4034 static PyObject *__pyx_tuple__138;
4035 static PyObject *__pyx_tuple__140;
4036 static PyObject *__pyx_tuple__141;
4037 static PyObject *__pyx_tuple__143;
4038 static PyObject *__pyx_tuple__145;
4039 static PyObject *__pyx_tuple__147;
4040 static PyObject *__pyx_tuple__149;
4041 static PyObject *__pyx_tuple__151;
4042 static PyObject *__pyx_tuple__153;
4043 static PyObject *__pyx_tuple__155;
4044 static PyObject *__pyx_tuple__157;
4045 static PyObject *__pyx_tuple__159;
4046 static PyObject *__pyx_tuple__161;
4047 static PyObject *__pyx_tuple__163;
4048 static PyObject *__pyx_tuple__165;
4049 static PyObject *__pyx_tuple__167;
4050 static PyObject *__pyx_tuple__169;
4051 static PyObject *__pyx_tuple__171;
4052 static PyObject *__pyx_tuple__173;
4053 static PyObject *__pyx_tuple__175;
4054 static PyObject *__pyx_tuple__177;
4055 static PyObject *__pyx_tuple__179;
4056 static PyObject *__pyx_tuple__181;
4057 static PyObject *__pyx_tuple__183;
4058 static PyObject *__pyx_tuple__185;
4059 static PyObject *__pyx_tuple__187;
4060 static PyObject *__pyx_tuple__189;
4061 static PyObject *__pyx_tuple__191;
4062 static PyObject *__pyx_tuple__193;
4063 static PyObject *__pyx_tuple__195;
4064 static PyObject *__pyx_tuple__197;
4065 static PyObject *__pyx_tuple__199;
4066 static PyObject *__pyx_tuple__201;
4067 static PyObject *__pyx_tuple__202;
4068 static PyObject *__pyx_tuple__204;
4069 static PyObject *__pyx_tuple__205;
4070 static PyObject *__pyx_tuple__207;
4071 static PyObject *__pyx_tuple__209;
4072 static PyObject *__pyx_tuple__211;
4073 static PyObject *__pyx_tuple__213;
4074 static PyObject *__pyx_tuple__215;
4075 static PyObject *__pyx_tuple__217;
4076 static PyObject *__pyx_tuple__218;
4077 static PyObject *__pyx_tuple__220;
4078 static PyObject *__pyx_tuple__222;
4079 static PyObject *__pyx_tuple__224;
4080 static PyObject *__pyx_tuple__226;
4081 static PyObject *__pyx_tuple__227;
4082 static PyObject *__pyx_tuple__229;
4083 static PyObject *__pyx_tuple__231;
4084 static PyObject *__pyx_tuple__233;
4085 static PyObject *__pyx_tuple__234;
4086 static PyObject *__pyx_tuple__236;
4087 static PyObject *__pyx_tuple__238;
4088 static PyObject *__pyx_tuple__240;
4089 static PyObject *__pyx_tuple__242;
4090 static PyObject *__pyx_codeobj__64;
4091 static PyObject *__pyx_codeobj__67;
4092 static PyObject *__pyx_codeobj__70;
4093 static PyObject *__pyx_codeobj__73;
4094 static PyObject *__pyx_codeobj__76;
4095 static PyObject *__pyx_codeobj__79;
4096 static PyObject *__pyx_codeobj__81;
4097 static PyObject *__pyx_codeobj__83;
4098 static PyObject *__pyx_codeobj__85;
4099 static PyObject *__pyx_codeobj__87;
4100 static PyObject *__pyx_codeobj__89;
4101 static PyObject *__pyx_codeobj__91;
4102 static PyObject *__pyx_codeobj__93;
4103 static PyObject *__pyx_codeobj__95;
4104 static PyObject *__pyx_codeobj__97;
4105 static PyObject *__pyx_codeobj__99;
4106 static PyObject *__pyx_codeobj__101;
4107 static PyObject *__pyx_codeobj__103;
4108 static PyObject *__pyx_codeobj__106;
4109 static PyObject *__pyx_codeobj__108;
4110 static PyObject *__pyx_codeobj__111;
4111 static PyObject *__pyx_codeobj__114;
4112 static PyObject *__pyx_codeobj__117;
4113 static PyObject *__pyx_codeobj__119;
4114 static PyObject *__pyx_codeobj__122;
4115 static PyObject *__pyx_codeobj__124;
4116 static PyObject *__pyx_codeobj__126;
4117 static PyObject *__pyx_codeobj__128;
4118 static PyObject *__pyx_codeobj__130;
4119 static PyObject *__pyx_codeobj__133;
4120 static PyObject *__pyx_codeobj__135;
4121 static PyObject *__pyx_codeobj__137;
4122 static PyObject *__pyx_codeobj__139;
4123 static PyObject *__pyx_codeobj__142;
4124 static PyObject *__pyx_codeobj__144;
4125 static PyObject *__pyx_codeobj__146;
4126 static PyObject *__pyx_codeobj__148;
4127 static PyObject *__pyx_codeobj__150;
4128 static PyObject *__pyx_codeobj__152;
4129 static PyObject *__pyx_codeobj__154;
4130 static PyObject *__pyx_codeobj__156;
4131 static PyObject *__pyx_codeobj__158;
4132 static PyObject *__pyx_codeobj__160;
4133 static PyObject *__pyx_codeobj__162;
4134 static PyObject *__pyx_codeobj__164;
4135 static PyObject *__pyx_codeobj__166;
4136 static PyObject *__pyx_codeobj__168;
4137 static PyObject *__pyx_codeobj__170;
4138 static PyObject *__pyx_codeobj__172;
4139 static PyObject *__pyx_codeobj__174;
4140 static PyObject *__pyx_codeobj__176;
4141 static PyObject *__pyx_codeobj__178;
4142 static PyObject *__pyx_codeobj__180;
4143 static PyObject *__pyx_codeobj__182;
4144 static PyObject *__pyx_codeobj__184;
4145 static PyObject *__pyx_codeobj__186;
4146 static PyObject *__pyx_codeobj__188;
4147 static PyObject *__pyx_codeobj__190;
4148 static PyObject *__pyx_codeobj__192;
4149 static PyObject *__pyx_codeobj__194;
4150 static PyObject *__pyx_codeobj__196;
4151 static PyObject *__pyx_codeobj__198;
4152 static PyObject *__pyx_codeobj__200;
4153 static PyObject *__pyx_codeobj__203;
4154 static PyObject *__pyx_codeobj__206;
4155 static PyObject *__pyx_codeobj__208;
4156 static PyObject *__pyx_codeobj__210;
4157 static PyObject *__pyx_codeobj__212;
4158 static PyObject *__pyx_codeobj__214;
4159 static PyObject *__pyx_codeobj__216;
4160 static PyObject *__pyx_codeobj__219;
4161 static PyObject *__pyx_codeobj__221;
4162 static PyObject *__pyx_codeobj__223;
4163 static PyObject *__pyx_codeobj__225;
4164 static PyObject *__pyx_codeobj__228;
4165 static PyObject *__pyx_codeobj__230;
4166 static PyObject *__pyx_codeobj__232;
4167 static PyObject *__pyx_codeobj__235;
4168 static PyObject *__pyx_codeobj__237;
4169 static PyObject *__pyx_codeobj__239;
4170 static PyObject *__pyx_codeobj__241;
4171 static PyObject *__pyx_codeobj__243;
4172 /* Late includes */
4173 
4174 /* "WaveTools.py":67
4175  *
4176  *
4177  * def fastcos_test(phase,sinus=False): # <<<<<<<<<<<<<<
4178  * """Fast cosine function with Taylor approximation - TO BE USED FOR TESTING"
4179  * Parameters
4180  */
4181 
4182 /* Python wrapper */
4183 static PyObject *__pyx_pw_9WaveTools_1fastcos_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4184 static char __pyx_doc_9WaveTools_fastcos_test[] = "Fast cosine function with Taylor approximation - TO BE USED FOR TESTING\"\n Parameters\n ----------\n phase : double\n Phase \n sinus : bool\n Switch for cosine or sine calculation\n \n Returns\n --------\n cos(phi) or sin(phi)\n\n ";
4185 static PyMethodDef __pyx_mdef_9WaveTools_1fastcos_test = {"fastcos_test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_1fastcos_test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_fastcos_test};
4186 static PyObject *__pyx_pw_9WaveTools_1fastcos_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4187  PyObject *__pyx_v_phase = 0;
4188  PyObject *__pyx_v_sinus = 0;
4189  PyObject *__pyx_r = 0;
4190  __Pyx_RefNannyDeclarations
4191  __Pyx_RefNannySetupContext("fastcos_test (wrapper)", 0);
4192  {
4193  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_phase,&__pyx_n_s_sinus,0};
4194  PyObject* values[2] = {0,0};
4195  values[1] = ((PyObject *)((PyObject *)Py_False));
4196  if (unlikely(__pyx_kwds)) {
4197  Py_ssize_t kw_args;
4198  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4199  switch (pos_args) {
4200  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4201  CYTHON_FALLTHROUGH;
4202  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4203  CYTHON_FALLTHROUGH;
4204  case 0: break;
4205  default: goto __pyx_L5_argtuple_error;
4206  }
4207  kw_args = PyDict_Size(__pyx_kwds);
4208  switch (pos_args) {
4209  case 0:
4210  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phase)) != 0)) kw_args--;
4211  else goto __pyx_L5_argtuple_error;
4212  CYTHON_FALLTHROUGH;
4213  case 1:
4214  if (kw_args > 0) {
4215  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sinus);
4216  if (value) { values[1] = value; kw_args--; }
4217  }
4218  }
4219  if (unlikely(kw_args > 0)) {
4220  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastcos_test") < 0)) __PYX_ERR(0, 67, __pyx_L3_error)
4221  }
4222  } else {
4223  switch (PyTuple_GET_SIZE(__pyx_args)) {
4224  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4225  CYTHON_FALLTHROUGH;
4226  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4227  break;
4228  default: goto __pyx_L5_argtuple_error;
4229  }
4230  }
4231  __pyx_v_phase = values[0];
4232  __pyx_v_sinus = values[1];
4233  }
4234  goto __pyx_L4_argument_unpacking_done;
4235  __pyx_L5_argtuple_error:;
4236  __Pyx_RaiseArgtupleInvalid("fastcos_test", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 67, __pyx_L3_error)
4237  __pyx_L3_error:;
4238  __Pyx_AddTraceback("WaveTools.fastcos_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4239  __Pyx_RefNannyFinishContext();
4240  return NULL;
4241  __pyx_L4_argument_unpacking_done:;
4242  __pyx_r = __pyx_pf_9WaveTools_fastcos_test(__pyx_self, __pyx_v_phase, __pyx_v_sinus);
4243 
4244  /* function exit code */
4245  __Pyx_RefNannyFinishContext();
4246  return __pyx_r;
4247 }
4248 
4249 static PyObject *__pyx_pf_9WaveTools_fastcos_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_phase, PyObject *__pyx_v_sinus) {
4250  PyObject *__pyx_r = NULL;
4251  __Pyx_RefNannyDeclarations
4252  int __pyx_t_1;
4253  PyObject *__pyx_t_2 = NULL;
4254  PyObject *__pyx_t_3 = NULL;
4255  PyObject *__pyx_t_4 = NULL;
4256  PyObject *__pyx_t_5 = NULL;
4257  int __pyx_t_6;
4258  PyObject *__pyx_t_7 = NULL;
4259  double __pyx_t_8;
4260  __Pyx_RefNannySetupContext("fastcos_test", 0);
4261  __Pyx_INCREF(__pyx_v_phase);
4262 
4263  /* "WaveTools.py":81
4264  *
4265  * """
4266  * if(sinus): # <<<<<<<<<<<<<<
4267  * phase = old_div(np.pi,2.) - phase
4268  * return fastcos(phase,True)
4269  */
4270  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_sinus); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
4271  if (__pyx_t_1) {
4272 
4273  /* "WaveTools.py":82
4274  * """
4275  * if(sinus):
4276  * phase = old_div(np.pi,2.) - phase # <<<<<<<<<<<<<<
4277  * return fastcos(phase,True)
4278  * def fastcosh_test(k,Z,fast=True):
4279  */
4280  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
4281  __Pyx_GOTREF(__pyx_t_3);
4282  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
4283  __Pyx_GOTREF(__pyx_t_4);
4284  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
4285  __Pyx_GOTREF(__pyx_t_5);
4286  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4287  __pyx_t_4 = NULL;
4288  __pyx_t_6 = 0;
4289  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4290  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4291  if (likely(__pyx_t_4)) {
4292  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4293  __Pyx_INCREF(__pyx_t_4);
4294  __Pyx_INCREF(function);
4295  __Pyx_DECREF_SET(__pyx_t_3, function);
4296  __pyx_t_6 = 1;
4297  }
4298  }
4299  #if CYTHON_FAST_PYCALL
4300  if (PyFunction_Check(__pyx_t_3)) {
4301  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_float_2_};
4302  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
4303  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4304  __Pyx_GOTREF(__pyx_t_2);
4305  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4306  } else
4307  #endif
4308  #if CYTHON_FAST_PYCCALL
4309  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4310  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_5, __pyx_float_2_};
4311  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
4312  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4313  __Pyx_GOTREF(__pyx_t_2);
4314  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4315  } else
4316  #endif
4317  {
4318  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
4319  __Pyx_GOTREF(__pyx_t_7);
4320  if (__pyx_t_4) {
4321  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
4322  }
4323  __Pyx_GIVEREF(__pyx_t_5);
4324  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
4325  __Pyx_INCREF(__pyx_float_2_);
4326  __Pyx_GIVEREF(__pyx_float_2_);
4327  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_float_2_);
4328  __pyx_t_5 = 0;
4329  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
4330  __Pyx_GOTREF(__pyx_t_2);
4331  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4332  }
4333  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4334  __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_phase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
4335  __Pyx_GOTREF(__pyx_t_3);
4336  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4337  __Pyx_DECREF_SET(__pyx_v_phase, __pyx_t_3);
4338  __pyx_t_3 = 0;
4339 
4340  /* "WaveTools.py":81
4341  *
4342  * """
4343  * if(sinus): # <<<<<<<<<<<<<<
4344  * phase = old_div(np.pi,2.) - phase
4345  * return fastcos(phase,True)
4346  */
4347  }
4348 
4349  /* "WaveTools.py":83
4350  * if(sinus):
4351  * phase = old_div(np.pi,2.) - phase
4352  * return fastcos(phase,True) # <<<<<<<<<<<<<<
4353  * def fastcosh_test(k,Z,fast=True):
4354  * """Fast hyperbolic cosine function with Taylor approximation - TO BE USED FOR TESTING"
4355  */
4356  __Pyx_XDECREF(__pyx_r);
4357  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L1_error)
4358  __pyx_t_3 = PyFloat_FromDouble(proteus::fastcos(__pyx_t_8, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
4359  __Pyx_GOTREF(__pyx_t_3);
4360  __pyx_r = __pyx_t_3;
4361  __pyx_t_3 = 0;
4362  goto __pyx_L0;
4363 
4364  /* "WaveTools.py":67
4365  *
4366  *
4367  * def fastcos_test(phase,sinus=False): # <<<<<<<<<<<<<<
4368  * """Fast cosine function with Taylor approximation - TO BE USED FOR TESTING"
4369  * Parameters
4370  */
4371 
4372  /* function exit code */
4373  __pyx_L1_error:;
4374  __Pyx_XDECREF(__pyx_t_2);
4375  __Pyx_XDECREF(__pyx_t_3);
4376  __Pyx_XDECREF(__pyx_t_4);
4377  __Pyx_XDECREF(__pyx_t_5);
4378  __Pyx_XDECREF(__pyx_t_7);
4379  __Pyx_AddTraceback("WaveTools.fastcos_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4380  __pyx_r = NULL;
4381  __pyx_L0:;
4382  __Pyx_XDECREF(__pyx_v_phase);
4383  __Pyx_XGIVEREF(__pyx_r);
4384  __Pyx_RefNannyFinishContext();
4385  return __pyx_r;
4386 }
4387 
4388 /* "WaveTools.py":84
4389  * phase = old_div(np.pi,2.) - phase
4390  * return fastcos(phase,True)
4391  * def fastcosh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
4392  * """Fast hyperbolic cosine function with Taylor approximation - TO BE USED FOR TESTING"
4393  * Parameters
4394  */
4395 
4396 /* Python wrapper */
4397 static PyObject *__pyx_pw_9WaveTools_3fastcosh_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4398 static char __pyx_doc_9WaveTools_2fastcosh_test[] = "Fast hyperbolic cosine function with Taylor approximation - TO BE USED FOR TESTING\"\n Parameters\n ----------\n k : double\n Wavenumber\n Z : double\n Z coordinate\n Returns\n --------\n cosh(k*z)\n\n ";
4399 static PyMethodDef __pyx_mdef_9WaveTools_3fastcosh_test = {"fastcosh_test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_3fastcosh_test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_2fastcosh_test};
4400 static PyObject *__pyx_pw_9WaveTools_3fastcosh_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4401  PyObject *__pyx_v_k = 0;
4402  PyObject *__pyx_v_Z = 0;
4403  PyObject *__pyx_v_fast = 0;
4404  PyObject *__pyx_r = 0;
4405  __Pyx_RefNannyDeclarations
4406  __Pyx_RefNannySetupContext("fastcosh_test (wrapper)", 0);
4407  {
4408  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_Z,&__pyx_n_s_fast,0};
4409  PyObject* values[3] = {0,0,0};
4410  values[2] = ((PyObject *)((PyObject *)Py_True));
4411  if (unlikely(__pyx_kwds)) {
4412  Py_ssize_t kw_args;
4413  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4414  switch (pos_args) {
4415  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4416  CYTHON_FALLTHROUGH;
4417  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4418  CYTHON_FALLTHROUGH;
4419  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4420  CYTHON_FALLTHROUGH;
4421  case 0: break;
4422  default: goto __pyx_L5_argtuple_error;
4423  }
4424  kw_args = PyDict_Size(__pyx_kwds);
4425  switch (pos_args) {
4426  case 0:
4427  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
4428  else goto __pyx_L5_argtuple_error;
4429  CYTHON_FALLTHROUGH;
4430  case 1:
4431  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Z)) != 0)) kw_args--;
4432  else {
4433  __Pyx_RaiseArgtupleInvalid("fastcosh_test", 0, 2, 3, 1); __PYX_ERR(0, 84, __pyx_L3_error)
4434  }
4435  CYTHON_FALLTHROUGH;
4436  case 2:
4437  if (kw_args > 0) {
4438  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
4439  if (value) { values[2] = value; kw_args--; }
4440  }
4441  }
4442  if (unlikely(kw_args > 0)) {
4443  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastcosh_test") < 0)) __PYX_ERR(0, 84, __pyx_L3_error)
4444  }
4445  } else {
4446  switch (PyTuple_GET_SIZE(__pyx_args)) {
4447  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4448  CYTHON_FALLTHROUGH;
4449  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4450  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4451  break;
4452  default: goto __pyx_L5_argtuple_error;
4453  }
4454  }
4455  __pyx_v_k = values[0];
4456  __pyx_v_Z = values[1];
4457  __pyx_v_fast = values[2];
4458  }
4459  goto __pyx_L4_argument_unpacking_done;
4460  __pyx_L5_argtuple_error:;
4461  __Pyx_RaiseArgtupleInvalid("fastcosh_test", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 84, __pyx_L3_error)
4462  __pyx_L3_error:;
4463  __Pyx_AddTraceback("WaveTools.fastcosh_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4464  __Pyx_RefNannyFinishContext();
4465  return NULL;
4466  __pyx_L4_argument_unpacking_done:;
4467  __pyx_r = __pyx_pf_9WaveTools_2fastcosh_test(__pyx_self, __pyx_v_k, __pyx_v_Z, __pyx_v_fast);
4468 
4469  /* function exit code */
4470  __Pyx_RefNannyFinishContext();
4471  return __pyx_r;
4472 }
4473 
4474 static PyObject *__pyx_pf_9WaveTools_2fastcosh_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_fast) {
4475  double __pyx_v_xx[2];
4476  PyObject *__pyx_r = NULL;
4477  __Pyx_RefNannyDeclarations
4478  double __pyx_t_1;
4479  double __pyx_t_2;
4480  bool __pyx_t_3;
4481  PyObject *__pyx_t_4 = NULL;
4482  __Pyx_RefNannySetupContext("fastcosh_test", 0);
4483 
4484  /* "WaveTools.py":98
4485  * """
4486  * cython.declare(xx=cython.double[2])
4487  * fastcosh(xx,k,Z,fast) # <<<<<<<<<<<<<<
4488  * return xx[0]
4489  * def fastsinh_test(k,Z,fast=True):
4490  */
4491  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_k); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
4492  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_Z); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
4493  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
4494  (void)(proteus::fastcosh(__pyx_v_xx, __pyx_t_1, __pyx_t_2, __pyx_t_3));
4495 
4496  /* "WaveTools.py":99
4497  * cython.declare(xx=cython.double[2])
4498  * fastcosh(xx,k,Z,fast)
4499  * return xx[0] # <<<<<<<<<<<<<<
4500  * def fastsinh_test(k,Z,fast=True):
4501  * """Fast hyperbolic sine function with Taylor approximation - TO BE USED FOR TESTING"
4502  */
4503  __Pyx_XDECREF(__pyx_r);
4504  __pyx_t_4 = PyFloat_FromDouble((__pyx_v_xx[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
4505  __Pyx_GOTREF(__pyx_t_4);
4506  __pyx_r = __pyx_t_4;
4507  __pyx_t_4 = 0;
4508  goto __pyx_L0;
4509 
4510  /* "WaveTools.py":84
4511  * phase = old_div(np.pi,2.) - phase
4512  * return fastcos(phase,True)
4513  * def fastcosh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
4514  * """Fast hyperbolic cosine function with Taylor approximation - TO BE USED FOR TESTING"
4515  * Parameters
4516  */
4517 
4518  /* function exit code */
4519  __pyx_L1_error:;
4520  __Pyx_XDECREF(__pyx_t_4);
4521  __Pyx_AddTraceback("WaveTools.fastcosh_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4522  __pyx_r = NULL;
4523  __pyx_L0:;
4524  __Pyx_XGIVEREF(__pyx_r);
4525  __Pyx_RefNannyFinishContext();
4526  return __pyx_r;
4527 }
4528 
4529 /* "WaveTools.py":100
4530  * fastcosh(xx,k,Z,fast)
4531  * return xx[0]
4532  * def fastsinh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
4533  * """Fast hyperbolic sine function with Taylor approximation - TO BE USED FOR TESTING"
4534  * Parameters
4535  */
4536 
4537 /* Python wrapper */
4538 static PyObject *__pyx_pw_9WaveTools_5fastsinh_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4539 static char __pyx_doc_9WaveTools_4fastsinh_test[] = "Fast hyperbolic sine function with Taylor approximation - TO BE USED FOR TESTING\"\n Parameters\n ----------\n k : double\n Wavenumber\n Z : double\n Z coordinate\n Returns\n --------\n sinh(k*z)\n\n ";
4540 static PyMethodDef __pyx_mdef_9WaveTools_5fastsinh_test = {"fastsinh_test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_5fastsinh_test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_4fastsinh_test};
4541 static PyObject *__pyx_pw_9WaveTools_5fastsinh_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4542  PyObject *__pyx_v_k = 0;
4543  PyObject *__pyx_v_Z = 0;
4544  PyObject *__pyx_v_fast = 0;
4545  PyObject *__pyx_r = 0;
4546  __Pyx_RefNannyDeclarations
4547  __Pyx_RefNannySetupContext("fastsinh_test (wrapper)", 0);
4548  {
4549  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_Z,&__pyx_n_s_fast,0};
4550  PyObject* values[3] = {0,0,0};
4551  values[2] = ((PyObject *)((PyObject *)Py_True));
4552  if (unlikely(__pyx_kwds)) {
4553  Py_ssize_t kw_args;
4554  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4555  switch (pos_args) {
4556  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4557  CYTHON_FALLTHROUGH;
4558  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4559  CYTHON_FALLTHROUGH;
4560  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4561  CYTHON_FALLTHROUGH;
4562  case 0: break;
4563  default: goto __pyx_L5_argtuple_error;
4564  }
4565  kw_args = PyDict_Size(__pyx_kwds);
4566  switch (pos_args) {
4567  case 0:
4568  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
4569  else goto __pyx_L5_argtuple_error;
4570  CYTHON_FALLTHROUGH;
4571  case 1:
4572  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Z)) != 0)) kw_args--;
4573  else {
4574  __Pyx_RaiseArgtupleInvalid("fastsinh_test", 0, 2, 3, 1); __PYX_ERR(0, 100, __pyx_L3_error)
4575  }
4576  CYTHON_FALLTHROUGH;
4577  case 2:
4578  if (kw_args > 0) {
4579  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
4580  if (value) { values[2] = value; kw_args--; }
4581  }
4582  }
4583  if (unlikely(kw_args > 0)) {
4584  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fastsinh_test") < 0)) __PYX_ERR(0, 100, __pyx_L3_error)
4585  }
4586  } else {
4587  switch (PyTuple_GET_SIZE(__pyx_args)) {
4588  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4589  CYTHON_FALLTHROUGH;
4590  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4591  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4592  break;
4593  default: goto __pyx_L5_argtuple_error;
4594  }
4595  }
4596  __pyx_v_k = values[0];
4597  __pyx_v_Z = values[1];
4598  __pyx_v_fast = values[2];
4599  }
4600  goto __pyx_L4_argument_unpacking_done;
4601  __pyx_L5_argtuple_error:;
4602  __Pyx_RaiseArgtupleInvalid("fastsinh_test", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 100, __pyx_L3_error)
4603  __pyx_L3_error:;
4604  __Pyx_AddTraceback("WaveTools.fastsinh_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4605  __Pyx_RefNannyFinishContext();
4606  return NULL;
4607  __pyx_L4_argument_unpacking_done:;
4608  __pyx_r = __pyx_pf_9WaveTools_4fastsinh_test(__pyx_self, __pyx_v_k, __pyx_v_Z, __pyx_v_fast);
4609 
4610  /* function exit code */
4611  __Pyx_RefNannyFinishContext();
4612  return __pyx_r;
4613 }
4614 
4615 static PyObject *__pyx_pf_9WaveTools_4fastsinh_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_fast) {
4616  double __pyx_v_xx[2];
4617  PyObject *__pyx_r = NULL;
4618  __Pyx_RefNannyDeclarations
4619  double __pyx_t_1;
4620  double __pyx_t_2;
4621  bool __pyx_t_3;
4622  PyObject *__pyx_t_4 = NULL;
4623  __Pyx_RefNannySetupContext("fastsinh_test", 0);
4624 
4625  /* "WaveTools.py":114
4626  * """
4627  * cython.declare(xx=cython.double[2])
4628  * fastcosh(xx,k,Z,fast) # <<<<<<<<<<<<<<
4629  * return xx[1]
4630  *
4631  */
4632  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_k); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4633  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_Z); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4634  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
4635  (void)(proteus::fastcosh(__pyx_v_xx, __pyx_t_1, __pyx_t_2, __pyx_t_3));
4636 
4637  /* "WaveTools.py":115
4638  * cython.declare(xx=cython.double[2])
4639  * fastcosh(xx,k,Z,fast)
4640  * return xx[1] # <<<<<<<<<<<<<<
4641  *
4642  *
4643  */
4644  __Pyx_XDECREF(__pyx_r);
4645  __pyx_t_4 = PyFloat_FromDouble((__pyx_v_xx[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
4646  __Pyx_GOTREF(__pyx_t_4);
4647  __pyx_r = __pyx_t_4;
4648  __pyx_t_4 = 0;
4649  goto __pyx_L0;
4650 
4651  /* "WaveTools.py":100
4652  * fastcosh(xx,k,Z,fast)
4653  * return xx[0]
4654  * def fastsinh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
4655  * """Fast hyperbolic sine function with Taylor approximation - TO BE USED FOR TESTING"
4656  * Parameters
4657  */
4658 
4659  /* function exit code */
4660  __pyx_L1_error:;
4661  __Pyx_XDECREF(__pyx_t_4);
4662  __Pyx_AddTraceback("WaveTools.fastsinh_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4663  __pyx_r = NULL;
4664  __pyx_L0:;
4665  __Pyx_XGIVEREF(__pyx_r);
4666  __Pyx_RefNannyFinishContext();
4667  return __pyx_r;
4668 }
4669 
4670 /* "WaveTools.py":118
4671  *
4672  *
4673  * def coshkzd_test(k,Z,d, fast=True): # <<<<<<<<<<<<<<
4674  * """Calculation of u horizontal profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
4675  * and hyp trig relation cosh(a+b) = cosha*coshb+sinha*sinhb
4676  */
4677 
4678 /* Python wrapper */
4679 static PyObject *__pyx_pw_9WaveTools_7coshkzd_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4680 static char __pyx_doc_9WaveTools_6coshkzd_test[] = "Calculation of u horizontal profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons\n and hyp trig relation cosh(a+b) = cosha*coshb+sinha*sinhb\n Parameters\n ----------\n ----------\n k : double\n Wavenumber\n Z : double\n Z coordinate\n d : double\n depth\n Returns\n --------\n cosh(k*(z+d))/sinh(kd) for Z>-d/2, 0 otherwise\n\n ";
4681 static PyMethodDef __pyx_mdef_9WaveTools_7coshkzd_test = {"coshkzd_test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7coshkzd_test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_6coshkzd_test};
4682 static PyObject *__pyx_pw_9WaveTools_7coshkzd_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4683  PyObject *__pyx_v_k = 0;
4684  PyObject *__pyx_v_Z = 0;
4685  PyObject *__pyx_v_d = 0;
4686  PyObject *__pyx_v_fast = 0;
4687  PyObject *__pyx_r = 0;
4688  __Pyx_RefNannyDeclarations
4689  __Pyx_RefNannySetupContext("coshkzd_test (wrapper)", 0);
4690  {
4691  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_Z,&__pyx_n_s_d,&__pyx_n_s_fast,0};
4692  PyObject* values[4] = {0,0,0,0};
4693  values[3] = ((PyObject *)((PyObject *)Py_True));
4694  if (unlikely(__pyx_kwds)) {
4695  Py_ssize_t kw_args;
4696  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4697  switch (pos_args) {
4698  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4699  CYTHON_FALLTHROUGH;
4700  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4701  CYTHON_FALLTHROUGH;
4702  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4703  CYTHON_FALLTHROUGH;
4704  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4705  CYTHON_FALLTHROUGH;
4706  case 0: break;
4707  default: goto __pyx_L5_argtuple_error;
4708  }
4709  kw_args = PyDict_Size(__pyx_kwds);
4710  switch (pos_args) {
4711  case 0:
4712  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
4713  else goto __pyx_L5_argtuple_error;
4714  CYTHON_FALLTHROUGH;
4715  case 1:
4716  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Z)) != 0)) kw_args--;
4717  else {
4718  __Pyx_RaiseArgtupleInvalid("coshkzd_test", 0, 3, 4, 1); __PYX_ERR(0, 118, __pyx_L3_error)
4719  }
4720  CYTHON_FALLTHROUGH;
4721  case 2:
4722  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
4723  else {
4724  __Pyx_RaiseArgtupleInvalid("coshkzd_test", 0, 3, 4, 2); __PYX_ERR(0, 118, __pyx_L3_error)
4725  }
4726  CYTHON_FALLTHROUGH;
4727  case 3:
4728  if (kw_args > 0) {
4729  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
4730  if (value) { values[3] = value; kw_args--; }
4731  }
4732  }
4733  if (unlikely(kw_args > 0)) {
4734  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "coshkzd_test") < 0)) __PYX_ERR(0, 118, __pyx_L3_error)
4735  }
4736  } else {
4737  switch (PyTuple_GET_SIZE(__pyx_args)) {
4738  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4739  CYTHON_FALLTHROUGH;
4740  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4741  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4742  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4743  break;
4744  default: goto __pyx_L5_argtuple_error;
4745  }
4746  }
4747  __pyx_v_k = values[0];
4748  __pyx_v_Z = values[1];
4749  __pyx_v_d = values[2];
4750  __pyx_v_fast = values[3];
4751  }
4752  goto __pyx_L4_argument_unpacking_done;
4753  __pyx_L5_argtuple_error:;
4754  __Pyx_RaiseArgtupleInvalid("coshkzd_test", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error)
4755  __pyx_L3_error:;
4756  __Pyx_AddTraceback("WaveTools.coshkzd_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
4757  __Pyx_RefNannyFinishContext();
4758  return NULL;
4759  __pyx_L4_argument_unpacking_done:;
4760  __pyx_r = __pyx_pf_9WaveTools_6coshkzd_test(__pyx_self, __pyx_v_k, __pyx_v_Z, __pyx_v_d, __pyx_v_fast);
4761 
4762  /* function exit code */
4763  __Pyx_RefNannyFinishContext();
4764  return __pyx_r;
4765 }
4766 
4767 static PyObject *__pyx_pf_9WaveTools_6coshkzd_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_d, PyObject *__pyx_v_fast) {
4768  PyObject *__pyx_r = NULL;
4769  __Pyx_RefNannyDeclarations
4770  PyObject *__pyx_t_1 = NULL;
4771  PyObject *__pyx_t_2 = NULL;
4772  PyObject *__pyx_t_3 = NULL;
4773  PyObject *__pyx_t_4 = NULL;
4774  int __pyx_t_5;
4775  PyObject *__pyx_t_6 = NULL;
4776  int __pyx_t_7;
4777  PyObject *__pyx_t_8 = NULL;
4778  PyObject *__pyx_t_9 = NULL;
4779  __Pyx_RefNannySetupContext("coshkzd_test", 0);
4780 
4781  /* "WaveTools.py":135
4782  *
4783  * """
4784  * if (Z > old_div(-d,2.)): # <<<<<<<<<<<<<<
4785  * return old_div(fastcosh_test(k,Z,fast), np.tanh(k*d)) + fastsinh_test(k,Z,fast)
4786  * else:
4787  */
4788  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
4789  __Pyx_GOTREF(__pyx_t_2);
4790  __pyx_t_3 = PyNumber_Negative(__pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
4791  __Pyx_GOTREF(__pyx_t_3);
4792  __pyx_t_4 = NULL;
4793  __pyx_t_5 = 0;
4794  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4795  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
4796  if (likely(__pyx_t_4)) {
4797  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4798  __Pyx_INCREF(__pyx_t_4);
4799  __Pyx_INCREF(function);
4800  __Pyx_DECREF_SET(__pyx_t_2, function);
4801  __pyx_t_5 = 1;
4802  }
4803  }
4804  #if CYTHON_FAST_PYCALL
4805  if (PyFunction_Check(__pyx_t_2)) {
4806  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_float_2_};
4807  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
4808  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4809  __Pyx_GOTREF(__pyx_t_1);
4810  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4811  } else
4812  #endif
4813  #if CYTHON_FAST_PYCCALL
4814  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
4815  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_float_2_};
4816  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
4817  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4818  __Pyx_GOTREF(__pyx_t_1);
4819  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4820  } else
4821  #endif
4822  {
4823  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
4824  __Pyx_GOTREF(__pyx_t_6);
4825  if (__pyx_t_4) {
4826  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
4827  }
4828  __Pyx_GIVEREF(__pyx_t_3);
4829  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
4830  __Pyx_INCREF(__pyx_float_2_);
4831  __Pyx_GIVEREF(__pyx_float_2_);
4832  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_float_2_);
4833  __pyx_t_3 = 0;
4834  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
4835  __Pyx_GOTREF(__pyx_t_1);
4836  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4837  }
4838  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4839  __pyx_t_2 = PyObject_RichCompare(__pyx_v_Z, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
4840  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4841  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
4842  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4843  if (__pyx_t_7) {
4844 
4845  /* "WaveTools.py":136
4846  * """
4847  * if (Z > old_div(-d,2.)):
4848  * return old_div(fastcosh_test(k,Z,fast), np.tanh(k*d)) + fastsinh_test(k,Z,fast) # <<<<<<<<<<<<<<
4849  * else:
4850  * return 0.
4851  */
4852  __Pyx_XDECREF(__pyx_r);
4853  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
4854  __Pyx_GOTREF(__pyx_t_1);
4855  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_fastcosh_test); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
4856  __Pyx_GOTREF(__pyx_t_3);
4857  __pyx_t_4 = NULL;
4858  __pyx_t_5 = 0;
4859  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4860  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4861  if (likely(__pyx_t_4)) {
4862  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4863  __Pyx_INCREF(__pyx_t_4);
4864  __Pyx_INCREF(function);
4865  __Pyx_DECREF_SET(__pyx_t_3, function);
4866  __pyx_t_5 = 1;
4867  }
4868  }
4869  #if CYTHON_FAST_PYCALL
4870  if (PyFunction_Check(__pyx_t_3)) {
4871  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
4872  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
4873  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4874  __Pyx_GOTREF(__pyx_t_6);
4875  } else
4876  #endif
4877  #if CYTHON_FAST_PYCCALL
4878  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4879  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
4880  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
4881  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4882  __Pyx_GOTREF(__pyx_t_6);
4883  } else
4884  #endif
4885  {
4886  __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error)
4887  __Pyx_GOTREF(__pyx_t_8);
4888  if (__pyx_t_4) {
4889  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
4890  }
4891  __Pyx_INCREF(__pyx_v_k);
4892  __Pyx_GIVEREF(__pyx_v_k);
4893  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_v_k);
4894  __Pyx_INCREF(__pyx_v_Z);
4895  __Pyx_GIVEREF(__pyx_v_Z);
4896  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_Z);
4897  __Pyx_INCREF(__pyx_v_fast);
4898  __Pyx_GIVEREF(__pyx_v_fast);
4899  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_v_fast);
4900  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
4901  __Pyx_GOTREF(__pyx_t_6);
4902  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4903  }
4904  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4905  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error)
4906  __Pyx_GOTREF(__pyx_t_8);
4907  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_tanh); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error)
4908  __Pyx_GOTREF(__pyx_t_4);
4909  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4910  __pyx_t_8 = PyNumber_Multiply(__pyx_v_k, __pyx_v_d); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error)
4911  __Pyx_GOTREF(__pyx_t_8);
4912  __pyx_t_9 = NULL;
4913  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4914  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
4915  if (likely(__pyx_t_9)) {
4916  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4917  __Pyx_INCREF(__pyx_t_9);
4918  __Pyx_INCREF(function);
4919  __Pyx_DECREF_SET(__pyx_t_4, function);
4920  }
4921  }
4922  __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8);
4923  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4924  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4925  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
4926  __Pyx_GOTREF(__pyx_t_3);
4927  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4928  __pyx_t_4 = NULL;
4929  __pyx_t_5 = 0;
4930  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
4931  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
4932  if (likely(__pyx_t_4)) {
4933  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
4934  __Pyx_INCREF(__pyx_t_4);
4935  __Pyx_INCREF(function);
4936  __Pyx_DECREF_SET(__pyx_t_1, function);
4937  __pyx_t_5 = 1;
4938  }
4939  }
4940  #if CYTHON_FAST_PYCALL
4941  if (PyFunction_Check(__pyx_t_1)) {
4942  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_3};
4943  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
4944  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4945  __Pyx_GOTREF(__pyx_t_2);
4946  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4947  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4948  } else
4949  #endif
4950  #if CYTHON_FAST_PYCCALL
4951  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
4952  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_3};
4953  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
4954  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4955  __Pyx_GOTREF(__pyx_t_2);
4956  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4957  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4958  } else
4959  #endif
4960  {
4961  __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error)
4962  __Pyx_GOTREF(__pyx_t_8);
4963  if (__pyx_t_4) {
4964  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
4965  }
4966  __Pyx_GIVEREF(__pyx_t_6);
4967  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_6);
4968  __Pyx_GIVEREF(__pyx_t_3);
4969  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_3);
4970  __pyx_t_6 = 0;
4971  __pyx_t_3 = 0;
4972  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
4973  __Pyx_GOTREF(__pyx_t_2);
4974  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4975  }
4976  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4977  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_fastsinh_test); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error)
4978  __Pyx_GOTREF(__pyx_t_8);
4979  __pyx_t_3 = NULL;
4980  __pyx_t_5 = 0;
4981  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
4982  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
4983  if (likely(__pyx_t_3)) {
4984  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4985  __Pyx_INCREF(__pyx_t_3);
4986  __Pyx_INCREF(function);
4987  __Pyx_DECREF_SET(__pyx_t_8, function);
4988  __pyx_t_5 = 1;
4989  }
4990  }
4991  #if CYTHON_FAST_PYCALL
4992  if (PyFunction_Check(__pyx_t_8)) {
4993  PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
4994  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
4995  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4996  __Pyx_GOTREF(__pyx_t_1);
4997  } else
4998  #endif
4999  #if CYTHON_FAST_PYCCALL
5000  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
5001  PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
5002  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
5003  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5004  __Pyx_GOTREF(__pyx_t_1);
5005  } else
5006  #endif
5007  {
5008  __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
5009  __Pyx_GOTREF(__pyx_t_6);
5010  if (__pyx_t_3) {
5011  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
5012  }
5013  __Pyx_INCREF(__pyx_v_k);
5014  __Pyx_GIVEREF(__pyx_v_k);
5015  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_k);
5016  __Pyx_INCREF(__pyx_v_Z);
5017  __Pyx_GIVEREF(__pyx_v_Z);
5018  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_Z);
5019  __Pyx_INCREF(__pyx_v_fast);
5020  __Pyx_GIVEREF(__pyx_v_fast);
5021  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_fast);
5022  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
5023  __Pyx_GOTREF(__pyx_t_1);
5024  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5025  }
5026  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5027  __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error)
5028  __Pyx_GOTREF(__pyx_t_8);
5029  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5030  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5031  __pyx_r = __pyx_t_8;
5032  __pyx_t_8 = 0;
5033  goto __pyx_L0;
5034 
5035  /* "WaveTools.py":135
5036  *
5037  * """
5038  * if (Z > old_div(-d,2.)): # <<<<<<<<<<<<<<
5039  * return old_div(fastcosh_test(k,Z,fast), np.tanh(k*d)) + fastsinh_test(k,Z,fast)
5040  * else:
5041  */
5042  }
5043 
5044  /* "WaveTools.py":138
5045  * return old_div(fastcosh_test(k,Z,fast), np.tanh(k*d)) + fastsinh_test(k,Z,fast)
5046  * else:
5047  * return 0. # <<<<<<<<<<<<<<
5048  *
5049  * def sinhkzd_test(k,Z,d,fast=True):
5050  */
5051  /*else*/ {
5052  __Pyx_XDECREF(__pyx_r);
5053  __Pyx_INCREF(__pyx_float_0_);
5054  __pyx_r = __pyx_float_0_;
5055  goto __pyx_L0;
5056  }
5057 
5058  /* "WaveTools.py":118
5059  *
5060  *
5061  * def coshkzd_test(k,Z,d, fast=True): # <<<<<<<<<<<<<<
5062  * """Calculation of u horizontal profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
5063  * and hyp trig relation cosh(a+b) = cosha*coshb+sinha*sinhb
5064  */
5065 
5066  /* function exit code */
5067  __pyx_L1_error:;
5068  __Pyx_XDECREF(__pyx_t_1);
5069  __Pyx_XDECREF(__pyx_t_2);
5070  __Pyx_XDECREF(__pyx_t_3);
5071  __Pyx_XDECREF(__pyx_t_4);
5072  __Pyx_XDECREF(__pyx_t_6);
5073  __Pyx_XDECREF(__pyx_t_8);
5074  __Pyx_XDECREF(__pyx_t_9);
5075  __Pyx_AddTraceback("WaveTools.coshkzd_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
5076  __pyx_r = NULL;
5077  __pyx_L0:;
5078  __Pyx_XGIVEREF(__pyx_r);
5079  __Pyx_RefNannyFinishContext();
5080  return __pyx_r;
5081 }
5082 
5083 /* "WaveTools.py":140
5084  * return 0.
5085  *
5086  * def sinhkzd_test(k,Z,d,fast=True): # <<<<<<<<<<<<<<
5087  * """Calculation of v vertical profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
5088  * and hyp trig relation sinh(a+b) = sinha*coshb+cosha*sinhb
5089  */
5090 
5091 /* Python wrapper */
5092 static PyObject *__pyx_pw_9WaveTools_9sinhkzd_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5093 static char __pyx_doc_9WaveTools_8sinhkzd_test[] = "Calculation of v vertical profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons\n and hyp trig relation sinh(a+b) = sinha*coshb+cosha*sinhb\n Parameters\n ----------\n ----------\n k : double\n Wavenumber\n Z : double\n Z coordinate\n d : double\n depth\n Returns\n --------\n sinh(k*(z+d))/sinh(kd) for Z>-d/2, 0 otherwise\n\n ";
5094 static PyMethodDef __pyx_mdef_9WaveTools_9sinhkzd_test = {"sinhkzd_test", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_9sinhkzd_test, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_8sinhkzd_test};
5095 static PyObject *__pyx_pw_9WaveTools_9sinhkzd_test(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5096  PyObject *__pyx_v_k = 0;
5097  PyObject *__pyx_v_Z = 0;
5098  PyObject *__pyx_v_d = 0;
5099  PyObject *__pyx_v_fast = 0;
5100  PyObject *__pyx_r = 0;
5101  __Pyx_RefNannyDeclarations
5102  __Pyx_RefNannySetupContext("sinhkzd_test (wrapper)", 0);
5103  {
5104  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_Z,&__pyx_n_s_d,&__pyx_n_s_fast,0};
5105  PyObject* values[4] = {0,0,0,0};
5106  values[3] = ((PyObject *)((PyObject *)Py_True));
5107  if (unlikely(__pyx_kwds)) {
5108  Py_ssize_t kw_args;
5109  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5110  switch (pos_args) {
5111  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5112  CYTHON_FALLTHROUGH;
5113  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5114  CYTHON_FALLTHROUGH;
5115  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5116  CYTHON_FALLTHROUGH;
5117  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5118  CYTHON_FALLTHROUGH;
5119  case 0: break;
5120  default: goto __pyx_L5_argtuple_error;
5121  }
5122  kw_args = PyDict_Size(__pyx_kwds);
5123  switch (pos_args) {
5124  case 0:
5125  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
5126  else goto __pyx_L5_argtuple_error;
5127  CYTHON_FALLTHROUGH;
5128  case 1:
5129  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Z)) != 0)) kw_args--;
5130  else {
5131  __Pyx_RaiseArgtupleInvalid("sinhkzd_test", 0, 3, 4, 1); __PYX_ERR(0, 140, __pyx_L3_error)
5132  }
5133  CYTHON_FALLTHROUGH;
5134  case 2:
5135  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
5136  else {
5137  __Pyx_RaiseArgtupleInvalid("sinhkzd_test", 0, 3, 4, 2); __PYX_ERR(0, 140, __pyx_L3_error)
5138  }
5139  CYTHON_FALLTHROUGH;
5140  case 3:
5141  if (kw_args > 0) {
5142  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
5143  if (value) { values[3] = value; kw_args--; }
5144  }
5145  }
5146  if (unlikely(kw_args > 0)) {
5147  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sinhkzd_test") < 0)) __PYX_ERR(0, 140, __pyx_L3_error)
5148  }
5149  } else {
5150  switch (PyTuple_GET_SIZE(__pyx_args)) {
5151  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5152  CYTHON_FALLTHROUGH;
5153  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5154  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5155  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5156  break;
5157  default: goto __pyx_L5_argtuple_error;
5158  }
5159  }
5160  __pyx_v_k = values[0];
5161  __pyx_v_Z = values[1];
5162  __pyx_v_d = values[2];
5163  __pyx_v_fast = values[3];
5164  }
5165  goto __pyx_L4_argument_unpacking_done;
5166  __pyx_L5_argtuple_error:;
5167  __Pyx_RaiseArgtupleInvalid("sinhkzd_test", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 140, __pyx_L3_error)
5168  __pyx_L3_error:;
5169  __Pyx_AddTraceback("WaveTools.sinhkzd_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
5170  __Pyx_RefNannyFinishContext();
5171  return NULL;
5172  __pyx_L4_argument_unpacking_done:;
5173  __pyx_r = __pyx_pf_9WaveTools_8sinhkzd_test(__pyx_self, __pyx_v_k, __pyx_v_Z, __pyx_v_d, __pyx_v_fast);
5174 
5175  /* function exit code */
5176  __Pyx_RefNannyFinishContext();
5177  return __pyx_r;
5178 }
5179 
5180 static PyObject *__pyx_pf_9WaveTools_8sinhkzd_test(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_k, PyObject *__pyx_v_Z, PyObject *__pyx_v_d, PyObject *__pyx_v_fast) {
5181  PyObject *__pyx_r = NULL;
5182  __Pyx_RefNannyDeclarations
5183  PyObject *__pyx_t_1 = NULL;
5184  PyObject *__pyx_t_2 = NULL;
5185  PyObject *__pyx_t_3 = NULL;
5186  PyObject *__pyx_t_4 = NULL;
5187  int __pyx_t_5;
5188  PyObject *__pyx_t_6 = NULL;
5189  int __pyx_t_7;
5190  PyObject *__pyx_t_8 = NULL;
5191  PyObject *__pyx_t_9 = NULL;
5192  PyObject *__pyx_t_10 = NULL;
5193  __Pyx_RefNannySetupContext("sinhkzd_test", 0);
5194 
5195  /* "WaveTools.py":158
5196  * """
5197  *
5198  * if (Z> old_div(-d,2.)): # <<<<<<<<<<<<<<
5199  * return fastcosh_test(k,Z,fast) + old_div(fastsinh_test(k,Z,fast), np.tanh(k*d))
5200  * else:
5201  */
5202  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
5203  __Pyx_GOTREF(__pyx_t_2);
5204  __pyx_t_3 = PyNumber_Negative(__pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
5205  __Pyx_GOTREF(__pyx_t_3);
5206  __pyx_t_4 = NULL;
5207  __pyx_t_5 = 0;
5208  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
5209  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
5210  if (likely(__pyx_t_4)) {
5211  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5212  __Pyx_INCREF(__pyx_t_4);
5213  __Pyx_INCREF(function);
5214  __Pyx_DECREF_SET(__pyx_t_2, function);
5215  __pyx_t_5 = 1;
5216  }
5217  }
5218  #if CYTHON_FAST_PYCALL
5219  if (PyFunction_Check(__pyx_t_2)) {
5220  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_float_2_};
5221  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
5222  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5223  __Pyx_GOTREF(__pyx_t_1);
5224  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5225  } else
5226  #endif
5227  #if CYTHON_FAST_PYCCALL
5228  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5229  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_float_2_};
5230  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
5231  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5232  __Pyx_GOTREF(__pyx_t_1);
5233  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5234  } else
5235  #endif
5236  {
5237  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
5238  __Pyx_GOTREF(__pyx_t_6);
5239  if (__pyx_t_4) {
5240  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
5241  }
5242  __Pyx_GIVEREF(__pyx_t_3);
5243  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
5244  __Pyx_INCREF(__pyx_float_2_);
5245  __Pyx_GIVEREF(__pyx_float_2_);
5246  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_float_2_);
5247  __pyx_t_3 = 0;
5248  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
5249  __Pyx_GOTREF(__pyx_t_1);
5250  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5251  }
5252  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5253  __pyx_t_2 = PyObject_RichCompare(__pyx_v_Z, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
5254  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5255  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
5256  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5257  if (__pyx_t_7) {
5258 
5259  /* "WaveTools.py":159
5260  *
5261  * if (Z> old_div(-d,2.)):
5262  * return fastcosh_test(k,Z,fast) + old_div(fastsinh_test(k,Z,fast), np.tanh(k*d)) # <<<<<<<<<<<<<<
5263  * else:
5264  * return 0.
5265  */
5266  __Pyx_XDECREF(__pyx_r);
5267  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_fastcosh_test); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
5268  __Pyx_GOTREF(__pyx_t_1);
5269  __pyx_t_6 = NULL;
5270  __pyx_t_5 = 0;
5271  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
5272  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
5273  if (likely(__pyx_t_6)) {
5274  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
5275  __Pyx_INCREF(__pyx_t_6);
5276  __Pyx_INCREF(function);
5277  __Pyx_DECREF_SET(__pyx_t_1, function);
5278  __pyx_t_5 = 1;
5279  }
5280  }
5281  #if CYTHON_FAST_PYCALL
5282  if (PyFunction_Check(__pyx_t_1)) {
5283  PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
5284  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
5285  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5286  __Pyx_GOTREF(__pyx_t_2);
5287  } else
5288  #endif
5289  #if CYTHON_FAST_PYCCALL
5290  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
5291  PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
5292  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
5293  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5294  __Pyx_GOTREF(__pyx_t_2);
5295  } else
5296  #endif
5297  {
5298  __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
5299  __Pyx_GOTREF(__pyx_t_3);
5300  if (__pyx_t_6) {
5301  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
5302  }
5303  __Pyx_INCREF(__pyx_v_k);
5304  __Pyx_GIVEREF(__pyx_v_k);
5305  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_k);
5306  __Pyx_INCREF(__pyx_v_Z);
5307  __Pyx_GIVEREF(__pyx_v_Z);
5308  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_Z);
5309  __Pyx_INCREF(__pyx_v_fast);
5310  __Pyx_GIVEREF(__pyx_v_fast);
5311  PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_v_fast);
5312  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
5313  __Pyx_GOTREF(__pyx_t_2);
5314  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5315  }
5316  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5317  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
5318  __Pyx_GOTREF(__pyx_t_3);
5319  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fastsinh_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
5320  __Pyx_GOTREF(__pyx_t_4);
5321  __pyx_t_8 = NULL;
5322  __pyx_t_5 = 0;
5323  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5324  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
5325  if (likely(__pyx_t_8)) {
5326  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5327  __Pyx_INCREF(__pyx_t_8);
5328  __Pyx_INCREF(function);
5329  __Pyx_DECREF_SET(__pyx_t_4, function);
5330  __pyx_t_5 = 1;
5331  }
5332  }
5333  #if CYTHON_FAST_PYCALL
5334  if (PyFunction_Check(__pyx_t_4)) {
5335  PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
5336  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
5337  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5338  __Pyx_GOTREF(__pyx_t_6);
5339  } else
5340  #endif
5341  #if CYTHON_FAST_PYCCALL
5342  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
5343  PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_k, __pyx_v_Z, __pyx_v_fast};
5344  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
5345  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5346  __Pyx_GOTREF(__pyx_t_6);
5347  } else
5348  #endif
5349  {
5350  __pyx_t_9 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error)
5351  __Pyx_GOTREF(__pyx_t_9);
5352  if (__pyx_t_8) {
5353  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
5354  }
5355  __Pyx_INCREF(__pyx_v_k);
5356  __Pyx_GIVEREF(__pyx_v_k);
5357  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_v_k);
5358  __Pyx_INCREF(__pyx_v_Z);
5359  __Pyx_GIVEREF(__pyx_v_Z);
5360  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_Z);
5361  __Pyx_INCREF(__pyx_v_fast);
5362  __Pyx_GIVEREF(__pyx_v_fast);
5363  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, __pyx_v_fast);
5364  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
5365  __Pyx_GOTREF(__pyx_t_6);
5366  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5367  }
5368  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5369  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error)
5370  __Pyx_GOTREF(__pyx_t_9);
5371  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_tanh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error)
5372  __Pyx_GOTREF(__pyx_t_8);
5373  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5374  __pyx_t_9 = PyNumber_Multiply(__pyx_v_k, __pyx_v_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error)
5375  __Pyx_GOTREF(__pyx_t_9);
5376  __pyx_t_10 = NULL;
5377  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5378  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
5379  if (likely(__pyx_t_10)) {
5380  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5381  __Pyx_INCREF(__pyx_t_10);
5382  __Pyx_INCREF(function);
5383  __Pyx_DECREF_SET(__pyx_t_8, function);
5384  }
5385  }
5386  __pyx_t_4 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
5387  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5388  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5389  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
5390  __Pyx_GOTREF(__pyx_t_4);
5391  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5392  __pyx_t_8 = NULL;
5393  __pyx_t_5 = 0;
5394  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5395  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
5396  if (likely(__pyx_t_8)) {
5397  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5398  __Pyx_INCREF(__pyx_t_8);
5399  __Pyx_INCREF(function);
5400  __Pyx_DECREF_SET(__pyx_t_3, function);
5401  __pyx_t_5 = 1;
5402  }
5403  }
5404  #if CYTHON_FAST_PYCALL
5405  if (PyFunction_Check(__pyx_t_3)) {
5406  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_4};
5407  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
5408  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5409  __Pyx_GOTREF(__pyx_t_1);
5410  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5411  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5412  } else
5413  #endif
5414  #if CYTHON_FAST_PYCCALL
5415  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
5416  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_4};
5417  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
5418  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5419  __Pyx_GOTREF(__pyx_t_1);
5420  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5421  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5422  } else
5423  #endif
5424  {
5425  __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error)
5426  __Pyx_GOTREF(__pyx_t_9);
5427  if (__pyx_t_8) {
5428  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
5429  }
5430  __Pyx_GIVEREF(__pyx_t_6);
5431  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_6);
5432  __Pyx_GIVEREF(__pyx_t_4);
5433  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_4);
5434  __pyx_t_6 = 0;
5435  __pyx_t_4 = 0;
5436  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
5437  __Pyx_GOTREF(__pyx_t_1);
5438  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5439  }
5440  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5441  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
5442  __Pyx_GOTREF(__pyx_t_3);
5443  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5444  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5445  __pyx_r = __pyx_t_3;
5446  __pyx_t_3 = 0;
5447  goto __pyx_L0;
5448 
5449  /* "WaveTools.py":158
5450  * """
5451  *
5452  * if (Z> old_div(-d,2.)): # <<<<<<<<<<<<<<
5453  * return fastcosh_test(k,Z,fast) + old_div(fastsinh_test(k,Z,fast), np.tanh(k*d))
5454  * else:
5455  */
5456  }
5457 
5458  /* "WaveTools.py":161
5459  * return fastcosh_test(k,Z,fast) + old_div(fastsinh_test(k,Z,fast), np.tanh(k*d))
5460  * else:
5461  * return 0. # <<<<<<<<<<<<<<
5462  *
5463  * def loadExistingFunction(funcName, validFunctions):
5464  */
5465  /*else*/ {
5466  __Pyx_XDECREF(__pyx_r);
5467  __Pyx_INCREF(__pyx_float_0_);
5468  __pyx_r = __pyx_float_0_;
5469  goto __pyx_L0;
5470  }
5471 
5472  /* "WaveTools.py":140
5473  * return 0.
5474  *
5475  * def sinhkzd_test(k,Z,d,fast=True): # <<<<<<<<<<<<<<
5476  * """Calculation of v vertical profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
5477  * and hyp trig relation sinh(a+b) = sinha*coshb+cosha*sinhb
5478  */
5479 
5480  /* function exit code */
5481  __pyx_L1_error:;
5482  __Pyx_XDECREF(__pyx_t_1);
5483  __Pyx_XDECREF(__pyx_t_2);
5484  __Pyx_XDECREF(__pyx_t_3);
5485  __Pyx_XDECREF(__pyx_t_4);
5486  __Pyx_XDECREF(__pyx_t_6);
5487  __Pyx_XDECREF(__pyx_t_8);
5488  __Pyx_XDECREF(__pyx_t_9);
5489  __Pyx_XDECREF(__pyx_t_10);
5490  __Pyx_AddTraceback("WaveTools.sinhkzd_test", __pyx_clineno, __pyx_lineno, __pyx_filename);
5491  __pyx_r = NULL;
5492  __pyx_L0:;
5493  __Pyx_XGIVEREF(__pyx_r);
5494  __Pyx_RefNannyFinishContext();
5495  return __pyx_r;
5496 }
5497 
5498 /* "WaveTools.py":163
5499  * return 0.
5500  *
5501  * def loadExistingFunction(funcName, validFunctions): # <<<<<<<<<<<<<<
5502  * """Checks if a function name is known function and returns it
5503  *
5504  */
5505 
5506 /* Python wrapper */
5507 static PyObject *__pyx_pw_9WaveTools_11loadExistingFunction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5508 static char __pyx_doc_9WaveTools_10loadExistingFunction[] = "Checks if a function name is known function and returns it\n\n Checks if a function name is present in a list of functions.\n If True, the function is returned. If False, raises SystemExit.\n\n Parameters\n ----------\n funcName : string\n Function name\n validFunctions : List[function]\n List of valid functions (list of objects)\n\n Returns\n --------\n function\n\n Raises\n ---------\n SystemExit\n\n\n ";
5509 static PyMethodDef __pyx_mdef_9WaveTools_11loadExistingFunction = {"loadExistingFunction", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11loadExistingFunction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10loadExistingFunction};
5510 static PyObject *__pyx_pw_9WaveTools_11loadExistingFunction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5511  PyObject *__pyx_v_funcName = 0;
5512  PyObject *__pyx_v_validFunctions = 0;
5513  PyObject *__pyx_r = 0;
5514  __Pyx_RefNannyDeclarations
5515  __Pyx_RefNannySetupContext("loadExistingFunction (wrapper)", 0);
5516  {
5517  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_funcName,&__pyx_n_s_validFunctions,0};
5518  PyObject* values[2] = {0,0};
5519  if (unlikely(__pyx_kwds)) {
5520  Py_ssize_t kw_args;
5521  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5522  switch (pos_args) {
5523  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5524  CYTHON_FALLTHROUGH;
5525  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5526  CYTHON_FALLTHROUGH;
5527  case 0: break;
5528  default: goto __pyx_L5_argtuple_error;
5529  }
5530  kw_args = PyDict_Size(__pyx_kwds);
5531  switch (pos_args) {
5532  case 0:
5533  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_funcName)) != 0)) kw_args--;
5534  else goto __pyx_L5_argtuple_error;
5535  CYTHON_FALLTHROUGH;
5536  case 1:
5537  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_validFunctions)) != 0)) kw_args--;
5538  else {
5539  __Pyx_RaiseArgtupleInvalid("loadExistingFunction", 1, 2, 2, 1); __PYX_ERR(0, 163, __pyx_L3_error)
5540  }
5541  }
5542  if (unlikely(kw_args > 0)) {
5543  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "loadExistingFunction") < 0)) __PYX_ERR(0, 163, __pyx_L3_error)
5544  }
5545  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5546  goto __pyx_L5_argtuple_error;
5547  } else {
5548  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5549  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5550  }
5551  __pyx_v_funcName = values[0];
5552  __pyx_v_validFunctions = values[1];
5553  }
5554  goto __pyx_L4_argument_unpacking_done;
5555  __pyx_L5_argtuple_error:;
5556  __Pyx_RaiseArgtupleInvalid("loadExistingFunction", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 163, __pyx_L3_error)
5557  __pyx_L3_error:;
5558  __Pyx_AddTraceback("WaveTools.loadExistingFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
5559  __Pyx_RefNannyFinishContext();
5560  return NULL;
5561  __pyx_L4_argument_unpacking_done:;
5562  __pyx_r = __pyx_pf_9WaveTools_10loadExistingFunction(__pyx_self, __pyx_v_funcName, __pyx_v_validFunctions);
5563 
5564  /* function exit code */
5565  __Pyx_RefNannyFinishContext();
5566  return __pyx_r;
5567 }
5568 
5569 static PyObject *__pyx_pf_9WaveTools_10loadExistingFunction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcName, PyObject *__pyx_v_validFunctions) {
5570  PyObject *__pyx_v_funcNames = NULL;
5571  PyObject *__pyx_v_func = NULL;
5572  PyObject *__pyx_v_func_ret = NULL;
5573  PyObject *__pyx_r = NULL;
5574  __Pyx_RefNannyDeclarations
5575  PyObject *__pyx_t_1 = NULL;
5576  Py_ssize_t __pyx_t_2;
5577  PyObject *(*__pyx_t_3)(PyObject *);
5578  PyObject *__pyx_t_4 = NULL;
5579  int __pyx_t_5;
5580  PyObject *__pyx_t_6 = NULL;
5581  int __pyx_t_7;
5582  int __pyx_t_8;
5583  PyObject *__pyx_t_9 = NULL;
5584  __Pyx_RefNannySetupContext("loadExistingFunction", 0);
5585 
5586  /* "WaveTools.py":186
5587  *
5588  * """
5589  * funcNames = [] # <<<<<<<<<<<<<<
5590  * for func in validFunctions:
5591  * funcNames.append(func.__name__)
5592  */
5593  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error)
5594  __Pyx_GOTREF(__pyx_t_1);
5595  __pyx_v_funcNames = ((PyObject*)__pyx_t_1);
5596  __pyx_t_1 = 0;
5597 
5598  /* "WaveTools.py":187
5599  * """
5600  * funcNames = []
5601  * for func in validFunctions: # <<<<<<<<<<<<<<
5602  * funcNames.append(func.__name__)
5603  * if func.__name__ == funcName:
5604  */
5605  if (likely(PyList_CheckExact(__pyx_v_validFunctions)) || PyTuple_CheckExact(__pyx_v_validFunctions)) {
5606  __pyx_t_1 = __pyx_v_validFunctions; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5607  __pyx_t_3 = NULL;
5608  } else {
5609  __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_validFunctions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
5610  __Pyx_GOTREF(__pyx_t_1);
5611  __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
5612  }
5613  for (;;) {
5614  if (likely(!__pyx_t_3)) {
5615  if (likely(PyList_CheckExact(__pyx_t_1))) {
5616  if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
5617  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5618  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
5619  #else
5620  __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
5621  __Pyx_GOTREF(__pyx_t_4);
5622  #endif
5623  } else {
5624  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5625  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5626  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
5627  #else
5628  __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
5629  __Pyx_GOTREF(__pyx_t_4);
5630  #endif
5631  }
5632  } else {
5633  __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5634  if (unlikely(!__pyx_t_4)) {
5635  PyObject* exc_type = PyErr_Occurred();
5636  if (exc_type) {
5637  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5638  else __PYX_ERR(0, 187, __pyx_L1_error)
5639  }
5640  break;
5641  }
5642  __Pyx_GOTREF(__pyx_t_4);
5643  }
5644  __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_4);
5645  __pyx_t_4 = 0;
5646 
5647  /* "WaveTools.py":188
5648  * funcNames = []
5649  * for func in validFunctions:
5650  * funcNames.append(func.__name__) # <<<<<<<<<<<<<<
5651  * if func.__name__ == funcName:
5652  * func_ret = func
5653  */
5654  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
5655  __Pyx_GOTREF(__pyx_t_4);
5656  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_funcNames, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 188, __pyx_L1_error)
5657  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5658 
5659  /* "WaveTools.py":189
5660  * for func in validFunctions:
5661  * funcNames.append(func.__name__)
5662  * if func.__name__ == funcName: # <<<<<<<<<<<<<<
5663  * func_ret = func
5664  * if funcName not in funcNames:
5665  */
5666  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
5667  __Pyx_GOTREF(__pyx_t_4);
5668  __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_v_funcName, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error)
5669  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5670  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
5671  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5672  if (__pyx_t_7) {
5673 
5674  /* "WaveTools.py":190
5675  * funcNames.append(func.__name__)
5676  * if func.__name__ == funcName:
5677  * func_ret = func # <<<<<<<<<<<<<<
5678  * if funcName not in funcNames:
5679  * logEvent("ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s" %(funcName,funcNames), level=0)
5680  */
5681  __Pyx_INCREF(__pyx_v_func);
5682  __Pyx_XDECREF_SET(__pyx_v_func_ret, __pyx_v_func);
5683 
5684  /* "WaveTools.py":189
5685  * for func in validFunctions:
5686  * funcNames.append(func.__name__)
5687  * if func.__name__ == funcName: # <<<<<<<<<<<<<<
5688  * func_ret = func
5689  * if funcName not in funcNames:
5690  */
5691  }
5692 
5693  /* "WaveTools.py":187
5694  * """
5695  * funcNames = []
5696  * for func in validFunctions: # <<<<<<<<<<<<<<
5697  * funcNames.append(func.__name__)
5698  * if func.__name__ == funcName:
5699  */
5700  }
5701  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5702 
5703  /* "WaveTools.py":191
5704  * if func.__name__ == funcName:
5705  * func_ret = func
5706  * if funcName not in funcNames: # <<<<<<<<<<<<<<
5707  * logEvent("ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s" %(funcName,funcNames), level=0)
5708  * sys.exit(1)
5709  */
5710  __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_v_funcName, __pyx_v_funcNames, Py_NE)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
5711  __pyx_t_8 = (__pyx_t_7 != 0);
5712  if (__pyx_t_8) {
5713 
5714  /* "WaveTools.py":192
5715  * func_ret = func
5716  * if funcName not in funcNames:
5717  * logEvent("ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s" %(funcName,funcNames), level=0) # <<<<<<<<<<<<<<
5718  * sys.exit(1)
5719  * return func_ret
5720  */
5721  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
5722  __Pyx_GOTREF(__pyx_t_1);
5723  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
5724  __Pyx_GOTREF(__pyx_t_6);
5725  __Pyx_INCREF(__pyx_v_funcName);
5726  __Pyx_GIVEREF(__pyx_v_funcName);
5727  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_funcName);
5728  __Pyx_INCREF(__pyx_v_funcNames);
5729  __Pyx_GIVEREF(__pyx_v_funcNames);
5730  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_funcNames);
5731  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_ERROR_Wavetools_py_Wrong_functio, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
5732  __Pyx_GOTREF(__pyx_t_4);
5733  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5734  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 192, __pyx_L1_error)
5735  __Pyx_GOTREF(__pyx_t_6);
5736  __Pyx_GIVEREF(__pyx_t_4);
5737  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
5738  __pyx_t_4 = 0;
5739  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
5740  __Pyx_GOTREF(__pyx_t_4);
5741  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 192, __pyx_L1_error)
5742  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error)
5743  __Pyx_GOTREF(__pyx_t_9);
5744  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5745  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5746  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5747  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5748 
5749  /* "WaveTools.py":193
5750  * if funcName not in funcNames:
5751  * logEvent("ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s" %(funcName,funcNames), level=0)
5752  * sys.exit(1) # <<<<<<<<<<<<<<
5753  * return func_ret
5754  *
5755  */
5756  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
5757  __Pyx_GOTREF(__pyx_t_4);
5758  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error)
5759  __Pyx_GOTREF(__pyx_t_6);
5760  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5761  __pyx_t_4 = NULL;
5762  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5763  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
5764  if (likely(__pyx_t_4)) {
5765  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5766  __Pyx_INCREF(__pyx_t_4);
5767  __Pyx_INCREF(function);
5768  __Pyx_DECREF_SET(__pyx_t_6, function);
5769  }
5770  }
5771  __pyx_t_9 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
5772  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5773  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 193, __pyx_L1_error)
5774  __Pyx_GOTREF(__pyx_t_9);
5775  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5776  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5777 
5778  /* "WaveTools.py":191
5779  * if func.__name__ == funcName:
5780  * func_ret = func
5781  * if funcName not in funcNames: # <<<<<<<<<<<<<<
5782  * logEvent("ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s" %(funcName,funcNames), level=0)
5783  * sys.exit(1)
5784  */
5785  }
5786 
5787  /* "WaveTools.py":194
5788  * logEvent("ERROR! Wavetools.py: Wrong function type (%s) given: Valid wavetypes are %s" %(funcName,funcNames), level=0)
5789  * sys.exit(1)
5790  * return func_ret # <<<<<<<<<<<<<<
5791  *
5792  *
5793  */
5794  __Pyx_XDECREF(__pyx_r);
5795  if (unlikely(!__pyx_v_func_ret)) { __Pyx_RaiseUnboundLocalError("func_ret"); __PYX_ERR(0, 194, __pyx_L1_error) }
5796  __Pyx_INCREF(__pyx_v_func_ret);
5797  __pyx_r = __pyx_v_func_ret;
5798  goto __pyx_L0;
5799 
5800  /* "WaveTools.py":163
5801  * return 0.
5802  *
5803  * def loadExistingFunction(funcName, validFunctions): # <<<<<<<<<<<<<<
5804  * """Checks if a function name is known function and returns it
5805  *
5806  */
5807 
5808  /* function exit code */
5809  __pyx_L1_error:;
5810  __Pyx_XDECREF(__pyx_t_1);
5811  __Pyx_XDECREF(__pyx_t_4);
5812  __Pyx_XDECREF(__pyx_t_6);
5813  __Pyx_XDECREF(__pyx_t_9);
5814  __Pyx_AddTraceback("WaveTools.loadExistingFunction", __pyx_clineno, __pyx_lineno, __pyx_filename);
5815  __pyx_r = NULL;
5816  __pyx_L0:;
5817  __Pyx_XDECREF(__pyx_v_funcNames);
5818  __Pyx_XDECREF(__pyx_v_func);
5819  __Pyx_XDECREF(__pyx_v_func_ret);
5820  __Pyx_XGIVEREF(__pyx_r);
5821  __Pyx_RefNannyFinishContext();
5822  return __pyx_r;
5823 }
5824 
5825 /* "WaveTools.py":198
5826  *
5827  *
5828  * def setVertDir(g): # <<<<<<<<<<<<<<
5829  * """ Returns the unit vector for the vertical direction
5830  *
5831  */
5832 
5833 /* Python wrapper */
5834 static PyObject *__pyx_pw_9WaveTools_13setVertDir(PyObject *__pyx_self, PyObject *__pyx_v_g); /*proto*/
5835 static char __pyx_doc_9WaveTools_12setVertDir[] = " Returns the unit vector for the vertical direction\n\n The vertical direction is opposite to the gravity direction\n\n Parameters\n ----------\n g : numpy.ndarray\n Gravitational acceleration vector (must have 3 components)\n\n Returns\n --------\n numpy.ndarray\n\n ";
5836 static PyMethodDef __pyx_mdef_9WaveTools_13setVertDir = {"setVertDir", (PyCFunction)__pyx_pw_9WaveTools_13setVertDir, METH_O, __pyx_doc_9WaveTools_12setVertDir};
5837 static PyObject *__pyx_pw_9WaveTools_13setVertDir(PyObject *__pyx_self, PyObject *__pyx_v_g) {
5838  PyObject *__pyx_r = 0;
5839  __Pyx_RefNannyDeclarations
5840  __Pyx_RefNannySetupContext("setVertDir (wrapper)", 0);
5841  __pyx_r = __pyx_pf_9WaveTools_12setVertDir(__pyx_self, ((PyObject *)__pyx_v_g));
5842 
5843  /* function exit code */
5844  __Pyx_RefNannyFinishContext();
5845  return __pyx_r;
5846 }
5847 
5848 static PyObject *__pyx_pf_9WaveTools_12setVertDir(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_g) {
5849  PyObject *__pyx_r = NULL;
5850  __Pyx_RefNannyDeclarations
5851  PyObject *__pyx_t_1 = NULL;
5852  PyObject *__pyx_t_2 = NULL;
5853  PyObject *__pyx_t_3 = NULL;
5854  PyObject *__pyx_t_4 = NULL;
5855  PyObject *__pyx_t_5 = NULL;
5856  PyObject *__pyx_t_6 = NULL;
5857  PyObject *__pyx_t_7 = NULL;
5858  double __pyx_t_8;
5859  int __pyx_t_9;
5860  __Pyx_RefNannySetupContext("setVertDir", 0);
5861 
5862  /* "WaveTools.py":213
5863  *
5864  * """
5865  * return -np.array(old_div(g,(sqrt(g[0]**2 + g[1]**2 + g[2]**2)))) # <<<<<<<<<<<<<<
5866  *
5867  *
5868  */
5869  __Pyx_XDECREF(__pyx_r);
5870  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
5871  __Pyx_GOTREF(__pyx_t_2);
5872  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
5873  __Pyx_GOTREF(__pyx_t_3);
5874  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5875  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_old_div); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
5876  __Pyx_GOTREF(__pyx_t_4);
5877  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_g, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
5878  __Pyx_GOTREF(__pyx_t_5);
5879  __pyx_t_6 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
5880  __Pyx_GOTREF(__pyx_t_6);
5881  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5882  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_g, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
5883  __Pyx_GOTREF(__pyx_t_5);
5884  __pyx_t_7 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
5885  __Pyx_GOTREF(__pyx_t_7);
5886  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5887  __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
5888  __Pyx_GOTREF(__pyx_t_5);
5889  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5890  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5891  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_g, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
5892  __Pyx_GOTREF(__pyx_t_7);
5893  __pyx_t_6 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
5894  __Pyx_GOTREF(__pyx_t_6);
5895  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5896  __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
5897  __Pyx_GOTREF(__pyx_t_7);
5898  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5899  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5900  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5901  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5902  __pyx_t_7 = PyFloat_FromDouble(sqrt(__pyx_t_8)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
5903  __Pyx_GOTREF(__pyx_t_7);
5904  __pyx_t_6 = NULL;
5905  __pyx_t_9 = 0;
5906  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5907  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
5908  if (likely(__pyx_t_6)) {
5909  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5910  __Pyx_INCREF(__pyx_t_6);
5911  __Pyx_INCREF(function);
5912  __Pyx_DECREF_SET(__pyx_t_4, function);
5913  __pyx_t_9 = 1;
5914  }
5915  }
5916  #if CYTHON_FAST_PYCALL
5917  if (PyFunction_Check(__pyx_t_4)) {
5918  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_t_7};
5919  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
5920  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5921  __Pyx_GOTREF(__pyx_t_2);
5922  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5923  } else
5924  #endif
5925  #if CYTHON_FAST_PYCCALL
5926  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
5927  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_t_7};
5928  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
5929  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5930  __Pyx_GOTREF(__pyx_t_2);
5931  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5932  } else
5933  #endif
5934  {
5935  __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
5936  __Pyx_GOTREF(__pyx_t_5);
5937  if (__pyx_t_6) {
5938  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
5939  }
5940  __Pyx_INCREF(__pyx_v_g);
5941  __Pyx_GIVEREF(__pyx_v_g);
5942  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_v_g);
5943  __Pyx_GIVEREF(__pyx_t_7);
5944  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_7);
5945  __pyx_t_7 = 0;
5946  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
5947  __Pyx_GOTREF(__pyx_t_2);
5948  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5949  }
5950  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5951  __pyx_t_4 = NULL;
5952  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5953  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5954  if (likely(__pyx_t_4)) {
5955  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5956  __Pyx_INCREF(__pyx_t_4);
5957  __Pyx_INCREF(function);
5958  __Pyx_DECREF_SET(__pyx_t_3, function);
5959  }
5960  }
5961  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
5962  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5963  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5964  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
5965  __Pyx_GOTREF(__pyx_t_1);
5966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5967  __pyx_t_3 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
5968  __Pyx_GOTREF(__pyx_t_3);
5969  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5970  __pyx_r = __pyx_t_3;
5971  __pyx_t_3 = 0;
5972  goto __pyx_L0;
5973 
5974  /* "WaveTools.py":198
5975  *
5976  *
5977  * def setVertDir(g): # <<<<<<<<<<<<<<
5978  * """ Returns the unit vector for the vertical direction
5979  *
5980  */
5981 
5982  /* function exit code */
5983  __pyx_L1_error:;
5984  __Pyx_XDECREF(__pyx_t_1);
5985  __Pyx_XDECREF(__pyx_t_2);
5986  __Pyx_XDECREF(__pyx_t_3);
5987  __Pyx_XDECREF(__pyx_t_4);
5988  __Pyx_XDECREF(__pyx_t_5);
5989  __Pyx_XDECREF(__pyx_t_6);
5990  __Pyx_XDECREF(__pyx_t_7);
5991  __Pyx_AddTraceback("WaveTools.setVertDir", __pyx_clineno, __pyx_lineno, __pyx_filename);
5992  __pyx_r = NULL;
5993  __pyx_L0:;
5994  __Pyx_XGIVEREF(__pyx_r);
5995  __Pyx_RefNannyFinishContext();
5996  return __pyx_r;
5997 }
5998 
5999 /* "WaveTools.py":216
6000  *
6001  *
6002  * def setDirVector(vector): # <<<<<<<<<<<<<<
6003  * """ Returns the direction of a vector in the form of a unit vector
6004  *
6005  */
6006 
6007 /* Python wrapper */
6008 static PyObject *__pyx_pw_9WaveTools_15setDirVector(PyObject *__pyx_self, PyObject *__pyx_v_vector); /*proto*/
6009 static char __pyx_doc_9WaveTools_14setDirVector[] = " Returns the direction of a vector in the form of a unit vector\n\n Parameters\n ----------\n vector : numpy.ndarray\n 1D numpy array with three components\n\n Returns\n --------\n numpy.ndarray\n\n ";
6010 static PyMethodDef __pyx_mdef_9WaveTools_15setDirVector = {"setDirVector", (PyCFunction)__pyx_pw_9WaveTools_15setDirVector, METH_O, __pyx_doc_9WaveTools_14setDirVector};
6011 static PyObject *__pyx_pw_9WaveTools_15setDirVector(PyObject *__pyx_self, PyObject *__pyx_v_vector) {
6012  PyObject *__pyx_r = 0;
6013  __Pyx_RefNannyDeclarations
6014  __Pyx_RefNannySetupContext("setDirVector (wrapper)", 0);
6015  __pyx_r = __pyx_pf_9WaveTools_14setDirVector(__pyx_self, ((PyObject *)__pyx_v_vector));
6016 
6017  /* function exit code */
6018  __Pyx_RefNannyFinishContext();
6019  return __pyx_r;
6020 }
6021 
6022 static PyObject *__pyx_pf_9WaveTools_14setDirVector(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vector) {
6023  PyObject *__pyx_r = NULL;
6024  __Pyx_RefNannyDeclarations
6025  PyObject *__pyx_t_1 = NULL;
6026  PyObject *__pyx_t_2 = NULL;
6027  PyObject *__pyx_t_3 = NULL;
6028  PyObject *__pyx_t_4 = NULL;
6029  PyObject *__pyx_t_5 = NULL;
6030  double __pyx_t_6;
6031  int __pyx_t_7;
6032  __Pyx_RefNannySetupContext("setDirVector", 0);
6033 
6034  /* "WaveTools.py":229
6035  *
6036  * """
6037  * return old_div(vector,(sqrt(vector[0]**2 + vector[1]**2 + vector[2]**2))) # <<<<<<<<<<<<<<
6038  *
6039  * def dirCheck(v1, v2):
6040  */
6041  __Pyx_XDECREF(__pyx_r);
6042  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
6043  __Pyx_GOTREF(__pyx_t_2);
6044  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vector, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
6045  __Pyx_GOTREF(__pyx_t_3);
6046  __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
6047  __Pyx_GOTREF(__pyx_t_4);
6048  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6049  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vector, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
6050  __Pyx_GOTREF(__pyx_t_3);
6051  __pyx_t_5 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
6052  __Pyx_GOTREF(__pyx_t_5);
6053  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6054  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
6055  __Pyx_GOTREF(__pyx_t_3);
6056  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6057  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6058  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vector, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
6059  __Pyx_GOTREF(__pyx_t_5);
6060  __pyx_t_4 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
6061  __Pyx_GOTREF(__pyx_t_4);
6062  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6063  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
6064  __Pyx_GOTREF(__pyx_t_5);
6065  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6066  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6067  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 229, __pyx_L1_error)
6068  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6069  __pyx_t_5 = PyFloat_FromDouble(sqrt(__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
6070  __Pyx_GOTREF(__pyx_t_5);
6071  __pyx_t_4 = NULL;
6072  __pyx_t_7 = 0;
6073  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6074  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
6075  if (likely(__pyx_t_4)) {
6076  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6077  __Pyx_INCREF(__pyx_t_4);
6078  __Pyx_INCREF(function);
6079  __Pyx_DECREF_SET(__pyx_t_2, function);
6080  __pyx_t_7 = 1;
6081  }
6082  }
6083  #if CYTHON_FAST_PYCALL
6084  if (PyFunction_Check(__pyx_t_2)) {
6085  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_t_5};
6086  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
6087  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6088  __Pyx_GOTREF(__pyx_t_1);
6089  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6090  } else
6091  #endif
6092  #if CYTHON_FAST_PYCCALL
6093  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
6094  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_vector, __pyx_t_5};
6095  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
6096  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6097  __Pyx_GOTREF(__pyx_t_1);
6098  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6099  } else
6100  #endif
6101  {
6102  __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error)
6103  __Pyx_GOTREF(__pyx_t_3);
6104  if (__pyx_t_4) {
6105  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
6106  }
6107  __Pyx_INCREF(__pyx_v_vector);
6108  __Pyx_GIVEREF(__pyx_v_vector);
6109  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_vector);
6110  __Pyx_GIVEREF(__pyx_t_5);
6111  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_5);
6112  __pyx_t_5 = 0;
6113  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
6114  __Pyx_GOTREF(__pyx_t_1);
6115  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6116  }
6117  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6118  __pyx_r = __pyx_t_1;
6119  __pyx_t_1 = 0;
6120  goto __pyx_L0;
6121 
6122  /* "WaveTools.py":216
6123  *
6124  *
6125  * def setDirVector(vector): # <<<<<<<<<<<<<<
6126  * """ Returns the direction of a vector in the form of a unit vector
6127  *
6128  */
6129 
6130  /* function exit code */
6131  __pyx_L1_error:;
6132  __Pyx_XDECREF(__pyx_t_1);
6133  __Pyx_XDECREF(__pyx_t_2);
6134  __Pyx_XDECREF(__pyx_t_3);
6135  __Pyx_XDECREF(__pyx_t_4);
6136  __Pyx_XDECREF(__pyx_t_5);
6137  __Pyx_AddTraceback("WaveTools.setDirVector", __pyx_clineno, __pyx_lineno, __pyx_filename);
6138  __pyx_r = NULL;
6139  __pyx_L0:;
6140  __Pyx_XGIVEREF(__pyx_r);
6141  __Pyx_RefNannyFinishContext();
6142  return __pyx_r;
6143 }
6144 
6145 /* "WaveTools.py":231
6146  * return old_div(vector,(sqrt(vector[0]**2 + vector[1]**2 + vector[2]**2)))
6147  *
6148  * def dirCheck(v1, v2): # <<<<<<<<<<<<<<
6149  * """ Checks if two vectors are vertical raises SystemError if True
6150  *
6151  */
6152 
6153 /* Python wrapper */
6154 static PyObject *__pyx_pw_9WaveTools_17dirCheck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6155 static char __pyx_doc_9WaveTools_16dirCheck[] = " Checks if two vectors are vertical raises SystemError if True\n\n Parameters\n ----------\n v1 : numpy.ndarray\n 1st vector with three components\n\n v2 : numpy.ndarray\n 2nd vector with three components\n\n Returns\n --------\n None\n\n Raises\n ---------\n SystemExit\n\n ";
6156 static PyMethodDef __pyx_mdef_9WaveTools_17dirCheck = {"dirCheck", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_17dirCheck, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_16dirCheck};
6157 static PyObject *__pyx_pw_9WaveTools_17dirCheck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6158  PyObject *__pyx_v_v1 = 0;
6159  PyObject *__pyx_v_v2 = 0;
6160  PyObject *__pyx_r = 0;
6161  __Pyx_RefNannyDeclarations
6162  __Pyx_RefNannySetupContext("dirCheck (wrapper)", 0);
6163  {
6164  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v1,&__pyx_n_s_v2,0};
6165  PyObject* values[2] = {0,0};
6166  if (unlikely(__pyx_kwds)) {
6167  Py_ssize_t kw_args;
6168  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6169  switch (pos_args) {
6170  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6171  CYTHON_FALLTHROUGH;
6172  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6173  CYTHON_FALLTHROUGH;
6174  case 0: break;
6175  default: goto __pyx_L5_argtuple_error;
6176  }
6177  kw_args = PyDict_Size(__pyx_kwds);
6178  switch (pos_args) {
6179  case 0:
6180  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v1)) != 0)) kw_args--;
6181  else goto __pyx_L5_argtuple_error;
6182  CYTHON_FALLTHROUGH;
6183  case 1:
6184  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_v2)) != 0)) kw_args--;
6185  else {
6186  __Pyx_RaiseArgtupleInvalid("dirCheck", 1, 2, 2, 1); __PYX_ERR(0, 231, __pyx_L3_error)
6187  }
6188  }
6189  if (unlikely(kw_args > 0)) {
6190  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dirCheck") < 0)) __PYX_ERR(0, 231, __pyx_L3_error)
6191  }
6192  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6193  goto __pyx_L5_argtuple_error;
6194  } else {
6195  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6196  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6197  }
6198  __pyx_v_v1 = values[0];
6199  __pyx_v_v2 = values[1];
6200  }
6201  goto __pyx_L4_argument_unpacking_done;
6202  __pyx_L5_argtuple_error:;
6203  __Pyx_RaiseArgtupleInvalid("dirCheck", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 231, __pyx_L3_error)
6204  __pyx_L3_error:;
6205  __Pyx_AddTraceback("WaveTools.dirCheck", __pyx_clineno, __pyx_lineno, __pyx_filename);
6206  __Pyx_RefNannyFinishContext();
6207  return NULL;
6208  __pyx_L4_argument_unpacking_done:;
6209  __pyx_r = __pyx_pf_9WaveTools_16dirCheck(__pyx_self, __pyx_v_v1, __pyx_v_v2);
6210 
6211  /* function exit code */
6212  __Pyx_RefNannyFinishContext();
6213  return __pyx_r;
6214 }
6215 
6216 static PyObject *__pyx_pf_9WaveTools_16dirCheck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_v1, PyObject *__pyx_v_v2) {
6217  PyObject *__pyx_v_dircheck = NULL;
6218  PyObject *__pyx_r = NULL;
6219  __Pyx_RefNannyDeclarations
6220  PyObject *__pyx_t_1 = NULL;
6221  PyObject *__pyx_t_2 = NULL;
6222  PyObject *__pyx_t_3 = NULL;
6223  PyObject *__pyx_t_4 = NULL;
6224  int __pyx_t_5;
6225  __Pyx_RefNannySetupContext("dirCheck", 0);
6226 
6227  /* "WaveTools.py":251
6228  *
6229  * """
6230  * dircheck = abs(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]) # <<<<<<<<<<<<<<
6231  * #print self.dircheck
6232  * if dircheck > 1e-10:
6233  */
6234  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
6235  __Pyx_GOTREF(__pyx_t_1);
6236  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_v2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
6237  __Pyx_GOTREF(__pyx_t_2);
6238  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
6239  __Pyx_GOTREF(__pyx_t_3);
6240  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6241  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6242  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_v1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
6243  __Pyx_GOTREF(__pyx_t_2);
6244  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_v2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
6245  __Pyx_GOTREF(__pyx_t_1);
6246  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
6247  __Pyx_GOTREF(__pyx_t_4);
6248  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6249  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6250  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error)
6251  __Pyx_GOTREF(__pyx_t_1);
6252  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6253  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6254  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_v1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
6255  __Pyx_GOTREF(__pyx_t_4);
6256  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_v2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
6257  __Pyx_GOTREF(__pyx_t_3);
6258  __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
6259  __Pyx_GOTREF(__pyx_t_2);
6260  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6261  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6262  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
6263  __Pyx_GOTREF(__pyx_t_3);
6264  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6265  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6266  __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
6267  __Pyx_GOTREF(__pyx_t_2);
6268  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6269  __pyx_v_dircheck = __pyx_t_2;
6270  __pyx_t_2 = 0;
6271 
6272  /* "WaveTools.py":253
6273  * dircheck = abs(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2])
6274  * #print self.dircheck
6275  * if dircheck > 1e-10: # <<<<<<<<<<<<<<
6276  * logEvent("Wave direction is not perpendicular to gravity vector. Check input",level=0)
6277  * return sys.exit(1)
6278  */
6279  __pyx_t_2 = PyObject_RichCompare(__pyx_v_dircheck, __pyx_float_1eneg_10, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
6280  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 253, __pyx_L1_error)
6281  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6282  if (__pyx_t_5) {
6283 
6284  /* "WaveTools.py":254
6285  * #print self.dircheck
6286  * if dircheck > 1e-10:
6287  * logEvent("Wave direction is not perpendicular to gravity vector. Check input",level=0) # <<<<<<<<<<<<<<
6288  * return sys.exit(1)
6289  * else:
6290  */
6291  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
6292  __Pyx_GOTREF(__pyx_t_2);
6293  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
6294  __Pyx_GOTREF(__pyx_t_3);
6295  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
6296  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
6297  __Pyx_GOTREF(__pyx_t_1);
6298  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6299  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6300  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6301 
6302  /* "WaveTools.py":255
6303  * if dircheck > 1e-10:
6304  * logEvent("Wave direction is not perpendicular to gravity vector. Check input",level=0)
6305  * return sys.exit(1) # <<<<<<<<<<<<<<
6306  * else:
6307  * return None
6308  */
6309  __Pyx_XDECREF(__pyx_r);
6310  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
6311  __Pyx_GOTREF(__pyx_t_3);
6312  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
6313  __Pyx_GOTREF(__pyx_t_2);
6314  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6315  __pyx_t_3 = NULL;
6316  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6317  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6318  if (likely(__pyx_t_3)) {
6319  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6320  __Pyx_INCREF(__pyx_t_3);
6321  __Pyx_INCREF(function);
6322  __Pyx_DECREF_SET(__pyx_t_2, function);
6323  }
6324  }
6325  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
6326  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6327  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
6328  __Pyx_GOTREF(__pyx_t_1);
6329  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6330  __pyx_r = __pyx_t_1;
6331  __pyx_t_1 = 0;
6332  goto __pyx_L0;
6333 
6334  /* "WaveTools.py":253
6335  * dircheck = abs(v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2])
6336  * #print self.dircheck
6337  * if dircheck > 1e-10: # <<<<<<<<<<<<<<
6338  * logEvent("Wave direction is not perpendicular to gravity vector. Check input",level=0)
6339  * return sys.exit(1)
6340  */
6341  }
6342 
6343  /* "WaveTools.py":257
6344  * return sys.exit(1)
6345  * else:
6346  * return None # <<<<<<<<<<<<<<
6347  * def reduceToIntervals(fi,df):
6348  * """ Prepares the x-axis array with N elements for numerical integration
6349  */
6350  /*else*/ {
6351  __Pyx_XDECREF(__pyx_r);
6352  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6353  goto __pyx_L0;
6354  }
6355 
6356  /* "WaveTools.py":231
6357  * return old_div(vector,(sqrt(vector[0]**2 + vector[1]**2 + vector[2]**2)))
6358  *
6359  * def dirCheck(v1, v2): # <<<<<<<<<<<<<<
6360  * """ Checks if two vectors are vertical raises SystemError if True
6361  *
6362  */
6363 
6364  /* function exit code */
6365  __pyx_L1_error:;
6366  __Pyx_XDECREF(__pyx_t_1);
6367  __Pyx_XDECREF(__pyx_t_2);
6368  __Pyx_XDECREF(__pyx_t_3);
6369  __Pyx_XDECREF(__pyx_t_4);
6370  __Pyx_AddTraceback("WaveTools.dirCheck", __pyx_clineno, __pyx_lineno, __pyx_filename);
6371  __pyx_r = NULL;
6372  __pyx_L0:;
6373  __Pyx_XDECREF(__pyx_v_dircheck);
6374  __Pyx_XGIVEREF(__pyx_r);
6375  __Pyx_RefNannyFinishContext();
6376  return __pyx_r;
6377 }
6378 
6379 /* "WaveTools.py":258
6380  * else:
6381  * return None
6382  * def reduceToIntervals(fi,df): # <<<<<<<<<<<<<<
6383  * """ Prepares the x-axis array with N elements for numerical integration
6384  *
6385  */
6386 
6387 /* Python wrapper */
6388 static PyObject *__pyx_pw_9WaveTools_19reduceToIntervals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6389 static char __pyx_doc_9WaveTools_18reduceToIntervals[] = " Prepares the x-axis array with N elements for numerical integration\n\n Integration is performed along he x- axis. If\n fi = [a1, a2, a3,...,a_N-1 a_N] then it returns the array\n [a1, 0.5(a1+a2), 0.5(a2+a3),...0.5(a_N-1+a_N), a_N].\n Input array must have constant step\n\n Parameters\n ----------\n fi : numpy.ndarray\n x- array with N elements\n df : float\n Constant step of array\n Returns\n --------\n numpy.ndarray\n\n ";
6390 static PyMethodDef __pyx_mdef_9WaveTools_19reduceToIntervals = {"reduceToIntervals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_19reduceToIntervals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_18reduceToIntervals};
6391 static PyObject *__pyx_pw_9WaveTools_19reduceToIntervals(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6392  PyObject *__pyx_v_fi = 0;
6393  PyObject *__pyx_v_df = 0;
6394  PyObject *__pyx_r = 0;
6395  __Pyx_RefNannyDeclarations
6396  __Pyx_RefNannySetupContext("reduceToIntervals (wrapper)", 0);
6397  {
6398  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fi,&__pyx_n_s_df,0};
6399  PyObject* values[2] = {0,0};
6400  if (unlikely(__pyx_kwds)) {
6401  Py_ssize_t kw_args;
6402  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6403  switch (pos_args) {
6404  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6405  CYTHON_FALLTHROUGH;
6406  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6407  CYTHON_FALLTHROUGH;
6408  case 0: break;
6409  default: goto __pyx_L5_argtuple_error;
6410  }
6411  kw_args = PyDict_Size(__pyx_kwds);
6412  switch (pos_args) {
6413  case 0:
6414  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
6415  else goto __pyx_L5_argtuple_error;
6416  CYTHON_FALLTHROUGH;
6417  case 1:
6418  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
6419  else {
6420  __Pyx_RaiseArgtupleInvalid("reduceToIntervals", 1, 2, 2, 1); __PYX_ERR(0, 258, __pyx_L3_error)
6421  }
6422  }
6423  if (unlikely(kw_args > 0)) {
6424  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceToIntervals") < 0)) __PYX_ERR(0, 258, __pyx_L3_error)
6425  }
6426  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6427  goto __pyx_L5_argtuple_error;
6428  } else {
6429  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6430  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6431  }
6432  __pyx_v_fi = values[0];
6433  __pyx_v_df = values[1];
6434  }
6435  goto __pyx_L4_argument_unpacking_done;
6436  __pyx_L5_argtuple_error:;
6437  __Pyx_RaiseArgtupleInvalid("reduceToIntervals", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 258, __pyx_L3_error)
6438  __pyx_L3_error:;
6439  __Pyx_AddTraceback("WaveTools.reduceToIntervals", __pyx_clineno, __pyx_lineno, __pyx_filename);
6440  __Pyx_RefNannyFinishContext();
6441  return NULL;
6442  __pyx_L4_argument_unpacking_done:;
6443  __pyx_r = __pyx_pf_9WaveTools_18reduceToIntervals(__pyx_self, __pyx_v_fi, __pyx_v_df);
6444 
6445  /* function exit code */
6446  __Pyx_RefNannyFinishContext();
6447  return __pyx_r;
6448 }
6449 
6450 static PyObject *__pyx_pf_9WaveTools_18reduceToIntervals(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fi, PyObject *__pyx_v_df) {
6451  PyObject *__pyx_v_fim_tmp = NULL;
6452  PyObject *__pyx_r = NULL;
6453  __Pyx_RefNannyDeclarations
6454  PyObject *__pyx_t_1 = NULL;
6455  PyObject *__pyx_t_2 = NULL;
6456  PyObject *__pyx_t_3 = NULL;
6457  PyObject *__pyx_t_4 = NULL;
6458  PyObject *__pyx_t_5 = NULL;
6459  PyObject *__pyx_t_6 = NULL;
6460  __Pyx_RefNannySetupContext("reduceToIntervals", 0);
6461 
6462  /* "WaveTools.py":277
6463  *
6464  * """
6465  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist() # <<<<<<<<<<<<<<
6466  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df])
6467  * def returnRectangles(a,x):
6468  */
6469  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_fi, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
6470  __Pyx_GOTREF(__pyx_t_2);
6471  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_fi, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
6472  __Pyx_GOTREF(__pyx_t_3);
6473  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error)
6474  __Pyx_GOTREF(__pyx_t_4);
6475  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6476  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6477  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
6478  __Pyx_GOTREF(__pyx_t_3);
6479  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6480  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tolist); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error)
6481  __Pyx_GOTREF(__pyx_t_4);
6482  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6483  __pyx_t_3 = NULL;
6484  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
6485  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
6486  if (likely(__pyx_t_3)) {
6487  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6488  __Pyx_INCREF(__pyx_t_3);
6489  __Pyx_INCREF(function);
6490  __Pyx_DECREF_SET(__pyx_t_4, function);
6491  }
6492  }
6493  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
6494  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6495  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
6496  __Pyx_GOTREF(__pyx_t_1);
6497  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6498  __pyx_v_fim_tmp = __pyx_t_1;
6499  __pyx_t_1 = 0;
6500 
6501  /* "WaveTools.py":278
6502  * """
6503  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist()
6504  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df]) # <<<<<<<<<<<<<<
6505  * def returnRectangles(a,x):
6506  * """ Returns 2D discrete integral array using the rectangle method
6507  */
6508  __Pyx_XDECREF(__pyx_r);
6509  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
6510  __Pyx_GOTREF(__pyx_t_4);
6511  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
6512  __Pyx_GOTREF(__pyx_t_3);
6513  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6514  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_fim_tmp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
6515  __Pyx_GOTREF(__pyx_t_4);
6516  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_df); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
6517  __Pyx_GOTREF(__pyx_t_2);
6518  __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
6519  __Pyx_GOTREF(__pyx_t_5);
6520  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6521  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6522  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
6523  __Pyx_GOTREF(__pyx_t_2);
6524  __Pyx_GIVEREF(__pyx_t_5);
6525  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
6526  __pyx_t_5 = 0;
6527  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_v_fim_tmp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
6528  __Pyx_GOTREF(__pyx_t_5);
6529  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6530  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fim_tmp, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
6531  __Pyx_GOTREF(__pyx_t_2);
6532  __pyx_t_4 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_df); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
6533  __Pyx_GOTREF(__pyx_t_4);
6534  __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
6535  __Pyx_GOTREF(__pyx_t_6);
6536  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6537  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6538  __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
6539  __Pyx_GOTREF(__pyx_t_4);
6540  __Pyx_GIVEREF(__pyx_t_6);
6541  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
6542  __pyx_t_6 = 0;
6543  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
6544  __Pyx_GOTREF(__pyx_t_6);
6545  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6546  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6547  __pyx_t_4 = NULL;
6548  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6549  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
6550  if (likely(__pyx_t_4)) {
6551  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6552  __Pyx_INCREF(__pyx_t_4);
6553  __Pyx_INCREF(function);
6554  __Pyx_DECREF_SET(__pyx_t_3, function);
6555  }
6556  }
6557  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
6558  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6559  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6560  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
6561  __Pyx_GOTREF(__pyx_t_1);
6562  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6563  __pyx_r = __pyx_t_1;
6564  __pyx_t_1 = 0;
6565  goto __pyx_L0;
6566 
6567  /* "WaveTools.py":258
6568  * else:
6569  * return None
6570  * def reduceToIntervals(fi,df): # <<<<<<<<<<<<<<
6571  * """ Prepares the x-axis array with N elements for numerical integration
6572  *
6573  */
6574 
6575  /* function exit code */
6576  __pyx_L1_error:;
6577  __Pyx_XDECREF(__pyx_t_1);
6578  __Pyx_XDECREF(__pyx_t_2);
6579  __Pyx_XDECREF(__pyx_t_3);
6580  __Pyx_XDECREF(__pyx_t_4);
6581  __Pyx_XDECREF(__pyx_t_5);
6582  __Pyx_XDECREF(__pyx_t_6);
6583  __Pyx_AddTraceback("WaveTools.reduceToIntervals", __pyx_clineno, __pyx_lineno, __pyx_filename);
6584  __pyx_r = NULL;
6585  __pyx_L0:;
6586  __Pyx_XDECREF(__pyx_v_fim_tmp);
6587  __Pyx_XGIVEREF(__pyx_r);
6588  __Pyx_RefNannyFinishContext();
6589  return __pyx_r;
6590 }
6591 
6592 /* "WaveTools.py":279
6593  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist()
6594  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df])
6595  * def returnRectangles(a,x): # <<<<<<<<<<<<<<
6596  * """ Returns 2D discrete integral array using the rectangle method
6597  *
6598  */
6599 
6600 /* Python wrapper */
6601 static PyObject *__pyx_pw_9WaveTools_21returnRectangles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6602 static char __pyx_doc_9WaveTools_20returnRectangles[] = " Returns 2D discrete integral array using the rectangle method\n\n The calculation for each array element is\n :math:`(\\Delta y_i = 0.5(a_{n-1}+a_{n})*(x_{n-1}-x_{n})`\n\n Parameters\n ----------\n a : numpy.ndarray\n Description: Array of y(x) function with N+1 elements\n x : numpy.ndarray\n Description: x- coordinate array with N elements\n\n Returns\n --------\n numpy.ndarray\n\n\n ";
6603 static PyMethodDef __pyx_mdef_9WaveTools_21returnRectangles = {"returnRectangles", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_21returnRectangles, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_20returnRectangles};
6604 static PyObject *__pyx_pw_9WaveTools_21returnRectangles(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6605  PyObject *__pyx_v_a = 0;
6606  PyObject *__pyx_v_x = 0;
6607  PyObject *__pyx_r = 0;
6608  __Pyx_RefNannyDeclarations
6609  __Pyx_RefNannySetupContext("returnRectangles (wrapper)", 0);
6610  {
6611  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_x,0};
6612  PyObject* values[2] = {0,0};
6613  if (unlikely(__pyx_kwds)) {
6614  Py_ssize_t kw_args;
6615  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6616  switch (pos_args) {
6617  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6618  CYTHON_FALLTHROUGH;
6619  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6620  CYTHON_FALLTHROUGH;
6621  case 0: break;
6622  default: goto __pyx_L5_argtuple_error;
6623  }
6624  kw_args = PyDict_Size(__pyx_kwds);
6625  switch (pos_args) {
6626  case 0:
6627  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6628  else goto __pyx_L5_argtuple_error;
6629  CYTHON_FALLTHROUGH;
6630  case 1:
6631  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6632  else {
6633  __Pyx_RaiseArgtupleInvalid("returnRectangles", 1, 2, 2, 1); __PYX_ERR(0, 279, __pyx_L3_error)
6634  }
6635  }
6636  if (unlikely(kw_args > 0)) {
6637  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "returnRectangles") < 0)) __PYX_ERR(0, 279, __pyx_L3_error)
6638  }
6639  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6640  goto __pyx_L5_argtuple_error;
6641  } else {
6642  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6643  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6644  }
6645  __pyx_v_a = values[0];
6646  __pyx_v_x = values[1];
6647  }
6648  goto __pyx_L4_argument_unpacking_done;
6649  __pyx_L5_argtuple_error:;
6650  __Pyx_RaiseArgtupleInvalid("returnRectangles", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 279, __pyx_L3_error)
6651  __pyx_L3_error:;
6652  __Pyx_AddTraceback("WaveTools.returnRectangles", __pyx_clineno, __pyx_lineno, __pyx_filename);
6653  __Pyx_RefNannyFinishContext();
6654  return NULL;
6655  __pyx_L4_argument_unpacking_done:;
6656  __pyx_r = __pyx_pf_9WaveTools_20returnRectangles(__pyx_self, __pyx_v_a, __pyx_v_x);
6657 
6658  /* function exit code */
6659  __Pyx_RefNannyFinishContext();
6660  return __pyx_r;
6661 }
6662 
6663 static PyObject *__pyx_pf_9WaveTools_20returnRectangles(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_x) {
6664  PyObject *__pyx_r = NULL;
6665  __Pyx_RefNannyDeclarations
6666  PyObject *__pyx_t_1 = NULL;
6667  PyObject *__pyx_t_2 = NULL;
6668  PyObject *__pyx_t_3 = NULL;
6669  PyObject *__pyx_t_4 = NULL;
6670  __Pyx_RefNannySetupContext("returnRectangles", 0);
6671 
6672  /* "WaveTools.py":298
6673  *
6674  * """
6675  * return 0.5*(a[1:]+a[:-1])*(x[1:]-x[:-1]) # <<<<<<<<<<<<<<
6676  * def returnRectangles3D(a,x,y):
6677  * """ Returns 3D discrete integrals using the rectangle method
6678  */
6679  __Pyx_XDECREF(__pyx_r);
6680  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_a, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
6681  __Pyx_GOTREF(__pyx_t_1);
6682  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_a, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
6683  __Pyx_GOTREF(__pyx_t_2);
6684  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
6685  __Pyx_GOTREF(__pyx_t_3);
6686  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6687  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6688  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
6689  __Pyx_GOTREF(__pyx_t_2);
6690  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6691  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_x, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
6692  __Pyx_GOTREF(__pyx_t_3);
6693  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
6694  __Pyx_GOTREF(__pyx_t_1);
6695  __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
6696  __Pyx_GOTREF(__pyx_t_4);
6697  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6698  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6699  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __pyx_L1_error)
6700  __Pyx_GOTREF(__pyx_t_1);
6701  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6702  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6703  __pyx_r = __pyx_t_1;
6704  __pyx_t_1 = 0;
6705  goto __pyx_L0;
6706 
6707  /* "WaveTools.py":279
6708  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist()
6709  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df])
6710  * def returnRectangles(a,x): # <<<<<<<<<<<<<<
6711  * """ Returns 2D discrete integral array using the rectangle method
6712  *
6713  */
6714 
6715  /* function exit code */
6716  __pyx_L1_error:;
6717  __Pyx_XDECREF(__pyx_t_1);
6718  __Pyx_XDECREF(__pyx_t_2);
6719  __Pyx_XDECREF(__pyx_t_3);
6720  __Pyx_XDECREF(__pyx_t_4);
6721  __Pyx_AddTraceback("WaveTools.returnRectangles", __pyx_clineno, __pyx_lineno, __pyx_filename);
6722  __pyx_r = NULL;
6723  __pyx_L0:;
6724  __Pyx_XGIVEREF(__pyx_r);
6725  __Pyx_RefNannyFinishContext();
6726  return __pyx_r;
6727 }
6728 
6729 /* "WaveTools.py":299
6730  * """
6731  * return 0.5*(a[1:]+a[:-1])*(x[1:]-x[:-1])
6732  * def returnRectangles3D(a,x,y): # <<<<<<<<<<<<<<
6733  * """ Returns 3D discrete integrals using the rectangle method
6734  *
6735  */
6736 
6737 /* Python wrapper */
6738 static PyObject *__pyx_pw_9WaveTools_23returnRectangles3D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6739 static char __pyx_doc_9WaveTools_22returnRectangles3D[] = " Returns 3D discrete integrals using the rectangle method\n\n The calculation for each array element is\n :math: `(\\Delta y = 0.25*(a_(n-1,m-1)+a_(n,m-1)+a_(n-1,m) ...\n ...+a_(n,m))*(x_n-1-x_n) *(z_m-1-z_m))`\n\n Parameters\n ----------\n a : numpy.ndarray\n 2D Array of y(x,y) function with (N+1)x(M+1)elements\n x : numpy.ndarray\n Description: x- coordinate array with N+1 elements\n y : numpy.ndarray\n Description: x- coordinate array with N+1 elements\n\n Returns\n --------\n numpy.ndarray\n ";
6740 static PyMethodDef __pyx_mdef_9WaveTools_23returnRectangles3D = {"returnRectangles3D", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_23returnRectangles3D, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_22returnRectangles3D};
6741 static PyObject *__pyx_pw_9WaveTools_23returnRectangles3D(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6742  PyObject *__pyx_v_a = 0;
6743  PyObject *__pyx_v_x = 0;
6744  PyObject *__pyx_v_y = 0;
6745  PyObject *__pyx_r = 0;
6746  __Pyx_RefNannyDeclarations
6747  __Pyx_RefNannySetupContext("returnRectangles3D (wrapper)", 0);
6748  {
6749  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_x,&__pyx_n_s_y,0};
6750  PyObject* values[3] = {0,0,0};
6751  if (unlikely(__pyx_kwds)) {
6752  Py_ssize_t kw_args;
6753  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6754  switch (pos_args) {
6755  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6756  CYTHON_FALLTHROUGH;
6757  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6758  CYTHON_FALLTHROUGH;
6759  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6760  CYTHON_FALLTHROUGH;
6761  case 0: break;
6762  default: goto __pyx_L5_argtuple_error;
6763  }
6764  kw_args = PyDict_Size(__pyx_kwds);
6765  switch (pos_args) {
6766  case 0:
6767  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6768  else goto __pyx_L5_argtuple_error;
6769  CYTHON_FALLTHROUGH;
6770  case 1:
6771  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6772  else {
6773  __Pyx_RaiseArgtupleInvalid("returnRectangles3D", 1, 3, 3, 1); __PYX_ERR(0, 299, __pyx_L3_error)
6774  }
6775  CYTHON_FALLTHROUGH;
6776  case 2:
6777  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
6778  else {
6779  __Pyx_RaiseArgtupleInvalid("returnRectangles3D", 1, 3, 3, 2); __PYX_ERR(0, 299, __pyx_L3_error)
6780  }
6781  }
6782  if (unlikely(kw_args > 0)) {
6783  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "returnRectangles3D") < 0)) __PYX_ERR(0, 299, __pyx_L3_error)
6784  }
6785  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6786  goto __pyx_L5_argtuple_error;
6787  } else {
6788  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6789  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6790  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6791  }
6792  __pyx_v_a = values[0];
6793  __pyx_v_x = values[1];
6794  __pyx_v_y = values[2];
6795  }
6796  goto __pyx_L4_argument_unpacking_done;
6797  __pyx_L5_argtuple_error:;
6798  __Pyx_RaiseArgtupleInvalid("returnRectangles3D", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error)
6799  __pyx_L3_error:;
6800  __Pyx_AddTraceback("WaveTools.returnRectangles3D", __pyx_clineno, __pyx_lineno, __pyx_filename);
6801  __Pyx_RefNannyFinishContext();
6802  return NULL;
6803  __pyx_L4_argument_unpacking_done:;
6804  __pyx_r = __pyx_pf_9WaveTools_22returnRectangles3D(__pyx_self, __pyx_v_a, __pyx_v_x, __pyx_v_y);
6805 
6806  /* function exit code */
6807  __Pyx_RefNannyFinishContext();
6808  return __pyx_r;
6809 }
6810 
6811 static PyObject *__pyx_pf_9WaveTools_22returnRectangles3D(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_a, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
6812  PyObject *__pyx_v_ai = NULL;
6813  PyObject *__pyx_v_ii = NULL;
6814  PyObject *__pyx_v_jj = NULL;
6815  PyObject *__pyx_r = NULL;
6816  __Pyx_RefNannyDeclarations
6817  PyObject *__pyx_t_1 = NULL;
6818  PyObject *__pyx_t_2 = NULL;
6819  PyObject *__pyx_t_3 = NULL;
6820  Py_ssize_t __pyx_t_4;
6821  PyObject *__pyx_t_5 = NULL;
6822  PyObject *(*__pyx_t_6)(PyObject *);
6823  PyObject *__pyx_t_7 = NULL;
6824  PyObject *__pyx_t_8 = NULL;
6825  __Pyx_RefNannySetupContext("returnRectangles3D", 0);
6826 
6827  /* "WaveTools.py":319
6828  * numpy.ndarray
6829  * """
6830  * ai = 0.5*(a[1:,:]+a[:-1,:]) # <<<<<<<<<<<<<<
6831  * ai = 0.5*(ai[:,1:]+ai[:,:-1])
6832  * for ii in range(len(x)-1):
6833  */
6834  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_tuple__5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error)
6835  __Pyx_GOTREF(__pyx_t_1);
6836  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_tuple__6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
6837  __Pyx_GOTREF(__pyx_t_2);
6838  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
6839  __Pyx_GOTREF(__pyx_t_3);
6840  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6841  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6842  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
6843  __Pyx_GOTREF(__pyx_t_2);
6844  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6845  __pyx_v_ai = __pyx_t_2;
6846  __pyx_t_2 = 0;
6847 
6848  /* "WaveTools.py":320
6849  * """
6850  * ai = 0.5*(a[1:,:]+a[:-1,:])
6851  * ai = 0.5*(ai[:,1:]+ai[:,:-1]) # <<<<<<<<<<<<<<
6852  * for ii in range(len(x)-1):
6853  * ai[ii,:] *= (y[1:]-y[:-1])
6854  */
6855  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_ai, __pyx_tuple__7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
6856  __Pyx_GOTREF(__pyx_t_2);
6857  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ai, __pyx_tuple__8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
6858  __Pyx_GOTREF(__pyx_t_3);
6859  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
6860  __Pyx_GOTREF(__pyx_t_1);
6861  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6862  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6863  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
6864  __Pyx_GOTREF(__pyx_t_3);
6865  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6866  __Pyx_DECREF_SET(__pyx_v_ai, __pyx_t_3);
6867  __pyx_t_3 = 0;
6868 
6869  /* "WaveTools.py":321
6870  * ai = 0.5*(a[1:,:]+a[:-1,:])
6871  * ai = 0.5*(ai[:,1:]+ai[:,:-1])
6872  * for ii in range(len(x)-1): # <<<<<<<<<<<<<<
6873  * ai[ii,:] *= (y[1:]-y[:-1])
6874  * for jj in range(len(y) - 1):
6875  */
6876  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
6877  __Pyx_GOTREF(__pyx_t_1);
6878  __pyx_t_4 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 321, __pyx_L1_error)
6879  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
6880  __Pyx_GOTREF(__pyx_t_2);
6881  __pyx_t_5 = NULL;
6882  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
6883  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
6884  if (likely(__pyx_t_5)) {
6885  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
6886  __Pyx_INCREF(__pyx_t_5);
6887  __Pyx_INCREF(function);
6888  __Pyx_DECREF_SET(__pyx_t_1, function);
6889  }
6890  }
6891  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
6892  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6893  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6894  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6895  __Pyx_GOTREF(__pyx_t_3);
6896  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6897  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
6898  __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
6899  __pyx_t_6 = NULL;
6900  } else {
6901  __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error)
6902  __Pyx_GOTREF(__pyx_t_1);
6903  __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
6904  }
6905  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6906  for (;;) {
6907  if (likely(!__pyx_t_6)) {
6908  if (likely(PyList_CheckExact(__pyx_t_1))) {
6909  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
6910  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6911  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
6912  #else
6913  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6914  __Pyx_GOTREF(__pyx_t_3);
6915  #endif
6916  } else {
6917  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6918  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6919  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
6920  #else
6921  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6922  __Pyx_GOTREF(__pyx_t_3);
6923  #endif
6924  }
6925  } else {
6926  __pyx_t_3 = __pyx_t_6(__pyx_t_1);
6927  if (unlikely(!__pyx_t_3)) {
6928  PyObject* exc_type = PyErr_Occurred();
6929  if (exc_type) {
6930  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
6931  else __PYX_ERR(0, 321, __pyx_L1_error)
6932  }
6933  break;
6934  }
6935  __Pyx_GOTREF(__pyx_t_3);
6936  }
6937  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_3);
6938  __pyx_t_3 = 0;
6939 
6940  /* "WaveTools.py":322
6941  * ai = 0.5*(ai[:,1:]+ai[:,:-1])
6942  * for ii in range(len(x)-1):
6943  * ai[ii,:] *= (y[1:]-y[:-1]) # <<<<<<<<<<<<<<
6944  * for jj in range(len(y) - 1):
6945  * ai[:,jj] *= (x[1:]-x[:-1])
6946  */
6947  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
6948  __Pyx_GOTREF(__pyx_t_3);
6949  __Pyx_INCREF(__pyx_v_ii);
6950  __Pyx_GIVEREF(__pyx_v_ii);
6951  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ii);
6952  __Pyx_INCREF(__pyx_slice__4);
6953  __Pyx_GIVEREF(__pyx_slice__4);
6954  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_slice__4);
6955  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_ai, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
6956  __Pyx_GOTREF(__pyx_t_2);
6957  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_y, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error)
6958  __Pyx_GOTREF(__pyx_t_5);
6959  __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_y, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error)
6960  __Pyx_GOTREF(__pyx_t_7);
6961  __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 322, __pyx_L1_error)
6962  __Pyx_GOTREF(__pyx_t_8);
6963  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6964  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6965  __pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error)
6966  __Pyx_GOTREF(__pyx_t_7);
6967  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6968  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6969  if (unlikely(PyObject_SetItem(__pyx_v_ai, __pyx_t_3, __pyx_t_7) < 0)) __PYX_ERR(0, 322, __pyx_L1_error)
6970  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6971  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6972 
6973  /* "WaveTools.py":321
6974  * ai = 0.5*(a[1:,:]+a[:-1,:])
6975  * ai = 0.5*(ai[:,1:]+ai[:,:-1])
6976  * for ii in range(len(x)-1): # <<<<<<<<<<<<<<
6977  * ai[ii,:] *= (y[1:]-y[:-1])
6978  * for jj in range(len(y) - 1):
6979  */
6980  }
6981  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6982 
6983  /* "WaveTools.py":323
6984  * for ii in range(len(x)-1):
6985  * ai[ii,:] *= (y[1:]-y[:-1])
6986  * for jj in range(len(y) - 1): # <<<<<<<<<<<<<<
6987  * ai[:,jj] *= (x[1:]-x[:-1])
6988  * return ai
6989  */
6990  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
6991  __Pyx_GOTREF(__pyx_t_3);
6992  __pyx_t_4 = PyObject_Length(__pyx_v_y); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 323, __pyx_L1_error)
6993  __pyx_t_7 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error)
6994  __Pyx_GOTREF(__pyx_t_7);
6995  __pyx_t_8 = NULL;
6996  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6997  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
6998  if (likely(__pyx_t_8)) {
6999  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7000  __Pyx_INCREF(__pyx_t_8);
7001  __Pyx_INCREF(function);
7002  __Pyx_DECREF_SET(__pyx_t_3, function);
7003  }
7004  }
7005  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7);
7006  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7007  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7008  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
7009  __Pyx_GOTREF(__pyx_t_1);
7010  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7011  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
7012  __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
7013  __pyx_t_6 = NULL;
7014  } else {
7015  __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error)
7016  __Pyx_GOTREF(__pyx_t_3);
7017  __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
7018  }
7019  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7020  for (;;) {
7021  if (likely(!__pyx_t_6)) {
7022  if (likely(PyList_CheckExact(__pyx_t_3))) {
7023  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
7024  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7025  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
7026  #else
7027  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
7028  __Pyx_GOTREF(__pyx_t_1);
7029  #endif
7030  } else {
7031  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
7032  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7033  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
7034  #else
7035  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
7036  __Pyx_GOTREF(__pyx_t_1);
7037  #endif
7038  }
7039  } else {
7040  __pyx_t_1 = __pyx_t_6(__pyx_t_3);
7041  if (unlikely(!__pyx_t_1)) {
7042  PyObject* exc_type = PyErr_Occurred();
7043  if (exc_type) {
7044  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7045  else __PYX_ERR(0, 323, __pyx_L1_error)
7046  }
7047  break;
7048  }
7049  __Pyx_GOTREF(__pyx_t_1);
7050  }
7051  __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_1);
7052  __pyx_t_1 = 0;
7053 
7054  /* "WaveTools.py":324
7055  * ai[ii,:] *= (y[1:]-y[:-1])
7056  * for jj in range(len(y) - 1):
7057  * ai[:,jj] *= (x[1:]-x[:-1]) # <<<<<<<<<<<<<<
7058  * return ai
7059  * def normIntegral(f,dom):
7060  */
7061  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
7062  __Pyx_GOTREF(__pyx_t_1);
7063  __Pyx_INCREF(__pyx_slice__4);
7064  __Pyx_GIVEREF(__pyx_slice__4);
7065  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__4);
7066  __Pyx_INCREF(__pyx_v_jj);
7067  __Pyx_GIVEREF(__pyx_v_jj);
7068  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_jj);
7069  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ai, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error)
7070  __Pyx_GOTREF(__pyx_t_7);
7071  __pyx_t_8 = __Pyx_PyObject_GetSlice(__pyx_v_x, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error)
7072  __Pyx_GOTREF(__pyx_t_8);
7073  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, -1L, NULL, NULL, &__pyx_slice__3, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
7074  __Pyx_GOTREF(__pyx_t_2);
7075  __pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 324, __pyx_L1_error)
7076  __Pyx_GOTREF(__pyx_t_5);
7077  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7078  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7079  __pyx_t_2 = PyNumber_InPlaceMultiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
7080  __Pyx_GOTREF(__pyx_t_2);
7081  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7082  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7083  if (unlikely(PyObject_SetItem(__pyx_v_ai, __pyx_t_1, __pyx_t_2) < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
7084  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7085  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7086 
7087  /* "WaveTools.py":323
7088  * for ii in range(len(x)-1):
7089  * ai[ii,:] *= (y[1:]-y[:-1])
7090  * for jj in range(len(y) - 1): # <<<<<<<<<<<<<<
7091  * ai[:,jj] *= (x[1:]-x[:-1])
7092  * return ai
7093  */
7094  }
7095  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7096 
7097  /* "WaveTools.py":325
7098  * for jj in range(len(y) - 1):
7099  * ai[:,jj] *= (x[1:]-x[:-1])
7100  * return ai # <<<<<<<<<<<<<<
7101  * def normIntegral(f,dom):
7102  * """Returns a normalised 2D function
7103  */
7104  __Pyx_XDECREF(__pyx_r);
7105  __Pyx_INCREF(__pyx_v_ai);
7106  __pyx_r = __pyx_v_ai;
7107  goto __pyx_L0;
7108 
7109  /* "WaveTools.py":299
7110  * """
7111  * return 0.5*(a[1:]+a[:-1])*(x[1:]-x[:-1])
7112  * def returnRectangles3D(a,x,y): # <<<<<<<<<<<<<<
7113  * """ Returns 3D discrete integrals using the rectangle method
7114  *
7115  */
7116 
7117  /* function exit code */
7118  __pyx_L1_error:;
7119  __Pyx_XDECREF(__pyx_t_1);
7120  __Pyx_XDECREF(__pyx_t_2);
7121  __Pyx_XDECREF(__pyx_t_3);
7122  __Pyx_XDECREF(__pyx_t_5);
7123  __Pyx_XDECREF(__pyx_t_7);
7124  __Pyx_XDECREF(__pyx_t_8);
7125  __Pyx_AddTraceback("WaveTools.returnRectangles3D", __pyx_clineno, __pyx_lineno, __pyx_filename);
7126  __pyx_r = NULL;
7127  __pyx_L0:;
7128  __Pyx_XDECREF(__pyx_v_ai);
7129  __Pyx_XDECREF(__pyx_v_ii);
7130  __Pyx_XDECREF(__pyx_v_jj);
7131  __Pyx_XGIVEREF(__pyx_r);
7132  __Pyx_RefNannyFinishContext();
7133  return __pyx_r;
7134 }
7135 
7136 /* "WaveTools.py":326
7137  * ai[:,jj] *= (x[1:]-x[:-1])
7138  * return ai
7139  * def normIntegral(f,dom): # <<<<<<<<<<<<<<
7140  * """Returns a normalised 2D function
7141  *
7142  */
7143 
7144 /* Python wrapper */
7145 static PyObject *__pyx_pw_9WaveTools_25normIntegral(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7146 static char __pyx_doc_9WaveTools_24normIntegral[] = "Returns a normalised 2D function\n\n The calculation is :math: `(\\int_\\Omega f d\\Omega =1)`\n\n Parameters\n ----------\n f : numpy.ndarray\n Discrete 2D function\n Numpy array or list\n\n dom : float\n Discrete function step\n\n Returns\n --------\n numpy.ndarray\n ";
7147 static PyMethodDef __pyx_mdef_9WaveTools_25normIntegral = {"normIntegral", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_25normIntegral, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_24normIntegral};
7148 static PyObject *__pyx_pw_9WaveTools_25normIntegral(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7149  PyObject *__pyx_v_f = 0;
7150  PyObject *__pyx_v_dom = 0;
7151  PyObject *__pyx_r = 0;
7152  __Pyx_RefNannyDeclarations
7153  __Pyx_RefNannySetupContext("normIntegral (wrapper)", 0);
7154  {
7155  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_dom,0};
7156  PyObject* values[2] = {0,0};
7157  if (unlikely(__pyx_kwds)) {
7158  Py_ssize_t kw_args;
7159  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7160  switch (pos_args) {
7161  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7162  CYTHON_FALLTHROUGH;
7163  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7164  CYTHON_FALLTHROUGH;
7165  case 0: break;
7166  default: goto __pyx_L5_argtuple_error;
7167  }
7168  kw_args = PyDict_Size(__pyx_kwds);
7169  switch (pos_args) {
7170  case 0:
7171  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
7172  else goto __pyx_L5_argtuple_error;
7173  CYTHON_FALLTHROUGH;
7174  case 1:
7175  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dom)) != 0)) kw_args--;
7176  else {
7177  __Pyx_RaiseArgtupleInvalid("normIntegral", 1, 2, 2, 1); __PYX_ERR(0, 326, __pyx_L3_error)
7178  }
7179  }
7180  if (unlikely(kw_args > 0)) {
7181  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normIntegral") < 0)) __PYX_ERR(0, 326, __pyx_L3_error)
7182  }
7183  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
7184  goto __pyx_L5_argtuple_error;
7185  } else {
7186  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7187  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7188  }
7189  __pyx_v_f = values[0];
7190  __pyx_v_dom = values[1];
7191  }
7192  goto __pyx_L4_argument_unpacking_done;
7193  __pyx_L5_argtuple_error:;
7194  __Pyx_RaiseArgtupleInvalid("normIntegral", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 326, __pyx_L3_error)
7195  __pyx_L3_error:;
7196  __Pyx_AddTraceback("WaveTools.normIntegral", __pyx_clineno, __pyx_lineno, __pyx_filename);
7197  __Pyx_RefNannyFinishContext();
7198  return NULL;
7199  __pyx_L4_argument_unpacking_done:;
7200  __pyx_r = __pyx_pf_9WaveTools_24normIntegral(__pyx_self, __pyx_v_f, __pyx_v_dom);
7201 
7202  /* function exit code */
7203  __Pyx_RefNannyFinishContext();
7204  return __pyx_r;
7205 }
7206 
7207 static PyObject *__pyx_pf_9WaveTools_24normIntegral(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_dom) {
7208  PyObject *__pyx_v_G0 = NULL;
7209  PyObject *__pyx_r = NULL;
7210  __Pyx_RefNannyDeclarations
7211  PyObject *__pyx_t_1 = NULL;
7212  PyObject *__pyx_t_2 = NULL;
7213  PyObject *__pyx_t_3 = NULL;
7214  PyObject *__pyx_t_4 = NULL;
7215  PyObject *__pyx_t_5 = NULL;
7216  int __pyx_t_6;
7217  PyObject *__pyx_t_7 = NULL;
7218  __Pyx_RefNannySetupContext("normIntegral", 0);
7219 
7220  /* "WaveTools.py":344
7221  * numpy.ndarray
7222  * """
7223  * G0 = old_div(1.,sum(returnRectangles(f,dom))) # <<<<<<<<<<<<<<
7224  * return G0*f
7225  *
7226  */
7227  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
7228  __Pyx_GOTREF(__pyx_t_2);
7229  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_returnRectangles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
7230  __Pyx_GOTREF(__pyx_t_4);
7231  __pyx_t_5 = NULL;
7232  __pyx_t_6 = 0;
7233  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7234  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
7235  if (likely(__pyx_t_5)) {
7236  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7237  __Pyx_INCREF(__pyx_t_5);
7238  __Pyx_INCREF(function);
7239  __Pyx_DECREF_SET(__pyx_t_4, function);
7240  __pyx_t_6 = 1;
7241  }
7242  }
7243  #if CYTHON_FAST_PYCALL
7244  if (PyFunction_Check(__pyx_t_4)) {
7245  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_f, __pyx_v_dom};
7246  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
7247  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7248  __Pyx_GOTREF(__pyx_t_3);
7249  } else
7250  #endif
7251  #if CYTHON_FAST_PYCCALL
7252  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
7253  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_f, __pyx_v_dom};
7254  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
7255  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7256  __Pyx_GOTREF(__pyx_t_3);
7257  } else
7258  #endif
7259  {
7260  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error)
7261  __Pyx_GOTREF(__pyx_t_7);
7262  if (__pyx_t_5) {
7263  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
7264  }
7265  __Pyx_INCREF(__pyx_v_f);
7266  __Pyx_GIVEREF(__pyx_v_f);
7267  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_f);
7268  __Pyx_INCREF(__pyx_v_dom);
7269  __Pyx_GIVEREF(__pyx_v_dom);
7270  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_dom);
7271  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
7272  __Pyx_GOTREF(__pyx_t_3);
7273  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7274  }
7275  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7276  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
7277  __Pyx_GOTREF(__pyx_t_4);
7278  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7279  __pyx_t_3 = NULL;
7280  __pyx_t_6 = 0;
7281  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7282  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7283  if (likely(__pyx_t_3)) {
7284  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7285  __Pyx_INCREF(__pyx_t_3);
7286  __Pyx_INCREF(function);
7287  __Pyx_DECREF_SET(__pyx_t_2, function);
7288  __pyx_t_6 = 1;
7289  }
7290  }
7291  #if CYTHON_FAST_PYCALL
7292  if (PyFunction_Check(__pyx_t_2)) {
7293  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_float_1_, __pyx_t_4};
7294  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
7295  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7296  __Pyx_GOTREF(__pyx_t_1);
7297  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7298  } else
7299  #endif
7300  #if CYTHON_FAST_PYCCALL
7301  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
7302  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_float_1_, __pyx_t_4};
7303  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
7304  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7305  __Pyx_GOTREF(__pyx_t_1);
7306  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7307  } else
7308  #endif
7309  {
7310  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error)
7311  __Pyx_GOTREF(__pyx_t_7);
7312  if (__pyx_t_3) {
7313  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
7314  }
7315  __Pyx_INCREF(__pyx_float_1_);
7316  __Pyx_GIVEREF(__pyx_float_1_);
7317  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_float_1_);
7318  __Pyx_GIVEREF(__pyx_t_4);
7319  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
7320  __pyx_t_4 = 0;
7321  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
7322  __Pyx_GOTREF(__pyx_t_1);
7323  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7324  }
7325  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7326  __pyx_v_G0 = __pyx_t_1;
7327  __pyx_t_1 = 0;
7328 
7329  /* "WaveTools.py":345
7330  * """
7331  * G0 = old_div(1.,sum(returnRectangles(f,dom)))
7332  * return G0*f # <<<<<<<<<<<<<<
7333  *
7334  *
7335  */
7336  __Pyx_XDECREF(__pyx_r);
7337  __pyx_t_1 = PyNumber_Multiply(__pyx_v_G0, __pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
7338  __Pyx_GOTREF(__pyx_t_1);
7339  __pyx_r = __pyx_t_1;
7340  __pyx_t_1 = 0;
7341  goto __pyx_L0;
7342 
7343  /* "WaveTools.py":326
7344  * ai[:,jj] *= (x[1:]-x[:-1])
7345  * return ai
7346  * def normIntegral(f,dom): # <<<<<<<<<<<<<<
7347  * """Returns a normalised 2D function
7348  *
7349  */
7350 
7351  /* function exit code */
7352  __pyx_L1_error:;
7353  __Pyx_XDECREF(__pyx_t_1);
7354  __Pyx_XDECREF(__pyx_t_2);
7355  __Pyx_XDECREF(__pyx_t_3);
7356  __Pyx_XDECREF(__pyx_t_4);
7357  __Pyx_XDECREF(__pyx_t_5);
7358  __Pyx_XDECREF(__pyx_t_7);
7359  __Pyx_AddTraceback("WaveTools.normIntegral", __pyx_clineno, __pyx_lineno, __pyx_filename);
7360  __pyx_r = NULL;
7361  __pyx_L0:;
7362  __Pyx_XDECREF(__pyx_v_G0);
7363  __Pyx_XGIVEREF(__pyx_r);
7364  __Pyx_RefNannyFinishContext();
7365  return __pyx_r;
7366 }
7367 
7368 /* "WaveTools.py":349
7369  *
7370  *
7371  * def eta_mode(x, t, kDir, omega, phi, amplitude): # <<<<<<<<<<<<<<
7372  * """Calculates the free surface elevation for a single frequency mode
7373  *
7374  */
7375 
7376 /* Python wrapper */
7377 static PyObject *__pyx_pw_9WaveTools_27eta_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7378 static char __pyx_doc_9WaveTools_26eta_mode[] = "Calculates the free surface elevation for a single frequency mode\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n kDir : numpy.ndarray\n Wave number vector\n omega : float\n Angular frequency\n phi : float\n Description: Wave phase\n amp : float\n Description: Wave amplitude\n\n Returns\n --------\n float\n The free surface elevation at x,t\n\n ";
7379 static PyMethodDef __pyx_mdef_9WaveTools_27eta_mode = {"eta_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_27eta_mode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_26eta_mode};
7380 static PyObject *__pyx_pw_9WaveTools_27eta_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7381  PyObject *__pyx_v_x = 0;
7382  PyObject *__pyx_v_t = 0;
7383  PyObject *__pyx_v_kDir = 0;
7384  PyObject *__pyx_v_omega = 0;
7385  PyObject *__pyx_v_phi = 0;
7386  PyObject *__pyx_v_amplitude = 0;
7387  PyObject *__pyx_r = 0;
7388  __Pyx_RefNannyDeclarations
7389  __Pyx_RefNannySetupContext("eta_mode (wrapper)", 0);
7390  {
7391  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_kDir,&__pyx_n_s_omega,&__pyx_n_s_phi,&__pyx_n_s_amplitude,0};
7392  PyObject* values[6] = {0,0,0,0,0,0};
7393  if (unlikely(__pyx_kwds)) {
7394  Py_ssize_t kw_args;
7395  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7396  switch (pos_args) {
7397  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7398  CYTHON_FALLTHROUGH;
7399  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7400  CYTHON_FALLTHROUGH;
7401  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7402  CYTHON_FALLTHROUGH;
7403  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7404  CYTHON_FALLTHROUGH;
7405  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7406  CYTHON_FALLTHROUGH;
7407  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7408  CYTHON_FALLTHROUGH;
7409  case 0: break;
7410  default: goto __pyx_L5_argtuple_error;
7411  }
7412  kw_args = PyDict_Size(__pyx_kwds);
7413  switch (pos_args) {
7414  case 0:
7415  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7416  else goto __pyx_L5_argtuple_error;
7417  CYTHON_FALLTHROUGH;
7418  case 1:
7419  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7420  else {
7421  __Pyx_RaiseArgtupleInvalid("eta_mode", 1, 6, 6, 1); __PYX_ERR(0, 349, __pyx_L3_error)
7422  }
7423  CYTHON_FALLTHROUGH;
7424  case 2:
7425  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kDir)) != 0)) kw_args--;
7426  else {
7427  __Pyx_RaiseArgtupleInvalid("eta_mode", 1, 6, 6, 2); __PYX_ERR(0, 349, __pyx_L3_error)
7428  }
7429  CYTHON_FALLTHROUGH;
7430  case 3:
7431  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
7432  else {
7433  __Pyx_RaiseArgtupleInvalid("eta_mode", 1, 6, 6, 3); __PYX_ERR(0, 349, __pyx_L3_error)
7434  }
7435  CYTHON_FALLTHROUGH;
7436  case 4:
7437  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
7438  else {
7439  __Pyx_RaiseArgtupleInvalid("eta_mode", 1, 6, 6, 4); __PYX_ERR(0, 349, __pyx_L3_error)
7440  }
7441  CYTHON_FALLTHROUGH;
7442  case 5:
7443  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_amplitude)) != 0)) kw_args--;
7444  else {
7445  __Pyx_RaiseArgtupleInvalid("eta_mode", 1, 6, 6, 5); __PYX_ERR(0, 349, __pyx_L3_error)
7446  }
7447  }
7448  if (unlikely(kw_args > 0)) {
7449  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta_mode") < 0)) __PYX_ERR(0, 349, __pyx_L3_error)
7450  }
7451  } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
7452  goto __pyx_L5_argtuple_error;
7453  } else {
7454  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7455  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7456  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7457  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7458  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7459  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7460  }
7461  __pyx_v_x = values[0];
7462  __pyx_v_t = values[1];
7463  __pyx_v_kDir = values[2];
7464  __pyx_v_omega = values[3];
7465  __pyx_v_phi = values[4];
7466  __pyx_v_amplitude = values[5];
7467  }
7468  goto __pyx_L4_argument_unpacking_done;
7469  __pyx_L5_argtuple_error:;
7470  __Pyx_RaiseArgtupleInvalid("eta_mode", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 349, __pyx_L3_error)
7471  __pyx_L3_error:;
7472  __Pyx_AddTraceback("WaveTools.eta_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
7473  __Pyx_RefNannyFinishContext();
7474  return NULL;
7475  __pyx_L4_argument_unpacking_done:;
7476  __pyx_r = __pyx_pf_9WaveTools_26eta_mode(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_kDir, __pyx_v_omega, __pyx_v_phi, __pyx_v_amplitude);
7477 
7478  /* function exit code */
7479  __Pyx_RefNannyFinishContext();
7480  return __pyx_r;
7481 }
7482 
7483 static PyObject *__pyx_pf_9WaveTools_26eta_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t, PyObject *__pyx_v_kDir, PyObject *__pyx_v_omega, PyObject *__pyx_v_phi, PyObject *__pyx_v_amplitude) {
7484  PyObject *__pyx_v_phase = NULL;
7485  PyObject *__pyx_r = NULL;
7486  __Pyx_RefNannyDeclarations
7487  PyObject *__pyx_t_1 = NULL;
7488  PyObject *__pyx_t_2 = NULL;
7489  PyObject *__pyx_t_3 = NULL;
7490  PyObject *__pyx_t_4 = NULL;
7491  double __pyx_t_5;
7492  __Pyx_RefNannySetupContext("eta_mode", 0);
7493 
7494  /* "WaveTools.py":373
7495  *
7496  * """
7497  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi # <<<<<<<<<<<<<<
7498  * return amplitude*cos(phase)
7499  * def Udrift(amp,gAbs,c,d):
7500  */
7501  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
7502  __Pyx_GOTREF(__pyx_t_1);
7503  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_kDir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
7504  __Pyx_GOTREF(__pyx_t_2);
7505  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
7506  __Pyx_GOTREF(__pyx_t_3);
7507  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7508  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7509  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
7510  __Pyx_GOTREF(__pyx_t_2);
7511  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_kDir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
7512  __Pyx_GOTREF(__pyx_t_1);
7513  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error)
7514  __Pyx_GOTREF(__pyx_t_4);
7515  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7516  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7517  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
7518  __Pyx_GOTREF(__pyx_t_1);
7519  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7520  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7521  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error)
7522  __Pyx_GOTREF(__pyx_t_4);
7523  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_kDir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
7524  __Pyx_GOTREF(__pyx_t_3);
7525  __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
7526  __Pyx_GOTREF(__pyx_t_2);
7527  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7528  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7529  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
7530  __Pyx_GOTREF(__pyx_t_3);
7531  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7532  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7533  __pyx_t_2 = PyNumber_Multiply(__pyx_v_omega, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
7534  __Pyx_GOTREF(__pyx_t_2);
7535  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error)
7536  __Pyx_GOTREF(__pyx_t_1);
7537  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7539  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_phi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
7540  __Pyx_GOTREF(__pyx_t_2);
7541  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7542  __pyx_v_phase = __pyx_t_2;
7543  __pyx_t_2 = 0;
7544 
7545  /* "WaveTools.py":374
7546  * """
7547  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
7548  * return amplitude*cos(phase) # <<<<<<<<<<<<<<
7549  * def Udrift(amp,gAbs,c,d):
7550  * """Calculates the 2nd order Stokes drift for a linear mode
7551  */
7552  __Pyx_XDECREF(__pyx_r);
7553  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
7554  __pyx_t_2 = PyFloat_FromDouble(cos(__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error)
7555  __Pyx_GOTREF(__pyx_t_2);
7556  __pyx_t_1 = PyNumber_Multiply(__pyx_v_amplitude, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
7557  __Pyx_GOTREF(__pyx_t_1);
7558  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7559  __pyx_r = __pyx_t_1;
7560  __pyx_t_1 = 0;
7561  goto __pyx_L0;
7562 
7563  /* "WaveTools.py":349
7564  *
7565  *
7566  * def eta_mode(x, t, kDir, omega, phi, amplitude): # <<<<<<<<<<<<<<
7567  * """Calculates the free surface elevation for a single frequency mode
7568  *
7569  */
7570 
7571  /* function exit code */
7572  __pyx_L1_error:;
7573  __Pyx_XDECREF(__pyx_t_1);
7574  __Pyx_XDECREF(__pyx_t_2);
7575  __Pyx_XDECREF(__pyx_t_3);
7576  __Pyx_XDECREF(__pyx_t_4);
7577  __Pyx_AddTraceback("WaveTools.eta_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
7578  __pyx_r = NULL;
7579  __pyx_L0:;
7580  __Pyx_XDECREF(__pyx_v_phase);
7581  __Pyx_XGIVEREF(__pyx_r);
7582  __Pyx_RefNannyFinishContext();
7583  return __pyx_r;
7584 }
7585 
7586 /* "WaveTools.py":375
7587  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
7588  * return amplitude*cos(phase)
7589  * def Udrift(amp,gAbs,c,d): # <<<<<<<<<<<<<<
7590  * """Calculates the 2nd order Stokes drift for a linear mode
7591  *
7592  */
7593 
7594 /* Python wrapper */
7595 static PyObject *__pyx_pw_9WaveTools_29Udrift(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7596 static char __pyx_doc_9WaveTools_28Udrift[] = "Calculates the 2nd order Stokes drift for a linear mode \n\n Parameters\n ----------\n amp : float\n Description: Wave amplitude\n gAbs : float\n Magnitude of gravitational acceleration\n c : float\n Wave celerity\n d : float\n Water depth\n\n\n Returns\n --------\n float\n Magnitude of the mean velocity drift\n ";
7597 static PyMethodDef __pyx_mdef_9WaveTools_29Udrift = {"Udrift", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_29Udrift, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_28Udrift};
7598 static PyObject *__pyx_pw_9WaveTools_29Udrift(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7599  PyObject *__pyx_v_amp = 0;
7600  PyObject *__pyx_v_gAbs = 0;
7601  PyObject *__pyx_v_c = 0;
7602  PyObject *__pyx_v_d = 0;
7603  PyObject *__pyx_r = 0;
7604  __Pyx_RefNannyDeclarations
7605  __Pyx_RefNannySetupContext("Udrift (wrapper)", 0);
7606  {
7607  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_amp,&__pyx_n_s_gAbs,&__pyx_n_s_c,&__pyx_n_s_d,0};
7608  PyObject* values[4] = {0,0,0,0};
7609  if (unlikely(__pyx_kwds)) {
7610  Py_ssize_t kw_args;
7611  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7612  switch (pos_args) {
7613  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7614  CYTHON_FALLTHROUGH;
7615  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7616  CYTHON_FALLTHROUGH;
7617  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7618  CYTHON_FALLTHROUGH;
7619  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7620  CYTHON_FALLTHROUGH;
7621  case 0: break;
7622  default: goto __pyx_L5_argtuple_error;
7623  }
7624  kw_args = PyDict_Size(__pyx_kwds);
7625  switch (pos_args) {
7626  case 0:
7627  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_amp)) != 0)) kw_args--;
7628  else goto __pyx_L5_argtuple_error;
7629  CYTHON_FALLTHROUGH;
7630  case 1:
7631  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gAbs)) != 0)) kw_args--;
7632  else {
7633  __Pyx_RaiseArgtupleInvalid("Udrift", 1, 4, 4, 1); __PYX_ERR(0, 375, __pyx_L3_error)
7634  }
7635  CYTHON_FALLTHROUGH;
7636  case 2:
7637  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
7638  else {
7639  __Pyx_RaiseArgtupleInvalid("Udrift", 1, 4, 4, 2); __PYX_ERR(0, 375, __pyx_L3_error)
7640  }
7641  CYTHON_FALLTHROUGH;
7642  case 3:
7643  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
7644  else {
7645  __Pyx_RaiseArgtupleInvalid("Udrift", 1, 4, 4, 3); __PYX_ERR(0, 375, __pyx_L3_error)
7646  }
7647  }
7648  if (unlikely(kw_args > 0)) {
7649  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Udrift") < 0)) __PYX_ERR(0, 375, __pyx_L3_error)
7650  }
7651  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
7652  goto __pyx_L5_argtuple_error;
7653  } else {
7654  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7655  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7656  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7657  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7658  }
7659  __pyx_v_amp = values[0];
7660  __pyx_v_gAbs = values[1];
7661  __pyx_v_c = values[2];
7662  __pyx_v_d = values[3];
7663  }
7664  goto __pyx_L4_argument_unpacking_done;
7665  __pyx_L5_argtuple_error:;
7666  __Pyx_RaiseArgtupleInvalid("Udrift", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 375, __pyx_L3_error)
7667  __pyx_L3_error:;
7668  __Pyx_AddTraceback("WaveTools.Udrift", __pyx_clineno, __pyx_lineno, __pyx_filename);
7669  __Pyx_RefNannyFinishContext();
7670  return NULL;
7671  __pyx_L4_argument_unpacking_done:;
7672  __pyx_r = __pyx_pf_9WaveTools_28Udrift(__pyx_self, __pyx_v_amp, __pyx_v_gAbs, __pyx_v_c, __pyx_v_d);
7673 
7674  /* function exit code */
7675  __Pyx_RefNannyFinishContext();
7676  return __pyx_r;
7677 }
7678 
7679 static PyObject *__pyx_pf_9WaveTools_28Udrift(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_amp, PyObject *__pyx_v_gAbs, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
7680  PyObject *__pyx_r = NULL;
7681  __Pyx_RefNannyDeclarations
7682  PyObject *__pyx_t_1 = NULL;
7683  PyObject *__pyx_t_2 = NULL;
7684  __Pyx_RefNannySetupContext("Udrift", 0);
7685 
7686  /* "WaveTools.py":395
7687  * Magnitude of the mean velocity drift
7688  * """
7689  * return 0.5*gAbs*amp*amp/c/d # <<<<<<<<<<<<<<
7690  *
7691  * def vel_mode(x, t, kDir, kAbs, omega, phi, amplitude, mwl, depth, vDir, gAbs):
7692  */
7693  __Pyx_XDECREF(__pyx_r);
7694  __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_gAbs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
7695  __Pyx_GOTREF(__pyx_t_1);
7696  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_amp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
7697  __Pyx_GOTREF(__pyx_t_2);
7698  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7699  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_amp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
7700  __Pyx_GOTREF(__pyx_t_1);
7701  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7702  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_c); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
7703  __Pyx_GOTREF(__pyx_t_2);
7704  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7705  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
7706  __Pyx_GOTREF(__pyx_t_1);
7707  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7708  __pyx_r = __pyx_t_1;
7709  __pyx_t_1 = 0;
7710  goto __pyx_L0;
7711 
7712  /* "WaveTools.py":375
7713  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
7714  * return amplitude*cos(phase)
7715  * def Udrift(amp,gAbs,c,d): # <<<<<<<<<<<<<<
7716  * """Calculates the 2nd order Stokes drift for a linear mode
7717  *
7718  */
7719 
7720  /* function exit code */
7721  __pyx_L1_error:;
7722  __Pyx_XDECREF(__pyx_t_1);
7723  __Pyx_XDECREF(__pyx_t_2);
7724  __Pyx_AddTraceback("WaveTools.Udrift", __pyx_clineno, __pyx_lineno, __pyx_filename);
7725  __pyx_r = NULL;
7726  __pyx_L0:;
7727  __Pyx_XGIVEREF(__pyx_r);
7728  __Pyx_RefNannyFinishContext();
7729  return __pyx_r;
7730 }
7731 
7732 /* "WaveTools.py":397
7733  * return 0.5*gAbs*amp*amp/c/d
7734  *
7735  * def vel_mode(x, t, kDir, kAbs, omega, phi, amplitude, mwl, depth, vDir, gAbs): # <<<<<<<<<<<<<<
7736  * """Calculates the wave velocity components for a single frequency mode
7737  *
7738  */
7739 
7740 /* Python wrapper */
7741 static PyObject *__pyx_pw_9WaveTools_31vel_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7742 static char __pyx_doc_9WaveTools_30vel_mode[] = "Calculates the wave velocity components for a single frequency mode\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n kDir : numpy.ndarray\n Wave number vector\n kAbs : floatkAbs\n Wave number magnitude\n omega : float\n Angular frequency\n phi : float\n Description: Wave phase\n amplidute : float\n Description: Wave amplitude\n mwl : float\n Mean water level\n depth : float\n Water depth\n vDir : numpy.ndarray\n Unit vector aligned with vertical direction\n\n\n Returns\n --------\n numpy.ndarray\n 1D Numpy array of the velocity vector at x,t\n ";
7743 static PyMethodDef __pyx_mdef_9WaveTools_31vel_mode = {"vel_mode", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_31vel_mode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_30vel_mode};
7744 static PyObject *__pyx_pw_9WaveTools_31vel_mode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7745  PyObject *__pyx_v_x = 0;
7746  PyObject *__pyx_v_t = 0;
7747  PyObject *__pyx_v_kDir = 0;
7748  PyObject *__pyx_v_kAbs = 0;
7749  PyObject *__pyx_v_omega = 0;
7750  PyObject *__pyx_v_phi = 0;
7751  PyObject *__pyx_v_amplitude = 0;
7752  PyObject *__pyx_v_mwl = 0;
7753  PyObject *__pyx_v_depth = 0;
7754  PyObject *__pyx_v_vDir = 0;
7755  PyObject *__pyx_v_gAbs = 0;
7756  PyObject *__pyx_r = 0;
7757  __Pyx_RefNannyDeclarations
7758  __Pyx_RefNannySetupContext("vel_mode (wrapper)", 0);
7759  {
7760  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_kDir,&__pyx_n_s_kAbs,&__pyx_n_s_omega,&__pyx_n_s_phi,&__pyx_n_s_amplitude,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_vDir,&__pyx_n_s_gAbs,0};
7761  PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
7762  if (unlikely(__pyx_kwds)) {
7763  Py_ssize_t kw_args;
7764  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7765  switch (pos_args) {
7766  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7767  CYTHON_FALLTHROUGH;
7768  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7769  CYTHON_FALLTHROUGH;
7770  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7771  CYTHON_FALLTHROUGH;
7772  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7773  CYTHON_FALLTHROUGH;
7774  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7775  CYTHON_FALLTHROUGH;
7776  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7777  CYTHON_FALLTHROUGH;
7778  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7779  CYTHON_FALLTHROUGH;
7780  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7781  CYTHON_FALLTHROUGH;
7782  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7783  CYTHON_FALLTHROUGH;
7784  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7785  CYTHON_FALLTHROUGH;
7786  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7787  CYTHON_FALLTHROUGH;
7788  case 0: break;
7789  default: goto __pyx_L5_argtuple_error;
7790  }
7791  kw_args = PyDict_Size(__pyx_kwds);
7792  switch (pos_args) {
7793  case 0:
7794  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7795  else goto __pyx_L5_argtuple_error;
7796  CYTHON_FALLTHROUGH;
7797  case 1:
7798  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7799  else {
7800  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 1); __PYX_ERR(0, 397, __pyx_L3_error)
7801  }
7802  CYTHON_FALLTHROUGH;
7803  case 2:
7804  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kDir)) != 0)) kw_args--;
7805  else {
7806  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 2); __PYX_ERR(0, 397, __pyx_L3_error)
7807  }
7808  CYTHON_FALLTHROUGH;
7809  case 3:
7810  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kAbs)) != 0)) kw_args--;
7811  else {
7812  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 3); __PYX_ERR(0, 397, __pyx_L3_error)
7813  }
7814  CYTHON_FALLTHROUGH;
7815  case 4:
7816  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
7817  else {
7818  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 4); __PYX_ERR(0, 397, __pyx_L3_error)
7819  }
7820  CYTHON_FALLTHROUGH;
7821  case 5:
7822  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
7823  else {
7824  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 5); __PYX_ERR(0, 397, __pyx_L3_error)
7825  }
7826  CYTHON_FALLTHROUGH;
7827  case 6:
7828  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_amplitude)) != 0)) kw_args--;
7829  else {
7830  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 6); __PYX_ERR(0, 397, __pyx_L3_error)
7831  }
7832  CYTHON_FALLTHROUGH;
7833  case 7:
7834  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
7835  else {
7836  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 7); __PYX_ERR(0, 397, __pyx_L3_error)
7837  }
7838  CYTHON_FALLTHROUGH;
7839  case 8:
7840  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
7841  else {
7842  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 8); __PYX_ERR(0, 397, __pyx_L3_error)
7843  }
7844  CYTHON_FALLTHROUGH;
7845  case 9:
7846  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vDir)) != 0)) kw_args--;
7847  else {
7848  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 9); __PYX_ERR(0, 397, __pyx_L3_error)
7849  }
7850  CYTHON_FALLTHROUGH;
7851  case 10:
7852  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gAbs)) != 0)) kw_args--;
7853  else {
7854  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, 10); __PYX_ERR(0, 397, __pyx_L3_error)
7855  }
7856  }
7857  if (unlikely(kw_args > 0)) {
7858  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vel_mode") < 0)) __PYX_ERR(0, 397, __pyx_L3_error)
7859  }
7860  } else if (PyTuple_GET_SIZE(__pyx_args) != 11) {
7861  goto __pyx_L5_argtuple_error;
7862  } else {
7863  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7864  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7865  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7866  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7867  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7868  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7869  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7870  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7871  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7872  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7873  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7874  }
7875  __pyx_v_x = values[0];
7876  __pyx_v_t = values[1];
7877  __pyx_v_kDir = values[2];
7878  __pyx_v_kAbs = values[3];
7879  __pyx_v_omega = values[4];
7880  __pyx_v_phi = values[5];
7881  __pyx_v_amplitude = values[6];
7882  __pyx_v_mwl = values[7];
7883  __pyx_v_depth = values[8];
7884  __pyx_v_vDir = values[9];
7885  __pyx_v_gAbs = values[10];
7886  }
7887  goto __pyx_L4_argument_unpacking_done;
7888  __pyx_L5_argtuple_error:;
7889  __Pyx_RaiseArgtupleInvalid("vel_mode", 1, 11, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 397, __pyx_L3_error)
7890  __pyx_L3_error:;
7891  __Pyx_AddTraceback("WaveTools.vel_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
7892  __Pyx_RefNannyFinishContext();
7893  return NULL;
7894  __pyx_L4_argument_unpacking_done:;
7895  __pyx_r = __pyx_pf_9WaveTools_30vel_mode(__pyx_self, __pyx_v_x, __pyx_v_t, __pyx_v_kDir, __pyx_v_kAbs, __pyx_v_omega, __pyx_v_phi, __pyx_v_amplitude, __pyx_v_mwl, __pyx_v_depth, __pyx_v_vDir, __pyx_v_gAbs);
7896 
7897  /* function exit code */
7898  __Pyx_RefNannyFinishContext();
7899  return __pyx_r;
7900 }
7901 
7902 static PyObject *__pyx_pf_9WaveTools_30vel_mode(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t, PyObject *__pyx_v_kDir, PyObject *__pyx_v_kAbs, PyObject *__pyx_v_omega, PyObject *__pyx_v_phi, PyObject *__pyx_v_amplitude, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_vDir, PyObject *__pyx_v_gAbs) {
7903  PyObject *__pyx_v_phase = NULL;
7904  PyObject *__pyx_v_Z = NULL;
7905  PyObject *__pyx_v_UH = NULL;
7906  PyObject *__pyx_v_UV = NULL;
7907  CYTHON_UNUSED double __pyx_v_ii;
7908  PyObject *__pyx_v_waveDir = NULL;
7909  PyObject *__pyx_v_V = NULL;
7910  PyObject *__pyx_r = NULL;
7911  __Pyx_RefNannyDeclarations
7912  PyObject *__pyx_t_1 = NULL;
7913  PyObject *__pyx_t_2 = NULL;
7914  PyObject *__pyx_t_3 = NULL;
7915  PyObject *__pyx_t_4 = NULL;
7916  double __pyx_t_5;
7917  int __pyx_t_6;
7918  PyObject *__pyx_t_7 = NULL;
7919  PyObject *__pyx_t_8 = NULL;
7920  PyObject *__pyx_t_9 = NULL;
7921  __Pyx_RefNannySetupContext("vel_mode", 0);
7922 
7923  /* "WaveTools.py":430
7924  * """
7925  *
7926  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi # <<<<<<<<<<<<<<
7927  * Z = (vDir[0]*x[0] + vDir[1]*x[1]+ vDir[2]*x[2]) - mwl
7928  * UH = 0.
7929  */
7930  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
7931  __Pyx_GOTREF(__pyx_t_1);
7932  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_kDir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
7933  __Pyx_GOTREF(__pyx_t_2);
7934  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
7935  __Pyx_GOTREF(__pyx_t_3);
7936  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7937  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7938  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
7939  __Pyx_GOTREF(__pyx_t_2);
7940  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_kDir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
7941  __Pyx_GOTREF(__pyx_t_1);
7942  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
7943  __Pyx_GOTREF(__pyx_t_4);
7944  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7945  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7946  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
7947  __Pyx_GOTREF(__pyx_t_1);
7948  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7949  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7950  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
7951  __Pyx_GOTREF(__pyx_t_4);
7952  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_kDir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
7953  __Pyx_GOTREF(__pyx_t_3);
7954  __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
7955  __Pyx_GOTREF(__pyx_t_2);
7956  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7957  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7958  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
7959  __Pyx_GOTREF(__pyx_t_3);
7960  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7961  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7962  __pyx_t_2 = PyNumber_Multiply(__pyx_v_omega, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
7963  __Pyx_GOTREF(__pyx_t_2);
7964  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
7965  __Pyx_GOTREF(__pyx_t_1);
7966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7967  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7968  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_phi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
7969  __Pyx_GOTREF(__pyx_t_2);
7970  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7971  __pyx_v_phase = __pyx_t_2;
7972  __pyx_t_2 = 0;
7973 
7974  /* "WaveTools.py":431
7975  *
7976  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
7977  * Z = (vDir[0]*x[0] + vDir[1]*x[1]+ vDir[2]*x[2]) - mwl # <<<<<<<<<<<<<<
7978  * UH = 0.
7979  * UV=0.
7980  */
7981  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vDir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
7982  __Pyx_GOTREF(__pyx_t_2);
7983  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
7984  __Pyx_GOTREF(__pyx_t_1);
7985  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
7986  __Pyx_GOTREF(__pyx_t_3);
7987  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7988  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7989  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_vDir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
7990  __Pyx_GOTREF(__pyx_t_1);
7991  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
7992  __Pyx_GOTREF(__pyx_t_2);
7993  __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
7994  __Pyx_GOTREF(__pyx_t_4);
7995  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7996  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7997  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
7998  __Pyx_GOTREF(__pyx_t_2);
7999  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8000  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8001  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vDir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
8002  __Pyx_GOTREF(__pyx_t_4);
8003  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
8004  __Pyx_GOTREF(__pyx_t_3);
8005  __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
8006  __Pyx_GOTREF(__pyx_t_1);
8007  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8008  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8009  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
8010  __Pyx_GOTREF(__pyx_t_3);
8011  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8012  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8013  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_v_mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
8014  __Pyx_GOTREF(__pyx_t_1);
8015  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8016  __pyx_v_Z = __pyx_t_1;
8017  __pyx_t_1 = 0;
8018 
8019  /* "WaveTools.py":432
8020  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
8021  * Z = (vDir[0]*x[0] + vDir[1]*x[1]+ vDir[2]*x[2]) - mwl
8022  * UH = 0. # <<<<<<<<<<<<<<
8023  * UV=0.
8024  * ii=0.
8025  */
8026  __Pyx_INCREF(__pyx_float_0_);
8027  __pyx_v_UH = __pyx_float_0_;
8028 
8029  /* "WaveTools.py":433
8030  * Z = (vDir[0]*x[0] + vDir[1]*x[1]+ vDir[2]*x[2]) - mwl
8031  * UH = 0.
8032  * UV=0. # <<<<<<<<<<<<<<
8033  * ii=0.
8034  * UH=amplitude*omega*cosh(kAbs*(Z + depth))*cos( phase )/sinh(kAbs*depth)
8035  */
8036  __Pyx_INCREF(__pyx_float_0_);
8037  __pyx_v_UV = __pyx_float_0_;
8038 
8039  /* "WaveTools.py":434
8040  * UH = 0.
8041  * UV=0.
8042  * ii=0. # <<<<<<<<<<<<<<
8043  * UH=amplitude*omega*cosh(kAbs*(Z + depth))*cos( phase )/sinh(kAbs*depth)
8044  * UV=amplitude*omega*sinh(kAbs*(Z + depth))*sin( phase )/sinh(kAbs*depth)
8045  */
8046  __pyx_v_ii = 0.;
8047 
8048  /* "WaveTools.py":435
8049  * UV=0.
8050  * ii=0.
8051  * UH=amplitude*omega*cosh(kAbs*(Z + depth))*cos( phase )/sinh(kAbs*depth) # <<<<<<<<<<<<<<
8052  * UV=amplitude*omega*sinh(kAbs*(Z + depth))*sin( phase )/sinh(kAbs*depth)
8053  * waveDir = old_div(kDir,kAbs)
8054  */
8055  __pyx_t_1 = PyNumber_Multiply(__pyx_v_amplitude, __pyx_v_omega); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
8056  __Pyx_GOTREF(__pyx_t_1);
8057  __pyx_t_3 = PyNumber_Add(__pyx_v_Z, __pyx_v_depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
8058  __Pyx_GOTREF(__pyx_t_3);
8059  __pyx_t_2 = PyNumber_Multiply(__pyx_v_kAbs, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
8060  __Pyx_GOTREF(__pyx_t_2);
8061  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8062  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
8063  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8064  __pyx_t_2 = PyFloat_FromDouble(cosh(__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
8065  __Pyx_GOTREF(__pyx_t_2);
8066  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
8067  __Pyx_GOTREF(__pyx_t_3);
8068  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8069  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8070  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
8071  __pyx_t_2 = PyFloat_FromDouble(cos(__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
8072  __Pyx_GOTREF(__pyx_t_2);
8073  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
8074  __Pyx_GOTREF(__pyx_t_1);
8075  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8076  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8077  __pyx_t_2 = PyNumber_Multiply(__pyx_v_kAbs, __pyx_v_depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
8078  __Pyx_GOTREF(__pyx_t_2);
8079  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
8080  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8081  __pyx_t_2 = PyFloat_FromDouble(sinh(__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
8082  __Pyx_GOTREF(__pyx_t_2);
8083  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
8084  __Pyx_GOTREF(__pyx_t_3);
8085  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8086  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8087  __Pyx_DECREF_SET(__pyx_v_UH, __pyx_t_3);
8088  __pyx_t_3 = 0;
8089 
8090  /* "WaveTools.py":436
8091  * ii=0.
8092  * UH=amplitude*omega*cosh(kAbs*(Z + depth))*cos( phase )/sinh(kAbs*depth)
8093  * UV=amplitude*omega*sinh(kAbs*(Z + depth))*sin( phase )/sinh(kAbs*depth) # <<<<<<<<<<<<<<
8094  * waveDir = old_div(kDir,kAbs)
8095  * UH = UH - Udrift(amplitude,gAbs,old_div(omega,kAbs),depth)
8096  */
8097  __pyx_t_3 = PyNumber_Multiply(__pyx_v_amplitude, __pyx_v_omega); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
8098  __Pyx_GOTREF(__pyx_t_3);
8099  __pyx_t_2 = PyNumber_Add(__pyx_v_Z, __pyx_v_depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
8100  __Pyx_GOTREF(__pyx_t_2);
8101  __pyx_t_1 = PyNumber_Multiply(__pyx_v_kAbs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
8102  __Pyx_GOTREF(__pyx_t_1);
8103  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8104  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
8105  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8106  __pyx_t_1 = PyFloat_FromDouble(sinh(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
8107  __Pyx_GOTREF(__pyx_t_1);
8108  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
8109  __Pyx_GOTREF(__pyx_t_2);
8110  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8111  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8112  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_phase); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
8113  __pyx_t_1 = PyFloat_FromDouble(sin(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
8114  __Pyx_GOTREF(__pyx_t_1);
8115  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error)
8116  __Pyx_GOTREF(__pyx_t_3);
8117  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8118  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8119  __pyx_t_1 = PyNumber_Multiply(__pyx_v_kAbs, __pyx_v_depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
8120  __Pyx_GOTREF(__pyx_t_1);
8121  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
8122  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8123  __pyx_t_1 = PyFloat_FromDouble(sinh(__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
8124  __Pyx_GOTREF(__pyx_t_1);
8125  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
8126  __Pyx_GOTREF(__pyx_t_2);
8127  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8128  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8129  __Pyx_DECREF_SET(__pyx_v_UV, __pyx_t_2);
8130  __pyx_t_2 = 0;
8131 
8132  /* "WaveTools.py":437
8133  * UH=amplitude*omega*cosh(kAbs*(Z + depth))*cos( phase )/sinh(kAbs*depth)
8134  * UV=amplitude*omega*sinh(kAbs*(Z + depth))*sin( phase )/sinh(kAbs*depth)
8135  * waveDir = old_div(kDir,kAbs) # <<<<<<<<<<<<<<
8136  * UH = UH - Udrift(amplitude,gAbs,old_div(omega,kAbs),depth)
8137  * #waves(period = 1./self.fi[ii], waveHeight = 2.*self.ai[ii],mwl = self.mwl, depth = self.d,g = self.g,waveDir = self.waveDir,wavelength=self.wi[ii], phi0 = self.phi[ii]).u(x,y,z,t)
8138  */
8139  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
8140  __Pyx_GOTREF(__pyx_t_1);
8141  __pyx_t_3 = NULL;
8142  __pyx_t_6 = 0;
8143  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
8144  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
8145  if (likely(__pyx_t_3)) {
8146  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
8147  __Pyx_INCREF(__pyx_t_3);
8148  __Pyx_INCREF(function);
8149  __Pyx_DECREF_SET(__pyx_t_1, function);
8150  __pyx_t_6 = 1;
8151  }
8152  }
8153  #if CYTHON_FAST_PYCALL
8154  if (PyFunction_Check(__pyx_t_1)) {
8155  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_kDir, __pyx_v_kAbs};
8156  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
8157  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8158  __Pyx_GOTREF(__pyx_t_2);
8159  } else
8160  #endif
8161  #if CYTHON_FAST_PYCCALL
8162  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
8163  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_kDir, __pyx_v_kAbs};
8164  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
8165  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8166  __Pyx_GOTREF(__pyx_t_2);
8167  } else
8168  #endif
8169  {
8170  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
8171  __Pyx_GOTREF(__pyx_t_4);
8172  if (__pyx_t_3) {
8173  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
8174  }
8175  __Pyx_INCREF(__pyx_v_kDir);
8176  __Pyx_GIVEREF(__pyx_v_kDir);
8177  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_kDir);
8178  __Pyx_INCREF(__pyx_v_kAbs);
8179  __Pyx_GIVEREF(__pyx_v_kAbs);
8180  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_kAbs);
8181  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
8182  __Pyx_GOTREF(__pyx_t_2);
8183  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8184  }
8185  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8186  __pyx_v_waveDir = __pyx_t_2;
8187  __pyx_t_2 = 0;
8188 
8189  /* "WaveTools.py":438
8190  * UV=amplitude*omega*sinh(kAbs*(Z + depth))*sin( phase )/sinh(kAbs*depth)
8191  * waveDir = old_div(kDir,kAbs)
8192  * UH = UH - Udrift(amplitude,gAbs,old_div(omega,kAbs),depth) # <<<<<<<<<<<<<<
8193  * #waves(period = 1./self.fi[ii], waveHeight = 2.*self.ai[ii],mwl = self.mwl, depth = self.d,g = self.g,waveDir = self.waveDir,wavelength=self.wi[ii], phi0 = self.phi[ii]).u(x,y,z,t)
8194  * V = np.array([UH*waveDir[0]+UV*vDir[0],
8195  */
8196  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Udrift); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
8197  __Pyx_GOTREF(__pyx_t_1);
8198  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error)
8199  __Pyx_GOTREF(__pyx_t_3);
8200  __pyx_t_7 = NULL;
8201  __pyx_t_6 = 0;
8202  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8203  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
8204  if (likely(__pyx_t_7)) {
8205  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8206  __Pyx_INCREF(__pyx_t_7);
8207  __Pyx_INCREF(function);
8208  __Pyx_DECREF_SET(__pyx_t_3, function);
8209  __pyx_t_6 = 1;
8210  }
8211  }
8212  #if CYTHON_FAST_PYCALL
8213  if (PyFunction_Check(__pyx_t_3)) {
8214  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_omega, __pyx_v_kAbs};
8215  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
8216  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8217  __Pyx_GOTREF(__pyx_t_4);
8218  } else
8219  #endif
8220  #if CYTHON_FAST_PYCCALL
8221  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8222  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_omega, __pyx_v_kAbs};
8223  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
8224  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8225  __Pyx_GOTREF(__pyx_t_4);
8226  } else
8227  #endif
8228  {
8229  __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
8230  __Pyx_GOTREF(__pyx_t_8);
8231  if (__pyx_t_7) {
8232  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
8233  }
8234  __Pyx_INCREF(__pyx_v_omega);
8235  __Pyx_GIVEREF(__pyx_v_omega);
8236  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_omega);
8237  __Pyx_INCREF(__pyx_v_kAbs);
8238  __Pyx_GIVEREF(__pyx_v_kAbs);
8239  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_kAbs);
8240  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error)
8241  __Pyx_GOTREF(__pyx_t_4);
8242  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8243  }
8244  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8245  __pyx_t_3 = NULL;
8246  __pyx_t_6 = 0;
8247  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
8248  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
8249  if (likely(__pyx_t_3)) {
8250  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
8251  __Pyx_INCREF(__pyx_t_3);
8252  __Pyx_INCREF(function);
8253  __Pyx_DECREF_SET(__pyx_t_1, function);
8254  __pyx_t_6 = 1;
8255  }
8256  }
8257  #if CYTHON_FAST_PYCALL
8258  if (PyFunction_Check(__pyx_t_1)) {
8259  PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_amplitude, __pyx_v_gAbs, __pyx_t_4, __pyx_v_depth};
8260  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
8261  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8262  __Pyx_GOTREF(__pyx_t_2);
8263  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8264  } else
8265  #endif
8266  #if CYTHON_FAST_PYCCALL
8267  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
8268  PyObject *__pyx_temp[5] = {__pyx_t_3, __pyx_v_amplitude, __pyx_v_gAbs, __pyx_t_4, __pyx_v_depth};
8269  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
8270  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8271  __Pyx_GOTREF(__pyx_t_2);
8272  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8273  } else
8274  #endif
8275  {
8276  __pyx_t_8 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error)
8277  __Pyx_GOTREF(__pyx_t_8);
8278  if (__pyx_t_3) {
8279  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
8280  }
8281  __Pyx_INCREF(__pyx_v_amplitude);
8282  __Pyx_GIVEREF(__pyx_v_amplitude);
8283  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_v_amplitude);
8284  __Pyx_INCREF(__pyx_v_gAbs);
8285  __Pyx_GIVEREF(__pyx_v_gAbs);
8286  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_v_gAbs);
8287  __Pyx_GIVEREF(__pyx_t_4);
8288  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_6, __pyx_t_4);
8289  __Pyx_INCREF(__pyx_v_depth);
8290  __Pyx_GIVEREF(__pyx_v_depth);
8291  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_6, __pyx_v_depth);
8292  __pyx_t_4 = 0;
8293  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
8294  __Pyx_GOTREF(__pyx_t_2);
8295  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8296  }
8297  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8298  __pyx_t_1 = PyNumber_Subtract(__pyx_v_UH, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error)
8299  __Pyx_GOTREF(__pyx_t_1);
8300  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8301  __Pyx_DECREF_SET(__pyx_v_UH, __pyx_t_1);
8302  __pyx_t_1 = 0;
8303 
8304  /* "WaveTools.py":440
8305  * UH = UH - Udrift(amplitude,gAbs,old_div(omega,kAbs),depth)
8306  * #waves(period = 1./self.fi[ii], waveHeight = 2.*self.ai[ii],mwl = self.mwl, depth = self.d,g = self.g,waveDir = self.waveDir,wavelength=self.wi[ii], phi0 = self.phi[ii]).u(x,y,z,t)
8307  * V = np.array([UH*waveDir[0]+UV*vDir[0], # <<<<<<<<<<<<<<
8308  * UH*waveDir[1]+UV*vDir[1],
8309  * UH*waveDir[2]+UV*vDir[2]])
8310  */
8311  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
8312  __Pyx_GOTREF(__pyx_t_2);
8313  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 440, __pyx_L1_error)
8314  __Pyx_GOTREF(__pyx_t_8);
8315  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8316  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_waveDir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
8317  __Pyx_GOTREF(__pyx_t_2);
8318  __pyx_t_4 = PyNumber_Multiply(__pyx_v_UH, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error)
8319  __Pyx_GOTREF(__pyx_t_4);
8320  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8321  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vDir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
8322  __Pyx_GOTREF(__pyx_t_2);
8323  __pyx_t_3 = PyNumber_Multiply(__pyx_v_UV, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
8324  __Pyx_GOTREF(__pyx_t_3);
8325  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8326  __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
8327  __Pyx_GOTREF(__pyx_t_2);
8328  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8329  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8330 
8331  /* "WaveTools.py":441
8332  * #waves(period = 1./self.fi[ii], waveHeight = 2.*self.ai[ii],mwl = self.mwl, depth = self.d,g = self.g,waveDir = self.waveDir,wavelength=self.wi[ii], phi0 = self.phi[ii]).u(x,y,z,t)
8333  * V = np.array([UH*waveDir[0]+UV*vDir[0],
8334  * UH*waveDir[1]+UV*vDir[1], # <<<<<<<<<<<<<<
8335  * UH*waveDir[2]+UV*vDir[2]])
8336  * return V
8337  */
8338  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_waveDir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
8339  __Pyx_GOTREF(__pyx_t_3);
8340  __pyx_t_4 = PyNumber_Multiply(__pyx_v_UH, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 441, __pyx_L1_error)
8341  __Pyx_GOTREF(__pyx_t_4);
8342  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8343  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vDir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
8344  __Pyx_GOTREF(__pyx_t_3);
8345  __pyx_t_7 = PyNumber_Multiply(__pyx_v_UV, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error)
8346  __Pyx_GOTREF(__pyx_t_7);
8347  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8348  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
8349  __Pyx_GOTREF(__pyx_t_3);
8350  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8351  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8352 
8353  /* "WaveTools.py":442
8354  * V = np.array([UH*waveDir[0]+UV*vDir[0],
8355  * UH*waveDir[1]+UV*vDir[1],
8356  * UH*waveDir[2]+UV*vDir[2]]) # <<<<<<<<<<<<<<
8357  * return V
8358  *
8359  */
8360  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_waveDir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
8361  __Pyx_GOTREF(__pyx_t_7);
8362  __pyx_t_4 = PyNumber_Multiply(__pyx_v_UH, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 442, __pyx_L1_error)
8363  __Pyx_GOTREF(__pyx_t_4);
8364  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8365  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_vDir, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
8366  __Pyx_GOTREF(__pyx_t_7);
8367  __pyx_t_9 = PyNumber_Multiply(__pyx_v_UV, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 442, __pyx_L1_error)
8368  __Pyx_GOTREF(__pyx_t_9);
8369  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8370  __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error)
8371  __Pyx_GOTREF(__pyx_t_7);
8372  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8373  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8374 
8375  /* "WaveTools.py":440
8376  * UH = UH - Udrift(amplitude,gAbs,old_div(omega,kAbs),depth)
8377  * #waves(period = 1./self.fi[ii], waveHeight = 2.*self.ai[ii],mwl = self.mwl, depth = self.d,g = self.g,waveDir = self.waveDir,wavelength=self.wi[ii], phi0 = self.phi[ii]).u(x,y,z,t)
8378  * V = np.array([UH*waveDir[0]+UV*vDir[0], # <<<<<<<<<<<<<<
8379  * UH*waveDir[1]+UV*vDir[1],
8380  * UH*waveDir[2]+UV*vDir[2]])
8381  */
8382  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 440, __pyx_L1_error)
8383  __Pyx_GOTREF(__pyx_t_9);
8384  __Pyx_GIVEREF(__pyx_t_2);
8385  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
8386  __Pyx_GIVEREF(__pyx_t_3);
8387  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
8388  __Pyx_GIVEREF(__pyx_t_7);
8389  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
8390  __pyx_t_2 = 0;
8391  __pyx_t_3 = 0;
8392  __pyx_t_7 = 0;
8393  __pyx_t_7 = NULL;
8394  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8395  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
8396  if (likely(__pyx_t_7)) {
8397  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8398  __Pyx_INCREF(__pyx_t_7);
8399  __Pyx_INCREF(function);
8400  __Pyx_DECREF_SET(__pyx_t_8, function);
8401  }
8402  }
8403  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
8404  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8405  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8406  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
8407  __Pyx_GOTREF(__pyx_t_1);
8408  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8409  __pyx_v_V = __pyx_t_1;
8410  __pyx_t_1 = 0;
8411 
8412  /* "WaveTools.py":443
8413  * UH*waveDir[1]+UV*vDir[1],
8414  * UH*waveDir[2]+UV*vDir[2]])
8415  * return V # <<<<<<<<<<<<<<
8416  *
8417  *
8418  */
8419  __Pyx_XDECREF(__pyx_r);
8420  __Pyx_INCREF(__pyx_v_V);
8421  __pyx_r = __pyx_v_V;
8422  goto __pyx_L0;
8423 
8424  /* "WaveTools.py":397
8425  * return 0.5*gAbs*amp*amp/c/d
8426  *
8427  * def vel_mode(x, t, kDir, kAbs, omega, phi, amplitude, mwl, depth, vDir, gAbs): # <<<<<<<<<<<<<<
8428  * """Calculates the wave velocity components for a single frequency mode
8429  *
8430  */
8431 
8432  /* function exit code */
8433  __pyx_L1_error:;
8434  __Pyx_XDECREF(__pyx_t_1);
8435  __Pyx_XDECREF(__pyx_t_2);
8436  __Pyx_XDECREF(__pyx_t_3);
8437  __Pyx_XDECREF(__pyx_t_4);
8438  __Pyx_XDECREF(__pyx_t_7);
8439  __Pyx_XDECREF(__pyx_t_8);
8440  __Pyx_XDECREF(__pyx_t_9);
8441  __Pyx_AddTraceback("WaveTools.vel_mode", __pyx_clineno, __pyx_lineno, __pyx_filename);
8442  __pyx_r = NULL;
8443  __pyx_L0:;
8444  __Pyx_XDECREF(__pyx_v_phase);
8445  __Pyx_XDECREF(__pyx_v_Z);
8446  __Pyx_XDECREF(__pyx_v_UH);
8447  __Pyx_XDECREF(__pyx_v_UV);
8448  __Pyx_XDECREF(__pyx_v_waveDir);
8449  __Pyx_XDECREF(__pyx_v_V);
8450  __Pyx_XGIVEREF(__pyx_r);
8451  __Pyx_RefNannyFinishContext();
8452  return __pyx_r;
8453 }
8454 
8455 /* "WaveTools.py":447
8456  *
8457  *
8458  * def sigma(omega,omega0): # <<<<<<<<<<<<<<
8459  * """Calculates sigma function for JONSWAP spectrum
8460  *
8461  */
8462 
8463 /* Python wrapper */
8464 static PyObject *__pyx_pw_9WaveTools_33sigma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8465 static char __pyx_doc_9WaveTools_32sigma[] = "Calculates sigma function for JONSWAP spectrum\n\n See http://www.wikiwaves.org/Ocean-Wave_Sectra\n Parameters\n ----------\n omega : numpy.ndarray\n Angular frequency array\n omega0 : numpy.ndarray\n Peak angular frequency\n Returns\n --------\n numpy.ndarray\n 1D Numpy array of simga function with respect to f\n\n ";
8466 static PyMethodDef __pyx_mdef_9WaveTools_33sigma = {"sigma", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_33sigma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_32sigma};
8467 static PyObject *__pyx_pw_9WaveTools_33sigma(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8468  PyObject *__pyx_v_omega = 0;
8469  PyObject *__pyx_v_omega0 = 0;
8470  PyObject *__pyx_r = 0;
8471  __Pyx_RefNannyDeclarations
8472  __Pyx_RefNannySetupContext("sigma (wrapper)", 0);
8473  {
8474  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_omega,&__pyx_n_s_omega0,0};
8475  PyObject* values[2] = {0,0};
8476  if (unlikely(__pyx_kwds)) {
8477  Py_ssize_t kw_args;
8478  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8479  switch (pos_args) {
8480  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8481  CYTHON_FALLTHROUGH;
8482  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8483  CYTHON_FALLTHROUGH;
8484  case 0: break;
8485  default: goto __pyx_L5_argtuple_error;
8486  }
8487  kw_args = PyDict_Size(__pyx_kwds);
8488  switch (pos_args) {
8489  case 0:
8490  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega)) != 0)) kw_args--;
8491  else goto __pyx_L5_argtuple_error;
8492  CYTHON_FALLTHROUGH;
8493  case 1:
8494  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_omega0)) != 0)) kw_args--;
8495  else {
8496  __Pyx_RaiseArgtupleInvalid("sigma", 1, 2, 2, 1); __PYX_ERR(0, 447, __pyx_L3_error)
8497  }
8498  }
8499  if (unlikely(kw_args > 0)) {
8500  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sigma") < 0)) __PYX_ERR(0, 447, __pyx_L3_error)
8501  }
8502  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
8503  goto __pyx_L5_argtuple_error;
8504  } else {
8505  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8506  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8507  }
8508  __pyx_v_omega = values[0];
8509  __pyx_v_omega0 = values[1];
8510  }
8511  goto __pyx_L4_argument_unpacking_done;
8512  __pyx_L5_argtuple_error:;
8513  __Pyx_RaiseArgtupleInvalid("sigma", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 447, __pyx_L3_error)
8514  __pyx_L3_error:;
8515  __Pyx_AddTraceback("WaveTools.sigma", __pyx_clineno, __pyx_lineno, __pyx_filename);
8516  __Pyx_RefNannyFinishContext();
8517  return NULL;
8518  __pyx_L4_argument_unpacking_done:;
8519  __pyx_r = __pyx_pf_9WaveTools_32sigma(__pyx_self, __pyx_v_omega, __pyx_v_omega0);
8520 
8521  /* function exit code */
8522  __Pyx_RefNannyFinishContext();
8523  return __pyx_r;
8524 }
8525 
8526 static PyObject *__pyx_pf_9WaveTools_32sigma(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_omega, PyObject *__pyx_v_omega0) {
8527  PyObject *__pyx_v_sigmaReturn = NULL;
8528  PyObject *__pyx_r = NULL;
8529  __Pyx_RefNannyDeclarations
8530  PyObject *__pyx_t_1 = NULL;
8531  PyObject *__pyx_t_2 = NULL;
8532  PyObject *__pyx_t_3 = NULL;
8533  PyObject *__pyx_t_4 = NULL;
8534  int __pyx_t_5;
8535  PyObject *__pyx_t_6 = NULL;
8536  __Pyx_RefNannySetupContext("sigma", 0);
8537 
8538  /* "WaveTools.py":463
8539  *
8540  * """
8541  * sigmaReturn = np.where(omega > omega0,0.09,0.07) # <<<<<<<<<<<<<<
8542  * return sigmaReturn
8543  *
8544  */
8545  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
8546  __Pyx_GOTREF(__pyx_t_2);
8547  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
8548  __Pyx_GOTREF(__pyx_t_3);
8549  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8550  __pyx_t_2 = PyObject_RichCompare(__pyx_v_omega, __pyx_v_omega0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
8551  __pyx_t_4 = NULL;
8552  __pyx_t_5 = 0;
8553  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8554  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
8555  if (likely(__pyx_t_4)) {
8556  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8557  __Pyx_INCREF(__pyx_t_4);
8558  __Pyx_INCREF(function);
8559  __Pyx_DECREF_SET(__pyx_t_3, function);
8560  __pyx_t_5 = 1;
8561  }
8562  }
8563  #if CYTHON_FAST_PYCALL
8564  if (PyFunction_Check(__pyx_t_3)) {
8565  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_float_0_09, __pyx_float_0_07};
8566  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
8567  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8568  __Pyx_GOTREF(__pyx_t_1);
8569  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8570  } else
8571  #endif
8572  #if CYTHON_FAST_PYCCALL
8573  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8574  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_2, __pyx_float_0_09, __pyx_float_0_07};
8575  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
8576  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8577  __Pyx_GOTREF(__pyx_t_1);
8578  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8579  } else
8580  #endif
8581  {
8582  __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 463, __pyx_L1_error)
8583  __Pyx_GOTREF(__pyx_t_6);
8584  if (__pyx_t_4) {
8585  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
8586  }
8587  __Pyx_GIVEREF(__pyx_t_2);
8588  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
8589  __Pyx_INCREF(__pyx_float_0_09);
8590  __Pyx_GIVEREF(__pyx_float_0_09);
8591  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_float_0_09);
8592  __Pyx_INCREF(__pyx_float_0_07);
8593  __Pyx_GIVEREF(__pyx_float_0_07);
8594  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_float_0_07);
8595  __pyx_t_2 = 0;
8596  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
8597  __Pyx_GOTREF(__pyx_t_1);
8598  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8599  }
8600  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8601  __pyx_v_sigmaReturn = __pyx_t_1;
8602  __pyx_t_1 = 0;
8603 
8604  /* "WaveTools.py":464
8605  * """
8606  * sigmaReturn = np.where(omega > omega0,0.09,0.07)
8607  * return sigmaReturn # <<<<<<<<<<<<<<
8608  *
8609  *
8610  */
8611  __Pyx_XDECREF(__pyx_r);
8612  __Pyx_INCREF(__pyx_v_sigmaReturn);
8613  __pyx_r = __pyx_v_sigmaReturn;
8614  goto __pyx_L0;
8615 
8616  /* "WaveTools.py":447
8617  *
8618  *
8619  * def sigma(omega,omega0): # <<<<<<<<<<<<<<
8620  * """Calculates sigma function for JONSWAP spectrum
8621  *
8622  */
8623 
8624  /* function exit code */
8625  __pyx_L1_error:;
8626  __Pyx_XDECREF(__pyx_t_1);
8627  __Pyx_XDECREF(__pyx_t_2);
8628  __Pyx_XDECREF(__pyx_t_3);
8629  __Pyx_XDECREF(__pyx_t_4);
8630  __Pyx_XDECREF(__pyx_t_6);
8631  __Pyx_AddTraceback("WaveTools.sigma", __pyx_clineno, __pyx_lineno, __pyx_filename);
8632  __pyx_r = NULL;
8633  __pyx_L0:;
8634  __Pyx_XDECREF(__pyx_v_sigmaReturn);
8635  __Pyx_XGIVEREF(__pyx_r);
8636  __Pyx_RefNannyFinishContext();
8637  return __pyx_r;
8638 }
8639 
8640 /* "WaveTools.py":467
8641  *
8642  *
8643  * def JONSWAP(f,f0,Hs,gamma=3.3,TMA=False, depth = None): # <<<<<<<<<<<<<<
8644  * """Calculates the JONSWAP frequency spectrum (Goda 2009)
8645  *
8646  */
8647 
8648 /* Python wrapper */
8649 static PyObject *__pyx_pw_9WaveTools_35JONSWAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8650 static char __pyx_doc_9WaveTools_34JONSWAP[] = "Calculates the JONSWAP frequency spectrum (Goda 2009)\n\n The calculation includes the TMA modification, if TMA =True\n\n Parameters\n ----------\n f : numpy.ndarray\n Frequency array\n f0 : float\n Peak frequency\n Hs : float\n Significant wave height\n gamma : Optional[float]\n Peak enhancement factor\n TMA : bool\n Description: TMA switch\n depth : Optional[float]\n Water depth\n\n Returns\n --------\n numpy.ndarray\n 1D Numpy array of the spectrum in frequency domain\n\n ";
8651 static PyMethodDef __pyx_mdef_9WaveTools_35JONSWAP = {"JONSWAP", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_35JONSWAP, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_34JONSWAP};
8652 static PyObject *__pyx_pw_9WaveTools_35JONSWAP(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8653  PyObject *__pyx_v_f = 0;
8654  PyObject *__pyx_v_f0 = 0;
8655  PyObject *__pyx_v_Hs = 0;
8656  PyObject *__pyx_v_gamma = 0;
8657  PyObject *__pyx_v_TMA = 0;
8658  PyObject *__pyx_v_depth = 0;
8659  PyObject *__pyx_r = 0;
8660  __Pyx_RefNannyDeclarations
8661  __Pyx_RefNannySetupContext("JONSWAP (wrapper)", 0);
8662  {
8663  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_f0,&__pyx_n_s_Hs,&__pyx_n_s_gamma,&__pyx_n_s_TMA,&__pyx_n_s_depth,0};
8664  PyObject* values[6] = {0,0,0,0,0,0};
8665  values[3] = ((PyObject *)((PyObject*)__pyx_float_3_3));
8666  values[4] = ((PyObject *)((PyObject *)Py_False));
8667  values[5] = ((PyObject *)((PyObject *)Py_None));
8668  if (unlikely(__pyx_kwds)) {
8669  Py_ssize_t kw_args;
8670  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8671  switch (pos_args) {
8672  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8673  CYTHON_FALLTHROUGH;
8674  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8675  CYTHON_FALLTHROUGH;
8676  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8677  CYTHON_FALLTHROUGH;
8678  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8679  CYTHON_FALLTHROUGH;
8680  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8681  CYTHON_FALLTHROUGH;
8682  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8683  CYTHON_FALLTHROUGH;
8684  case 0: break;
8685  default: goto __pyx_L5_argtuple_error;
8686  }
8687  kw_args = PyDict_Size(__pyx_kwds);
8688  switch (pos_args) {
8689  case 0:
8690  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
8691  else goto __pyx_L5_argtuple_error;
8692  CYTHON_FALLTHROUGH;
8693  case 1:
8694  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f0)) != 0)) kw_args--;
8695  else {
8696  __Pyx_RaiseArgtupleInvalid("JONSWAP", 0, 3, 6, 1); __PYX_ERR(0, 467, __pyx_L3_error)
8697  }
8698  CYTHON_FALLTHROUGH;
8699  case 2:
8700  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
8701  else {
8702  __Pyx_RaiseArgtupleInvalid("JONSWAP", 0, 3, 6, 2); __PYX_ERR(0, 467, __pyx_L3_error)
8703  }
8704  CYTHON_FALLTHROUGH;
8705  case 3:
8706  if (kw_args > 0) {
8707  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_gamma);
8708  if (value) { values[3] = value; kw_args--; }
8709  }
8710  CYTHON_FALLTHROUGH;
8711  case 4:
8712  if (kw_args > 0) {
8713  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_TMA);
8714  if (value) { values[4] = value; kw_args--; }
8715  }
8716  CYTHON_FALLTHROUGH;
8717  case 5:
8718  if (kw_args > 0) {
8719  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth);
8720  if (value) { values[5] = value; kw_args--; }
8721  }
8722  }
8723  if (unlikely(kw_args > 0)) {
8724  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "JONSWAP") < 0)) __PYX_ERR(0, 467, __pyx_L3_error)
8725  }
8726  } else {
8727  switch (PyTuple_GET_SIZE(__pyx_args)) {
8728  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8729  CYTHON_FALLTHROUGH;
8730  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8731  CYTHON_FALLTHROUGH;
8732  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8733  CYTHON_FALLTHROUGH;
8734  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8735  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8736  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8737  break;
8738  default: goto __pyx_L5_argtuple_error;
8739  }
8740  }
8741  __pyx_v_f = values[0];
8742  __pyx_v_f0 = values[1];
8743  __pyx_v_Hs = values[2];
8744  __pyx_v_gamma = values[3];
8745  __pyx_v_TMA = values[4];
8746  __pyx_v_depth = values[5];
8747  }
8748  goto __pyx_L4_argument_unpacking_done;
8749  __pyx_L5_argtuple_error:;
8750  __Pyx_RaiseArgtupleInvalid("JONSWAP", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 467, __pyx_L3_error)
8751  __pyx_L3_error:;
8752  __Pyx_AddTraceback("WaveTools.JONSWAP", __pyx_clineno, __pyx_lineno, __pyx_filename);
8753  __Pyx_RefNannyFinishContext();
8754  return NULL;
8755  __pyx_L4_argument_unpacking_done:;
8756  __pyx_r = __pyx_pf_9WaveTools_34JONSWAP(__pyx_self, __pyx_v_f, __pyx_v_f0, __pyx_v_Hs, __pyx_v_gamma, __pyx_v_TMA, __pyx_v_depth);
8757 
8758  /* function exit code */
8759  __Pyx_RefNannyFinishContext();
8760  return __pyx_r;
8761 }
8762 
8763 static PyObject *__pyx_pf_9WaveTools_34JONSWAP(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_f0, PyObject *__pyx_v_Hs, PyObject *__pyx_v_gamma, PyObject *__pyx_v_TMA, PyObject *__pyx_v_depth) {
8764  PyObject *__pyx_v_Tp = NULL;
8765  PyObject *__pyx_v_bj = NULL;
8766  PyObject *__pyx_v_r = NULL;
8767  PyObject *__pyx_v_tma = NULL;
8768  PyObject *__pyx_v_k = NULL;
8769  PyObject *__pyx_r = NULL;
8770  __Pyx_RefNannyDeclarations
8771  PyObject *__pyx_t_1 = NULL;
8772  PyObject *__pyx_t_2 = NULL;
8773  PyObject *__pyx_t_3 = NULL;
8774  int __pyx_t_4;
8775  PyObject *__pyx_t_5 = NULL;
8776  double __pyx_t_6;
8777  PyObject *__pyx_t_7 = NULL;
8778  PyObject *__pyx_t_8 = NULL;
8779  PyObject *__pyx_t_9 = NULL;
8780  PyObject *__pyx_t_10 = NULL;
8781  PyObject *__pyx_t_11 = NULL;
8782  int __pyx_t_12;
8783  int __pyx_t_13;
8784  __Pyx_RefNannySetupContext("JONSWAP", 0);
8785 
8786  /* "WaveTools.py":493
8787  *
8788  * """
8789  * Tp = old_div(1.,f0) # <<<<<<<<<<<<<<
8790  * bj = 0.0624*(1.094-0.01915*log(gamma))/(0.23+0.0336*gamma-old_div(0.185,(1.9+gamma)))
8791  * r = np.exp(old_div(-(Tp*f-1.)**2,(2.*sigma(f,f0)**2)))
8792  */
8793  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
8794  __Pyx_GOTREF(__pyx_t_2);
8795  __pyx_t_3 = NULL;
8796  __pyx_t_4 = 0;
8797  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
8798  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
8799  if (likely(__pyx_t_3)) {
8800  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8801  __Pyx_INCREF(__pyx_t_3);
8802  __Pyx_INCREF(function);
8803  __Pyx_DECREF_SET(__pyx_t_2, function);
8804  __pyx_t_4 = 1;
8805  }
8806  }
8807  #if CYTHON_FAST_PYCALL
8808  if (PyFunction_Check(__pyx_t_2)) {
8809  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_float_1_, __pyx_v_f0};
8810  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
8811  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8812  __Pyx_GOTREF(__pyx_t_1);
8813  } else
8814  #endif
8815  #if CYTHON_FAST_PYCCALL
8816  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
8817  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_float_1_, __pyx_v_f0};
8818  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
8819  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8820  __Pyx_GOTREF(__pyx_t_1);
8821  } else
8822  #endif
8823  {
8824  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
8825  __Pyx_GOTREF(__pyx_t_5);
8826  if (__pyx_t_3) {
8827  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
8828  }
8829  __Pyx_INCREF(__pyx_float_1_);
8830  __Pyx_GIVEREF(__pyx_float_1_);
8831  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_float_1_);
8832  __Pyx_INCREF(__pyx_v_f0);
8833  __Pyx_GIVEREF(__pyx_v_f0);
8834  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_f0);
8835  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
8836  __Pyx_GOTREF(__pyx_t_1);
8837  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8838  }
8839  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8840  __pyx_v_Tp = __pyx_t_1;
8841  __pyx_t_1 = 0;
8842 
8843  /* "WaveTools.py":494
8844  * """
8845  * Tp = old_div(1.,f0)
8846  * bj = 0.0624*(1.094-0.01915*log(gamma))/(0.23+0.0336*gamma-old_div(0.185,(1.9+gamma))) # <<<<<<<<<<<<<<
8847  * r = np.exp(old_div(-(Tp*f-1.)**2,(2.*sigma(f,f0)**2)))
8848  * tma = 1.
8849  */
8850  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_gamma); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error)
8851  __pyx_t_1 = PyFloat_FromDouble((0.0624 * (1.094 - (0.01915 * log(__pyx_t_6))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
8852  __Pyx_GOTREF(__pyx_t_1);
8853  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_0336, __pyx_v_gamma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8854  __Pyx_GOTREF(__pyx_t_2);
8855  __pyx_t_5 = __Pyx_PyFloat_AddCObj(__pyx_float_0_23, __pyx_t_2, 0.23, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
8856  __Pyx_GOTREF(__pyx_t_5);
8857  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8858  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
8859  __Pyx_GOTREF(__pyx_t_3);
8860  __pyx_t_7 = __Pyx_PyFloat_AddCObj(__pyx_float_1_9, __pyx_v_gamma, 1.9, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 494, __pyx_L1_error)
8861  __Pyx_GOTREF(__pyx_t_7);
8862  __pyx_t_8 = NULL;
8863  __pyx_t_4 = 0;
8864  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
8865  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
8866  if (likely(__pyx_t_8)) {
8867  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8868  __Pyx_INCREF(__pyx_t_8);
8869  __Pyx_INCREF(function);
8870  __Pyx_DECREF_SET(__pyx_t_3, function);
8871  __pyx_t_4 = 1;
8872  }
8873  }
8874  #if CYTHON_FAST_PYCALL
8875  if (PyFunction_Check(__pyx_t_3)) {
8876  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_float_0_185, __pyx_t_7};
8877  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8878  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8879  __Pyx_GOTREF(__pyx_t_2);
8880  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8881  } else
8882  #endif
8883  #if CYTHON_FAST_PYCCALL
8884  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8885  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_float_0_185, __pyx_t_7};
8886  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8887  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8888  __Pyx_GOTREF(__pyx_t_2);
8889  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8890  } else
8891  #endif
8892  {
8893  __pyx_t_9 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 494, __pyx_L1_error)
8894  __Pyx_GOTREF(__pyx_t_9);
8895  if (__pyx_t_8) {
8896  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
8897  }
8898  __Pyx_INCREF(__pyx_float_0_185);
8899  __Pyx_GIVEREF(__pyx_float_0_185);
8900  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_float_0_185);
8901  __Pyx_GIVEREF(__pyx_t_7);
8902  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_t_7);
8903  __pyx_t_7 = 0;
8904  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8905  __Pyx_GOTREF(__pyx_t_2);
8906  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8907  }
8908  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8909  __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
8910  __Pyx_GOTREF(__pyx_t_3);
8911  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8912  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8913  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
8914  __Pyx_GOTREF(__pyx_t_2);
8915  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8916  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8917  __pyx_v_bj = __pyx_t_2;
8918  __pyx_t_2 = 0;
8919 
8920  /* "WaveTools.py":495
8921  * Tp = old_div(1.,f0)
8922  * bj = 0.0624*(1.094-0.01915*log(gamma))/(0.23+0.0336*gamma-old_div(0.185,(1.9+gamma)))
8923  * r = np.exp(old_div(-(Tp*f-1.)**2,(2.*sigma(f,f0)**2))) # <<<<<<<<<<<<<<
8924  * tma = 1.
8925  * if TMA:
8926  */
8927  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
8928  __Pyx_GOTREF(__pyx_t_3);
8929  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
8930  __Pyx_GOTREF(__pyx_t_1);
8931  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8932  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L1_error)
8933  __Pyx_GOTREF(__pyx_t_5);
8934  __pyx_t_9 = PyNumber_Multiply(__pyx_v_Tp, __pyx_v_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
8935  __Pyx_GOTREF(__pyx_t_9);
8936  __pyx_t_7 = __Pyx_PyFloat_SubtractObjC(__pyx_t_9, __pyx_float_1_, 1., 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
8937  __Pyx_GOTREF(__pyx_t_7);
8938  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8939  __pyx_t_9 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
8940  __Pyx_GOTREF(__pyx_t_9);
8941  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8942  __pyx_t_7 = PyNumber_Negative(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 495, __pyx_L1_error)
8943  __Pyx_GOTREF(__pyx_t_7);
8944  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8945  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sigma); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L1_error)
8946  __Pyx_GOTREF(__pyx_t_8);
8947  __pyx_t_10 = NULL;
8948  __pyx_t_4 = 0;
8949  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
8950  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
8951  if (likely(__pyx_t_10)) {
8952  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
8953  __Pyx_INCREF(__pyx_t_10);
8954  __Pyx_INCREF(function);
8955  __Pyx_DECREF_SET(__pyx_t_8, function);
8956  __pyx_t_4 = 1;
8957  }
8958  }
8959  #if CYTHON_FAST_PYCALL
8960  if (PyFunction_Check(__pyx_t_8)) {
8961  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_f, __pyx_v_f0};
8962  __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
8963  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8964  __Pyx_GOTREF(__pyx_t_9);
8965  } else
8966  #endif
8967  #if CYTHON_FAST_PYCCALL
8968  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
8969  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_f, __pyx_v_f0};
8970  __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
8971  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
8972  __Pyx_GOTREF(__pyx_t_9);
8973  } else
8974  #endif
8975  {
8976  __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 495, __pyx_L1_error)
8977  __Pyx_GOTREF(__pyx_t_11);
8978  if (__pyx_t_10) {
8979  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
8980  }
8981  __Pyx_INCREF(__pyx_v_f);
8982  __Pyx_GIVEREF(__pyx_v_f);
8983  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_v_f);
8984  __Pyx_INCREF(__pyx_v_f0);
8985  __Pyx_GIVEREF(__pyx_v_f0);
8986  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_v_f0);
8987  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
8988  __Pyx_GOTREF(__pyx_t_9);
8989  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
8990  }
8991  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8992  __pyx_t_8 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L1_error)
8993  __Pyx_GOTREF(__pyx_t_8);
8994  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8995  __pyx_t_9 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
8996  __Pyx_GOTREF(__pyx_t_9);
8997  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8998  __pyx_t_8 = NULL;
8999  __pyx_t_4 = 0;
9000  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9001  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
9002  if (likely(__pyx_t_8)) {
9003  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9004  __Pyx_INCREF(__pyx_t_8);
9005  __Pyx_INCREF(function);
9006  __Pyx_DECREF_SET(__pyx_t_5, function);
9007  __pyx_t_4 = 1;
9008  }
9009  }
9010  #if CYTHON_FAST_PYCALL
9011  if (PyFunction_Check(__pyx_t_5)) {
9012  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_9};
9013  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
9014  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9015  __Pyx_GOTREF(__pyx_t_3);
9016  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9017  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9018  } else
9019  #endif
9020  #if CYTHON_FAST_PYCCALL
9021  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9022  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_9};
9023  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
9024  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
9025  __Pyx_GOTREF(__pyx_t_3);
9026  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9027  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9028  } else
9029  #endif
9030  {
9031  __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 495, __pyx_L1_error)
9032  __Pyx_GOTREF(__pyx_t_11);
9033  if (__pyx_t_8) {
9034  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
9035  }
9036  __Pyx_GIVEREF(__pyx_t_7);
9037  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_t_7);
9038  __Pyx_GIVEREF(__pyx_t_9);
9039  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_9);
9040  __pyx_t_7 = 0;
9041  __pyx_t_9 = 0;
9042  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 495, __pyx_L1_error)
9043  __Pyx_GOTREF(__pyx_t_3);
9044  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9045  }
9046  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9047  __pyx_t_5 = NULL;
9048  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
9049  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
9050  if (likely(__pyx_t_5)) {
9051  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9052  __Pyx_INCREF(__pyx_t_5);
9053  __Pyx_INCREF(function);
9054  __Pyx_DECREF_SET(__pyx_t_1, function);
9055  }
9056  }
9057  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3);
9058  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9059  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9060  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
9061  __Pyx_GOTREF(__pyx_t_2);
9062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9063  __pyx_v_r = __pyx_t_2;
9064  __pyx_t_2 = 0;
9065 
9066  /* "WaveTools.py":496
9067  * bj = 0.0624*(1.094-0.01915*log(gamma))/(0.23+0.0336*gamma-old_div(0.185,(1.9+gamma)))
9068  * r = np.exp(old_div(-(Tp*f-1.)**2,(2.*sigma(f,f0)**2)))
9069  * tma = 1. # <<<<<<<<<<<<<<
9070  * if TMA:
9071  * if (depth is None):
9072  */
9073  __Pyx_INCREF(__pyx_float_1_);
9074  __pyx_v_tma = __pyx_float_1_;
9075 
9076  /* "WaveTools.py":497
9077  * r = np.exp(old_div(-(Tp*f-1.)**2,(2.*sigma(f,f0)**2)))
9078  * tma = 1.
9079  * if TMA: # <<<<<<<<<<<<<<
9080  * if (depth is None):
9081  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum")
9082  */
9083  __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_TMA); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 497, __pyx_L1_error)
9084  if (__pyx_t_12) {
9085 
9086  /* "WaveTools.py":498
9087  * tma = 1.
9088  * if TMA:
9089  * if (depth is None): # <<<<<<<<<<<<<<
9090  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum")
9091  * logEvent("Wavetools:py. Stopping simulation")
9092  */
9093  __pyx_t_12 = (__pyx_v_depth == Py_None);
9094  __pyx_t_13 = (__pyx_t_12 != 0);
9095  if (__pyx_t_13) {
9096 
9097  /* "WaveTools.py":499
9098  * if TMA:
9099  * if (depth is None):
9100  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum") # <<<<<<<<<<<<<<
9101  * logEvent("Wavetools:py. Stopping simulation")
9102  * sys.exit(1)
9103  */
9104  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
9105  __Pyx_GOTREF(__pyx_t_1);
9106  __pyx_t_3 = NULL;
9107  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
9108  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
9109  if (likely(__pyx_t_3)) {
9110  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9111  __Pyx_INCREF(__pyx_t_3);
9112  __Pyx_INCREF(function);
9113  __Pyx_DECREF_SET(__pyx_t_1, function);
9114  }
9115  }
9116  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Wavetools_py_Provide_valid_depth) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_Wavetools_py_Provide_valid_depth);
9117  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9118  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
9119  __Pyx_GOTREF(__pyx_t_2);
9120  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9121  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9122 
9123  /* "WaveTools.py":500
9124  * if (depth is None):
9125  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum")
9126  * logEvent("Wavetools:py. Stopping simulation") # <<<<<<<<<<<<<<
9127  * sys.exit(1)
9128  * k = dispersion(2*M_PI*f,depth)
9129  */
9130  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
9131  __Pyx_GOTREF(__pyx_t_1);
9132  __pyx_t_3 = NULL;
9133  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
9134  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
9135  if (likely(__pyx_t_3)) {
9136  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9137  __Pyx_INCREF(__pyx_t_3);
9138  __Pyx_INCREF(function);
9139  __Pyx_DECREF_SET(__pyx_t_1, function);
9140  }
9141  }
9142  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_kp_s_Wavetools_py_Stopping_simulation) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_kp_s_Wavetools_py_Stopping_simulation);
9143  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9144  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
9145  __Pyx_GOTREF(__pyx_t_2);
9146  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9147  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9148 
9149  /* "WaveTools.py":501
9150  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum")
9151  * logEvent("Wavetools:py. Stopping simulation")
9152  * sys.exit(1) # <<<<<<<<<<<<<<
9153  * k = dispersion(2*M_PI*f,depth)
9154  * tma = np.tanh(k*depth)*np.tanh(k*depth)/(1.+ 2.*k*depth/np.sinh(2.*k*depth))
9155  */
9156  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
9157  __Pyx_GOTREF(__pyx_t_1);
9158  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
9159  __Pyx_GOTREF(__pyx_t_3);
9160  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9161  __pyx_t_1 = NULL;
9162  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9163  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
9164  if (likely(__pyx_t_1)) {
9165  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9166  __Pyx_INCREF(__pyx_t_1);
9167  __Pyx_INCREF(function);
9168  __Pyx_DECREF_SET(__pyx_t_3, function);
9169  }
9170  }
9171  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_1);
9172  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9173  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
9174  __Pyx_GOTREF(__pyx_t_2);
9175  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9176  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9177 
9178  /* "WaveTools.py":498
9179  * tma = 1.
9180  * if TMA:
9181  * if (depth is None): # <<<<<<<<<<<<<<
9182  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum")
9183  * logEvent("Wavetools:py. Stopping simulation")
9184  */
9185  }
9186 
9187  /* "WaveTools.py":502
9188  * logEvent("Wavetools:py. Stopping simulation")
9189  * sys.exit(1)
9190  * k = dispersion(2*M_PI*f,depth) # <<<<<<<<<<<<<<
9191  * tma = np.tanh(k*depth)*np.tanh(k*depth)/(1.+ 2.*k*depth/np.sinh(2.*k*depth))
9192  *
9193  */
9194  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
9195  __Pyx_GOTREF(__pyx_t_3);
9196  __pyx_t_1 = PyFloat_FromDouble((2.0 * M_PI)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
9197  __Pyx_GOTREF(__pyx_t_1);
9198  __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_v_f); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error)
9199  __Pyx_GOTREF(__pyx_t_5);
9200  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9201  __pyx_t_1 = NULL;
9202  __pyx_t_4 = 0;
9203  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9204  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
9205  if (likely(__pyx_t_1)) {
9206  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9207  __Pyx_INCREF(__pyx_t_1);
9208  __Pyx_INCREF(function);
9209  __Pyx_DECREF_SET(__pyx_t_3, function);
9210  __pyx_t_4 = 1;
9211  }
9212  }
9213  #if CYTHON_FAST_PYCALL
9214  if (PyFunction_Check(__pyx_t_3)) {
9215  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_v_depth};
9216  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
9217  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9218  __Pyx_GOTREF(__pyx_t_2);
9219  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9220  } else
9221  #endif
9222  #if CYTHON_FAST_PYCCALL
9223  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
9224  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_v_depth};
9225  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
9226  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9227  __Pyx_GOTREF(__pyx_t_2);
9228  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9229  } else
9230  #endif
9231  {
9232  __pyx_t_11 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 502, __pyx_L1_error)
9233  __Pyx_GOTREF(__pyx_t_11);
9234  if (__pyx_t_1) {
9235  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
9236  }
9237  __Pyx_GIVEREF(__pyx_t_5);
9238  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_t_5);
9239  __Pyx_INCREF(__pyx_v_depth);
9240  __Pyx_GIVEREF(__pyx_v_depth);
9241  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_v_depth);
9242  __pyx_t_5 = 0;
9243  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
9244  __Pyx_GOTREF(__pyx_t_2);
9245  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9246  }
9247  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9248  __pyx_v_k = __pyx_t_2;
9249  __pyx_t_2 = 0;
9250 
9251  /* "WaveTools.py":503
9252  * sys.exit(1)
9253  * k = dispersion(2*M_PI*f,depth)
9254  * tma = np.tanh(k*depth)*np.tanh(k*depth)/(1.+ 2.*k*depth/np.sinh(2.*k*depth)) # <<<<<<<<<<<<<<
9255  *
9256  * return tma * bj*(Hs**2)*(old_div(1.,((Tp**4) *(f**5))))*np.exp(-1.25*(old_div(1.,(Tp*f)**(4.))))*(gamma**r)
9257  */
9258  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
9259  __Pyx_GOTREF(__pyx_t_3);
9260  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tanh); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error)
9261  __Pyx_GOTREF(__pyx_t_11);
9262  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9263  __pyx_t_3 = PyNumber_Multiply(__pyx_v_k, __pyx_v_depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
9264  __Pyx_GOTREF(__pyx_t_3);
9265  __pyx_t_5 = NULL;
9266  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
9267  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
9268  if (likely(__pyx_t_5)) {
9269  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
9270  __Pyx_INCREF(__pyx_t_5);
9271  __Pyx_INCREF(function);
9272  __Pyx_DECREF_SET(__pyx_t_11, function);
9273  }
9274  }
9275  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3);
9276  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9277  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9278  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
9279  __Pyx_GOTREF(__pyx_t_2);
9280  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9281  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
9282  __Pyx_GOTREF(__pyx_t_3);
9283  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tanh); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
9284  __Pyx_GOTREF(__pyx_t_5);
9285  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9286  __pyx_t_3 = PyNumber_Multiply(__pyx_v_k, __pyx_v_depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
9287  __Pyx_GOTREF(__pyx_t_3);
9288  __pyx_t_1 = NULL;
9289  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9290  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
9291  if (likely(__pyx_t_1)) {
9292  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9293  __Pyx_INCREF(__pyx_t_1);
9294  __Pyx_INCREF(function);
9295  __Pyx_DECREF_SET(__pyx_t_5, function);
9296  }
9297  }
9298  __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3);
9299  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9300  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9301  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error)
9302  __Pyx_GOTREF(__pyx_t_11);
9303  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9304  __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 503, __pyx_L1_error)
9305  __Pyx_GOTREF(__pyx_t_5);
9306  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9307  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9308  __pyx_t_11 = PyNumber_Multiply(__pyx_float_2_, __pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error)
9309  __Pyx_GOTREF(__pyx_t_11);
9310  __pyx_t_2 = PyNumber_Multiply(__pyx_t_11, __pyx_v_depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
9311  __Pyx_GOTREF(__pyx_t_2);
9312  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9313  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
9314  __Pyx_GOTREF(__pyx_t_3);
9315  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sinh); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
9316  __Pyx_GOTREF(__pyx_t_1);
9317  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9318  __pyx_t_3 = PyNumber_Multiply(__pyx_float_2_, __pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
9319  __Pyx_GOTREF(__pyx_t_3);
9320  __pyx_t_9 = PyNumber_Multiply(__pyx_t_3, __pyx_v_depth); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 503, __pyx_L1_error)
9321  __Pyx_GOTREF(__pyx_t_9);
9322  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9323  __pyx_t_3 = NULL;
9324  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
9325  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
9326  if (likely(__pyx_t_3)) {
9327  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9328  __Pyx_INCREF(__pyx_t_3);
9329  __Pyx_INCREF(function);
9330  __Pyx_DECREF_SET(__pyx_t_1, function);
9331  }
9332  }
9333  __pyx_t_11 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
9334  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9335  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9336  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error)
9337  __Pyx_GOTREF(__pyx_t_11);
9338  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9339  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
9340  __Pyx_GOTREF(__pyx_t_1);
9341  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9342  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9343  __pyx_t_11 = __Pyx_PyFloat_AddCObj(__pyx_float_1_, __pyx_t_1, 1., 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error)
9344  __Pyx_GOTREF(__pyx_t_11);
9345  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9346  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
9347  __Pyx_GOTREF(__pyx_t_1);
9348  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9349  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9350  __Pyx_DECREF_SET(__pyx_v_tma, __pyx_t_1);
9351  __pyx_t_1 = 0;
9352 
9353  /* "WaveTools.py":497
9354  * r = np.exp(old_div(-(Tp*f-1.)**2,(2.*sigma(f,f0)**2)))
9355  * tma = 1.
9356  * if TMA: # <<<<<<<<<<<<<<
9357  * if (depth is None):
9358  * logEvent("Wavetools:py. Provide valid depth definition definition for TMA spectrum")
9359  */
9360  }
9361 
9362  /* "WaveTools.py":505
9363  * tma = np.tanh(k*depth)*np.tanh(k*depth)/(1.+ 2.*k*depth/np.sinh(2.*k*depth))
9364  *
9365  * return tma * bj*(Hs**2)*(old_div(1.,((Tp**4) *(f**5))))*np.exp(-1.25*(old_div(1.,(Tp*f)**(4.))))*(gamma**r) # <<<<<<<<<<<<<<
9366  *
9367  * def PM_mod(f,f0,Hs):
9368  */
9369  __Pyx_XDECREF(__pyx_r);
9370  __pyx_t_1 = PyNumber_Multiply(__pyx_v_tma, __pyx_v_bj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
9371  __Pyx_GOTREF(__pyx_t_1);
9372  __pyx_t_11 = PyNumber_Power(__pyx_v_Hs, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
9373  __Pyx_GOTREF(__pyx_t_11);
9374  __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
9375  __Pyx_GOTREF(__pyx_t_5);
9376  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9377  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9378  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
9379  __Pyx_GOTREF(__pyx_t_1);
9380  __pyx_t_2 = PyNumber_Power(__pyx_v_Tp, __pyx_int_4, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
9381  __Pyx_GOTREF(__pyx_t_2);
9382  __pyx_t_9 = PyNumber_Power(__pyx_v_f, __pyx_int_5, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error)
9383  __Pyx_GOTREF(__pyx_t_9);
9384  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
9385  __Pyx_GOTREF(__pyx_t_3);
9386  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9387  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9388  __pyx_t_9 = NULL;
9389  __pyx_t_4 = 0;
9390  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
9391  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
9392  if (likely(__pyx_t_9)) {
9393  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
9394  __Pyx_INCREF(__pyx_t_9);
9395  __Pyx_INCREF(function);
9396  __Pyx_DECREF_SET(__pyx_t_1, function);
9397  __pyx_t_4 = 1;
9398  }
9399  }
9400  #if CYTHON_FAST_PYCALL
9401  if (PyFunction_Check(__pyx_t_1)) {
9402  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_float_1_, __pyx_t_3};
9403  __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
9404  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9405  __Pyx_GOTREF(__pyx_t_11);
9406  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9407  } else
9408  #endif
9409  #if CYTHON_FAST_PYCCALL
9410  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
9411  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_float_1_, __pyx_t_3};
9412  __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
9413  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9414  __Pyx_GOTREF(__pyx_t_11);
9415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9416  } else
9417  #endif
9418  {
9419  __pyx_t_2 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
9420  __Pyx_GOTREF(__pyx_t_2);
9421  if (__pyx_t_9) {
9422  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL;
9423  }
9424  __Pyx_INCREF(__pyx_float_1_);
9425  __Pyx_GIVEREF(__pyx_float_1_);
9426  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_4, __pyx_float_1_);
9427  __Pyx_GIVEREF(__pyx_t_3);
9428  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_4, __pyx_t_3);
9429  __pyx_t_3 = 0;
9430  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
9431  __Pyx_GOTREF(__pyx_t_11);
9432  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9433  }
9434  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9435  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
9436  __Pyx_GOTREF(__pyx_t_1);
9437  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9438  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9439  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
9440  __Pyx_GOTREF(__pyx_t_5);
9441  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
9442  __Pyx_GOTREF(__pyx_t_2);
9443  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9444  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
9445  __Pyx_GOTREF(__pyx_t_3);
9446  __pyx_t_9 = PyNumber_Multiply(__pyx_v_Tp, __pyx_v_f); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error)
9447  __Pyx_GOTREF(__pyx_t_9);
9448  __pyx_t_7 = PyNumber_Power(__pyx_t_9, __pyx_float_4_, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
9449  __Pyx_GOTREF(__pyx_t_7);
9450  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9451  __pyx_t_9 = NULL;
9452  __pyx_t_4 = 0;
9453  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9454  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
9455  if (likely(__pyx_t_9)) {
9456  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9457  __Pyx_INCREF(__pyx_t_9);
9458  __Pyx_INCREF(function);
9459  __Pyx_DECREF_SET(__pyx_t_3, function);
9460  __pyx_t_4 = 1;
9461  }
9462  }
9463  #if CYTHON_FAST_PYCALL
9464  if (PyFunction_Check(__pyx_t_3)) {
9465  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_float_1_, __pyx_t_7};
9466  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
9467  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9468  __Pyx_GOTREF(__pyx_t_5);
9469  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9470  } else
9471  #endif
9472  #if CYTHON_FAST_PYCCALL
9473  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
9474  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_float_1_, __pyx_t_7};
9475  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
9476  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
9477  __Pyx_GOTREF(__pyx_t_5);
9478  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9479  } else
9480  #endif
9481  {
9482  __pyx_t_8 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error)
9483  __Pyx_GOTREF(__pyx_t_8);
9484  if (__pyx_t_9) {
9485  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); __pyx_t_9 = NULL;
9486  }
9487  __Pyx_INCREF(__pyx_float_1_);
9488  __Pyx_GIVEREF(__pyx_float_1_);
9489  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_4, __pyx_float_1_);
9490  __Pyx_GIVEREF(__pyx_t_7);
9491  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_4, __pyx_t_7);
9492  __pyx_t_7 = 0;
9493  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
9494  __Pyx_GOTREF(__pyx_t_5);
9495  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9496  }
9497  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9498  __pyx_t_3 = PyNumber_Multiply(__pyx_float_neg_1_25, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
9499  __Pyx_GOTREF(__pyx_t_3);
9500  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9501  __pyx_t_5 = NULL;
9502  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9503  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
9504  if (likely(__pyx_t_5)) {
9505  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9506  __Pyx_INCREF(__pyx_t_5);
9507  __Pyx_INCREF(function);
9508  __Pyx_DECREF_SET(__pyx_t_2, function);
9509  }
9510  }
9511  __pyx_t_11 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
9512  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9513  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9514  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
9515  __Pyx_GOTREF(__pyx_t_11);
9516  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9517  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
9518  __Pyx_GOTREF(__pyx_t_2);
9519  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9520  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9521  __pyx_t_11 = PyNumber_Power(__pyx_v_gamma, __pyx_v_r, Py_None); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
9522  __Pyx_GOTREF(__pyx_t_11);
9523  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
9524  __Pyx_GOTREF(__pyx_t_1);
9525  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9526  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
9527  __pyx_r = __pyx_t_1;
9528  __pyx_t_1 = 0;
9529  goto __pyx_L0;
9530 
9531  /* "WaveTools.py":467
9532  *
9533  *
9534  * def JONSWAP(f,f0,Hs,gamma=3.3,TMA=False, depth = None): # <<<<<<<<<<<<<<
9535  * """Calculates the JONSWAP frequency spectrum (Goda 2009)
9536  *
9537  */
9538 
9539  /* function exit code */
9540  __pyx_L1_error:;
9541  __Pyx_XDECREF(__pyx_t_1);
9542  __Pyx_XDECREF(__pyx_t_2);
9543  __Pyx_XDECREF(__pyx_t_3);
9544  __Pyx_XDECREF(__pyx_t_5);
9545  __Pyx_XDECREF(__pyx_t_7);
9546  __Pyx_XDECREF(__pyx_t_8);
9547  __Pyx_XDECREF(__pyx_t_9);
9548  __Pyx_XDECREF(__pyx_t_10);
9549  __Pyx_XDECREF(__pyx_t_11);
9550  __Pyx_AddTraceback("WaveTools.JONSWAP", __pyx_clineno, __pyx_lineno, __pyx_filename);
9551  __pyx_r = NULL;
9552  __pyx_L0:;
9553  __Pyx_XDECREF(__pyx_v_Tp);
9554  __Pyx_XDECREF(__pyx_v_bj);
9555  __Pyx_XDECREF(__pyx_v_r);
9556  __Pyx_XDECREF(__pyx_v_tma);
9557  __Pyx_XDECREF(__pyx_v_k);
9558  __Pyx_XGIVEREF(__pyx_r);
9559  __Pyx_RefNannyFinishContext();
9560  return __pyx_r;
9561 }
9562 
9563 /* "WaveTools.py":507
9564  * return tma * bj*(Hs**2)*(old_div(1.,((Tp**4) *(f**5))))*np.exp(-1.25*(old_div(1.,(Tp*f)**(4.))))*(gamma**r)
9565  *
9566  * def PM_mod(f,f0,Hs): # <<<<<<<<<<<<<<
9567  * """Calculates the Pierson-Moskovitz spectrum (or Bretschneider or ISSC)
9568  *
9569  */
9570 
9571 /* Python wrapper */
9572 static PyObject *__pyx_pw_9WaveTools_37PM_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9573 static char __pyx_doc_9WaveTools_36PM_mod[] = "Calculates the Pierson-Moskovitz spectrum (or Bretschneider or ISSC)\n\n Reference:\n http://www.orcina.com/SoftwareProducts/OrcaFlex/Documentation/Help/Content/html/Waves,WaveSpectra.htm\n And then to Tucker M J, 1991. Waves in Ocean Engineering. Ellis Horwood Ltd. (Chichester).\n\n Parameters\n --------\n f : numpy.ndarray\n Frequency array\n f0 : float\n Peak frequency\n Hs : float\n Significant wave height\n\n Returns\n --------\n numpy.ndarray\n 1D Numpy array of the spectrum in frequency domain\n\n ";
9574 static PyMethodDef __pyx_mdef_9WaveTools_37PM_mod = {"PM_mod", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_37PM_mod, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_36PM_mod};
9575 static PyObject *__pyx_pw_9WaveTools_37PM_mod(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9576  PyObject *__pyx_v_f = 0;
9577  PyObject *__pyx_v_f0 = 0;
9578  PyObject *__pyx_v_Hs = 0;
9579  PyObject *__pyx_r = 0;
9580  __Pyx_RefNannyDeclarations
9581  __Pyx_RefNannySetupContext("PM_mod (wrapper)", 0);
9582  {
9583  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_f,&__pyx_n_s_f0,&__pyx_n_s_Hs,0};
9584  PyObject* values[3] = {0,0,0};
9585  if (unlikely(__pyx_kwds)) {
9586  Py_ssize_t kw_args;
9587  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9588  switch (pos_args) {
9589  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9590  CYTHON_FALLTHROUGH;
9591  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9592  CYTHON_FALLTHROUGH;
9593  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9594  CYTHON_FALLTHROUGH;
9595  case 0: break;
9596  default: goto __pyx_L5_argtuple_error;
9597  }
9598  kw_args = PyDict_Size(__pyx_kwds);
9599  switch (pos_args) {
9600  case 0:
9601  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
9602  else goto __pyx_L5_argtuple_error;
9603  CYTHON_FALLTHROUGH;
9604  case 1:
9605  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f0)) != 0)) kw_args--;
9606  else {
9607  __Pyx_RaiseArgtupleInvalid("PM_mod", 1, 3, 3, 1); __PYX_ERR(0, 507, __pyx_L3_error)
9608  }
9609  CYTHON_FALLTHROUGH;
9610  case 2:
9611  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
9612  else {
9613  __Pyx_RaiseArgtupleInvalid("PM_mod", 1, 3, 3, 2); __PYX_ERR(0, 507, __pyx_L3_error)
9614  }
9615  }
9616  if (unlikely(kw_args > 0)) {
9617  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PM_mod") < 0)) __PYX_ERR(0, 507, __pyx_L3_error)
9618  }
9619  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9620  goto __pyx_L5_argtuple_error;
9621  } else {
9622  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9623  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9624  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9625  }
9626  __pyx_v_f = values[0];
9627  __pyx_v_f0 = values[1];
9628  __pyx_v_Hs = values[2];
9629  }
9630  goto __pyx_L4_argument_unpacking_done;
9631  __pyx_L5_argtuple_error:;
9632  __Pyx_RaiseArgtupleInvalid("PM_mod", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 507, __pyx_L3_error)
9633  __pyx_L3_error:;
9634  __Pyx_AddTraceback("WaveTools.PM_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
9635  __Pyx_RefNannyFinishContext();
9636  return NULL;
9637  __pyx_L4_argument_unpacking_done:;
9638  __pyx_r = __pyx_pf_9WaveTools_36PM_mod(__pyx_self, __pyx_v_f, __pyx_v_f0, __pyx_v_Hs);
9639 
9640  /* function exit code */
9641  __Pyx_RefNannyFinishContext();
9642  return __pyx_r;
9643 }
9644 
9645 static PyObject *__pyx_pf_9WaveTools_36PM_mod(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_f, PyObject *__pyx_v_f0, PyObject *__pyx_v_Hs) {
9646  PyObject *__pyx_r = NULL;
9647  __Pyx_RefNannyDeclarations
9648  PyObject *__pyx_t_1 = NULL;
9649  PyObject *__pyx_t_2 = NULL;
9650  PyObject *__pyx_t_3 = NULL;
9651  PyObject *__pyx_t_4 = NULL;
9652  PyObject *__pyx_t_5 = NULL;
9653  PyObject *__pyx_t_6 = NULL;
9654  int __pyx_t_7;
9655  PyObject *__pyx_t_8 = NULL;
9656  PyObject *__pyx_t_9 = NULL;
9657  __Pyx_RefNannySetupContext("PM_mod", 0);
9658 
9659  /* "WaveTools.py":529
9660  *
9661  * """
9662  * return (old_div(5.0,16.0))*Hs**2*(old_div(f0**4,f**5))*np.exp((old_div(-5.0,4.0))*(old_div(f0,f))**4) # <<<<<<<<<<<<<<
9663  *
9664  * def cos2s(theta,f,s=10):
9665  */
9666  __Pyx_XDECREF(__pyx_r);
9667  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
9668  __Pyx_GOTREF(__pyx_t_1);
9669  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error)
9670  __Pyx_GOTREF(__pyx_t_2);
9671  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9672  __pyx_t_1 = PyNumber_Power(__pyx_v_Hs, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
9673  __Pyx_GOTREF(__pyx_t_1);
9674  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9675  __Pyx_GOTREF(__pyx_t_3);
9676  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9677  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9678  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error)
9679  __Pyx_GOTREF(__pyx_t_2);
9680  __pyx_t_4 = PyNumber_Power(__pyx_v_f0, __pyx_int_4, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
9681  __Pyx_GOTREF(__pyx_t_4);
9682  __pyx_t_5 = PyNumber_Power(__pyx_v_f, __pyx_int_5, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
9683  __Pyx_GOTREF(__pyx_t_5);
9684  __pyx_t_6 = NULL;
9685  __pyx_t_7 = 0;
9686  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9687  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
9688  if (likely(__pyx_t_6)) {
9689  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9690  __Pyx_INCREF(__pyx_t_6);
9691  __Pyx_INCREF(function);
9692  __Pyx_DECREF_SET(__pyx_t_2, function);
9693  __pyx_t_7 = 1;
9694  }
9695  }
9696  #if CYTHON_FAST_PYCALL
9697  if (PyFunction_Check(__pyx_t_2)) {
9698  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
9699  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
9700  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9701  __Pyx_GOTREF(__pyx_t_1);
9702  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9703  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9704  } else
9705  #endif
9706  #if CYTHON_FAST_PYCCALL
9707  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9708  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_t_5};
9709  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
9710  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9711  __Pyx_GOTREF(__pyx_t_1);
9712  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9713  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9714  } else
9715  #endif
9716  {
9717  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error)
9718  __Pyx_GOTREF(__pyx_t_8);
9719  if (__pyx_t_6) {
9720  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
9721  }
9722  __Pyx_GIVEREF(__pyx_t_4);
9723  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
9724  __Pyx_GIVEREF(__pyx_t_5);
9725  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
9726  __pyx_t_4 = 0;
9727  __pyx_t_5 = 0;
9728  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
9729  __Pyx_GOTREF(__pyx_t_1);
9730  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9731  }
9732  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9733  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error)
9734  __Pyx_GOTREF(__pyx_t_2);
9735  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9736  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9737  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9738  __Pyx_GOTREF(__pyx_t_3);
9739  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error)
9740  __Pyx_GOTREF(__pyx_t_8);
9741  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9742  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9743  __Pyx_GOTREF(__pyx_t_3);
9744  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error)
9745  __Pyx_GOTREF(__pyx_t_5);
9746  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9747  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_old_div); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
9748  __Pyx_GOTREF(__pyx_t_4);
9749  __pyx_t_6 = NULL;
9750  __pyx_t_7 = 0;
9751  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9752  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
9753  if (likely(__pyx_t_6)) {
9754  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9755  __Pyx_INCREF(__pyx_t_6);
9756  __Pyx_INCREF(function);
9757  __Pyx_DECREF_SET(__pyx_t_4, function);
9758  __pyx_t_7 = 1;
9759  }
9760  }
9761  #if CYTHON_FAST_PYCALL
9762  if (PyFunction_Check(__pyx_t_4)) {
9763  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_f0, __pyx_v_f};
9764  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9765  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9766  __Pyx_GOTREF(__pyx_t_3);
9767  } else
9768  #endif
9769  #if CYTHON_FAST_PYCCALL
9770  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9771  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_f0, __pyx_v_f};
9772  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9773  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9774  __Pyx_GOTREF(__pyx_t_3);
9775  } else
9776  #endif
9777  {
9778  __pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 529, __pyx_L1_error)
9779  __Pyx_GOTREF(__pyx_t_9);
9780  if (__pyx_t_6) {
9781  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
9782  }
9783  __Pyx_INCREF(__pyx_v_f0);
9784  __Pyx_GIVEREF(__pyx_v_f0);
9785  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_v_f0);
9786  __Pyx_INCREF(__pyx_v_f);
9787  __Pyx_GIVEREF(__pyx_v_f);
9788  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_f);
9789  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9790  __Pyx_GOTREF(__pyx_t_3);
9791  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
9792  }
9793  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9794  __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_4, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
9795  __Pyx_GOTREF(__pyx_t_4);
9796  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9797  __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error)
9798  __Pyx_GOTREF(__pyx_t_3);
9799  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9800  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9801  __pyx_t_4 = NULL;
9802  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
9803  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
9804  if (likely(__pyx_t_4)) {
9805  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
9806  __Pyx_INCREF(__pyx_t_4);
9807  __Pyx_INCREF(function);
9808  __Pyx_DECREF_SET(__pyx_t_8, function);
9809  }
9810  }
9811  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_3);
9812  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9813  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9814  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
9815  __Pyx_GOTREF(__pyx_t_1);
9816  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9817  __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error)
9818  __Pyx_GOTREF(__pyx_t_8);
9819  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9820  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9821  __pyx_r = __pyx_t_8;
9822  __pyx_t_8 = 0;
9823  goto __pyx_L0;
9824 
9825  /* "WaveTools.py":507
9826  * return tma * bj*(Hs**2)*(old_div(1.,((Tp**4) *(f**5))))*np.exp(-1.25*(old_div(1.,(Tp*f)**(4.))))*(gamma**r)
9827  *
9828  * def PM_mod(f,f0,Hs): # <<<<<<<<<<<<<<
9829  * """Calculates the Pierson-Moskovitz spectrum (or Bretschneider or ISSC)
9830  *
9831  */
9832 
9833  /* function exit code */
9834  __pyx_L1_error:;
9835  __Pyx_XDECREF(__pyx_t_1);
9836  __Pyx_XDECREF(__pyx_t_2);
9837  __Pyx_XDECREF(__pyx_t_3);
9838  __Pyx_XDECREF(__pyx_t_4);
9839  __Pyx_XDECREF(__pyx_t_5);
9840  __Pyx_XDECREF(__pyx_t_6);
9841  __Pyx_XDECREF(__pyx_t_8);
9842  __Pyx_XDECREF(__pyx_t_9);
9843  __Pyx_AddTraceback("WaveTools.PM_mod", __pyx_clineno, __pyx_lineno, __pyx_filename);
9844  __pyx_r = NULL;
9845  __pyx_L0:;
9846  __Pyx_XGIVEREF(__pyx_r);
9847  __Pyx_RefNannyFinishContext();
9848  return __pyx_r;
9849 }
9850 
9851 /* "WaveTools.py":531
9852  * return (old_div(5.0,16.0))*Hs**2*(old_div(f0**4,f**5))*np.exp((old_div(-5.0,4.0))*(old_div(f0,f))**4)
9853  *
9854  * def cos2s(theta,f,s=10): # <<<<<<<<<<<<<<
9855  * """Calculates the cos-2s directional spreading function
9856  * see USACE - CETN-I-28 http://chl.erdc.usace.army.mil/library/publications/chetn/pdf/cetn-i-28.pdf
9857  */
9858 
9859 /* Python wrapper */
9860 static PyObject *__pyx_pw_9WaveTools_39cos2s(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9861 static char __pyx_doc_9WaveTools_38cos2s[] = "Calculates the cos-2s directional spreading function\n see USACE - CETN-I-28 http://chl.erdc.usace.army.mil/library/publications/chetn/pdf/cetn-i-28.pdf\n\n Parameters\n ----------\n theta : numpy.ndarray\n Wave angle array\n f : numpy.ndarray\n Frequency array\n s : Optional[float]\n Spreading parameter\n\n Returns\n --------\n numpy.ndarray\n 2D Numpy array of cos-2s spectrum\n ";
9862 static PyMethodDef __pyx_mdef_9WaveTools_39cos2s = {"cos2s", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_39cos2s, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_38cos2s};
9863 static PyObject *__pyx_pw_9WaveTools_39cos2s(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9864  PyObject *__pyx_v_theta = 0;
9865  PyObject *__pyx_v_f = 0;
9866  PyObject *__pyx_v_s = 0;
9867  PyObject *__pyx_r = 0;
9868  __Pyx_RefNannyDeclarations
9869  __Pyx_RefNannySetupContext("cos2s (wrapper)", 0);
9870  {
9871  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_theta,&__pyx_n_s_f,&__pyx_n_s_s,0};
9872  PyObject* values[3] = {0,0,0};
9873  values[2] = ((PyObject *)((PyObject *)__pyx_int_10));
9874  if (unlikely(__pyx_kwds)) {
9875  Py_ssize_t kw_args;
9876  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9877  switch (pos_args) {
9878  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9879  CYTHON_FALLTHROUGH;
9880  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9881  CYTHON_FALLTHROUGH;
9882  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9883  CYTHON_FALLTHROUGH;
9884  case 0: break;
9885  default: goto __pyx_L5_argtuple_error;
9886  }
9887  kw_args = PyDict_Size(__pyx_kwds);
9888  switch (pos_args) {
9889  case 0:
9890  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--;
9891  else goto __pyx_L5_argtuple_error;
9892  CYTHON_FALLTHROUGH;
9893  case 1:
9894  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f)) != 0)) kw_args--;
9895  else {
9896  __Pyx_RaiseArgtupleInvalid("cos2s", 0, 2, 3, 1); __PYX_ERR(0, 531, __pyx_L3_error)
9897  }
9898  CYTHON_FALLTHROUGH;
9899  case 2:
9900  if (kw_args > 0) {
9901  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s);
9902  if (value) { values[2] = value; kw_args--; }
9903  }
9904  }
9905  if (unlikely(kw_args > 0)) {
9906  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cos2s") < 0)) __PYX_ERR(0, 531, __pyx_L3_error)
9907  }
9908  } else {
9909  switch (PyTuple_GET_SIZE(__pyx_args)) {
9910  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9911  CYTHON_FALLTHROUGH;
9912  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9913  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9914  break;
9915  default: goto __pyx_L5_argtuple_error;
9916  }
9917  }
9918  __pyx_v_theta = values[0];
9919  __pyx_v_f = values[1];
9920  __pyx_v_s = values[2];
9921  }
9922  goto __pyx_L4_argument_unpacking_done;
9923  __pyx_L5_argtuple_error:;
9924  __Pyx_RaiseArgtupleInvalid("cos2s", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 531, __pyx_L3_error)
9925  __pyx_L3_error:;
9926  __Pyx_AddTraceback("WaveTools.cos2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
9927  __Pyx_RefNannyFinishContext();
9928  return NULL;
9929  __pyx_L4_argument_unpacking_done:;
9930  __pyx_r = __pyx_pf_9WaveTools_38cos2s(__pyx_self, __pyx_v_theta, __pyx_v_f, __pyx_v_s);
9931 
9932  /* function exit code */
9933  __Pyx_RefNannyFinishContext();
9934  return __pyx_r;
9935 }
9936 
9937 static PyObject *__pyx_pf_9WaveTools_38cos2s(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_theta, PyObject *__pyx_v_f, PyObject *__pyx_v_s) {
9938  PyObject *__pyx_v_fun = NULL;
9939  PyObject *__pyx_v_ii = NULL;
9940  PyObject *__pyx_r = NULL;
9941  __Pyx_RefNannyDeclarations
9942  PyObject *__pyx_t_1 = NULL;
9943  PyObject *__pyx_t_2 = NULL;
9944  PyObject *__pyx_t_3 = NULL;
9945  Py_ssize_t __pyx_t_4;
9946  PyObject *__pyx_t_5 = NULL;
9947  PyObject *__pyx_t_6 = NULL;
9948  PyObject *(*__pyx_t_7)(PyObject *);
9949  PyObject *__pyx_t_8 = NULL;
9950  int __pyx_t_9;
9951  PyObject *__pyx_t_10 = NULL;
9952  __Pyx_RefNannySetupContext("cos2s", 0);
9953 
9954  /* "WaveTools.py":549
9955  * 2D Numpy array of cos-2s spectrum
9956  * """
9957  * fun = np.zeros((len(theta),len(f)),) # <<<<<<<<<<<<<<
9958  * for ii in range(len(fun[0,:])):
9959  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
9960  */
9961  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
9962  __Pyx_GOTREF(__pyx_t_2);
9963  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error)
9964  __Pyx_GOTREF(__pyx_t_3);
9965  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9966  __pyx_t_4 = PyObject_Length(__pyx_v_theta); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 549, __pyx_L1_error)
9967  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error)
9968  __Pyx_GOTREF(__pyx_t_2);
9969  __pyx_t_4 = PyObject_Length(__pyx_v_f); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 549, __pyx_L1_error)
9970  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
9971  __Pyx_GOTREF(__pyx_t_5);
9972  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 549, __pyx_L1_error)
9973  __Pyx_GOTREF(__pyx_t_6);
9974  __Pyx_GIVEREF(__pyx_t_2);
9975  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
9976  __Pyx_GIVEREF(__pyx_t_5);
9977  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
9978  __pyx_t_2 = 0;
9979  __pyx_t_5 = 0;
9980  __pyx_t_5 = NULL;
9981  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
9982  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
9983  if (likely(__pyx_t_5)) {
9984  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9985  __Pyx_INCREF(__pyx_t_5);
9986  __Pyx_INCREF(function);
9987  __Pyx_DECREF_SET(__pyx_t_3, function);
9988  }
9989  }
9990  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
9991  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9992  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9993  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
9994  __Pyx_GOTREF(__pyx_t_1);
9995  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9996  __pyx_v_fun = __pyx_t_1;
9997  __pyx_t_1 = 0;
9998 
9999  /* "WaveTools.py":550
10000  * """
10001  * fun = np.zeros((len(theta),len(f)),)
10002  * for ii in range(len(fun[0,:])): # <<<<<<<<<<<<<<
10003  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
10004  * return fun
10005  */
10006  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error)
10007  __Pyx_GOTREF(__pyx_t_3);
10008  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_fun, __pyx_tuple__11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
10009  __Pyx_GOTREF(__pyx_t_6);
10010  __pyx_t_4 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 550, __pyx_L1_error)
10011  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10012  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
10013  __Pyx_GOTREF(__pyx_t_6);
10014  __pyx_t_5 = NULL;
10015  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
10016  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
10017  if (likely(__pyx_t_5)) {
10018  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10019  __Pyx_INCREF(__pyx_t_5);
10020  __Pyx_INCREF(function);
10021  __Pyx_DECREF_SET(__pyx_t_3, function);
10022  }
10023  }
10024  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
10025  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10026  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10027  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
10028  __Pyx_GOTREF(__pyx_t_1);
10029  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10030  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
10031  __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
10032  __pyx_t_7 = NULL;
10033  } else {
10034  __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error)
10035  __Pyx_GOTREF(__pyx_t_3);
10036  __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error)
10037  }
10038  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10039  for (;;) {
10040  if (likely(!__pyx_t_7)) {
10041  if (likely(PyList_CheckExact(__pyx_t_3))) {
10042  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
10043  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10044  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
10045  #else
10046  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
10047  __Pyx_GOTREF(__pyx_t_1);
10048  #endif
10049  } else {
10050  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
10051  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10052  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 550, __pyx_L1_error)
10053  #else
10054  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
10055  __Pyx_GOTREF(__pyx_t_1);
10056  #endif
10057  }
10058  } else {
10059  __pyx_t_1 = __pyx_t_7(__pyx_t_3);
10060  if (unlikely(!__pyx_t_1)) {
10061  PyObject* exc_type = PyErr_Occurred();
10062  if (exc_type) {
10063  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10064  else __PYX_ERR(0, 550, __pyx_L1_error)
10065  }
10066  break;
10067  }
10068  __Pyx_GOTREF(__pyx_t_1);
10069  }
10070  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
10071  __pyx_t_1 = 0;
10072 
10073  /* "WaveTools.py":551
10074  * fun = np.zeros((len(theta),len(f)),)
10075  * for ii in range(len(fun[0,:])):
10076  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s) # <<<<<<<<<<<<<<
10077  * return fun
10078  * def mitsuyasu(theta,fi,f0,smax=10):
10079  */
10080  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
10081  __Pyx_GOTREF(__pyx_t_6);
10082  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
10083  __Pyx_GOTREF(__pyx_t_5);
10084  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10085  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error)
10086  __Pyx_GOTREF(__pyx_t_2);
10087  __pyx_t_8 = NULL;
10088  __pyx_t_9 = 0;
10089  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10090  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
10091  if (likely(__pyx_t_8)) {
10092  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10093  __Pyx_INCREF(__pyx_t_8);
10094  __Pyx_INCREF(function);
10095  __Pyx_DECREF_SET(__pyx_t_2, function);
10096  __pyx_t_9 = 1;
10097  }
10098  }
10099  #if CYTHON_FAST_PYCALL
10100  if (PyFunction_Check(__pyx_t_2)) {
10101  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_theta, __pyx_int_2};
10102  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
10103  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10104  __Pyx_GOTREF(__pyx_t_6);
10105  } else
10106  #endif
10107  #if CYTHON_FAST_PYCCALL
10108  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
10109  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_theta, __pyx_int_2};
10110  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
10111  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10112  __Pyx_GOTREF(__pyx_t_6);
10113  } else
10114  #endif
10115  {
10116  __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 551, __pyx_L1_error)
10117  __Pyx_GOTREF(__pyx_t_10);
10118  if (__pyx_t_8) {
10119  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
10120  }
10121  __Pyx_INCREF(__pyx_v_theta);
10122  __Pyx_GIVEREF(__pyx_v_theta);
10123  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_v_theta);
10124  __Pyx_INCREF(__pyx_int_2);
10125  __Pyx_GIVEREF(__pyx_int_2);
10126  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_int_2);
10127  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
10128  __Pyx_GOTREF(__pyx_t_6);
10129  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10130  }
10131  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10132  __pyx_t_2 = NULL;
10133  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10134  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
10135  if (likely(__pyx_t_2)) {
10136  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10137  __Pyx_INCREF(__pyx_t_2);
10138  __Pyx_INCREF(function);
10139  __Pyx_DECREF_SET(__pyx_t_5, function);
10140  }
10141  }
10142  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
10143  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10144  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10145  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
10146  __Pyx_GOTREF(__pyx_t_1);
10147  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10148  __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
10149  __Pyx_GOTREF(__pyx_t_5);
10150  __pyx_t_6 = PyNumber_Power(__pyx_t_1, __pyx_t_5, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
10151  __Pyx_GOTREF(__pyx_t_6);
10152  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10153  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10154  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
10155  __Pyx_GOTREF(__pyx_t_5);
10156  __Pyx_INCREF(__pyx_slice__4);
10157  __Pyx_GIVEREF(__pyx_slice__4);
10158  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__4);
10159  __Pyx_INCREF(__pyx_v_ii);
10160  __Pyx_GIVEREF(__pyx_v_ii);
10161  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_ii);
10162  if (unlikely(PyObject_SetItem(__pyx_v_fun, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 551, __pyx_L1_error)
10163  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10164  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10165 
10166  /* "WaveTools.py":550
10167  * """
10168  * fun = np.zeros((len(theta),len(f)),)
10169  * for ii in range(len(fun[0,:])): # <<<<<<<<<<<<<<
10170  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
10171  * return fun
10172  */
10173  }
10174  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10175 
10176  /* "WaveTools.py":552
10177  * for ii in range(len(fun[0,:])):
10178  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
10179  * return fun # <<<<<<<<<<<<<<
10180  * def mitsuyasu(theta,fi,f0,smax=10):
10181  * """The cos2s wave directional spread with wave frequency dependency
10182  */
10183  __Pyx_XDECREF(__pyx_r);
10184  __Pyx_INCREF(__pyx_v_fun);
10185  __pyx_r = __pyx_v_fun;
10186  goto __pyx_L0;
10187 
10188  /* "WaveTools.py":531
10189  * return (old_div(5.0,16.0))*Hs**2*(old_div(f0**4,f**5))*np.exp((old_div(-5.0,4.0))*(old_div(f0,f))**4)
10190  *
10191  * def cos2s(theta,f,s=10): # <<<<<<<<<<<<<<
10192  * """Calculates the cos-2s directional spreading function
10193  * see USACE - CETN-I-28 http://chl.erdc.usace.army.mil/library/publications/chetn/pdf/cetn-i-28.pdf
10194  */
10195 
10196  /* function exit code */
10197  __pyx_L1_error:;
10198  __Pyx_XDECREF(__pyx_t_1);
10199  __Pyx_XDECREF(__pyx_t_2);
10200  __Pyx_XDECREF(__pyx_t_3);
10201  __Pyx_XDECREF(__pyx_t_5);
10202  __Pyx_XDECREF(__pyx_t_6);
10203  __Pyx_XDECREF(__pyx_t_8);
10204  __Pyx_XDECREF(__pyx_t_10);
10205  __Pyx_AddTraceback("WaveTools.cos2s", __pyx_clineno, __pyx_lineno, __pyx_filename);
10206  __pyx_r = NULL;
10207  __pyx_L0:;
10208  __Pyx_XDECREF(__pyx_v_fun);
10209  __Pyx_XDECREF(__pyx_v_ii);
10210  __Pyx_XGIVEREF(__pyx_r);
10211  __Pyx_RefNannyFinishContext();
10212  return __pyx_r;
10213 }
10214 
10215 /* "WaveTools.py":553
10216  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
10217  * return fun
10218  * def mitsuyasu(theta,fi,f0,smax=10): # <<<<<<<<<<<<<<
10219  * """The cos2s wave directional spread with wave frequency dependency
10220  *
10221  */
10222 
10223 /* Python wrapper */
10224 static PyObject *__pyx_pw_9WaveTools_41mitsuyasu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10225 static char __pyx_doc_9WaveTools_40mitsuyasu[] = "The cos2s wave directional spread with wave frequency dependency\n\n Equation from \"Random Seas and Design of Maritime Structures\" - Y. Goda - 2010\n (3rd ed) eq. 2.22 - 2.25\n\n Parameters\n ----------\n theta : numpy.ndarray\n Wave angle array\n fi : numpy.ndarray\n Frequency array\n f0 : float\n Peak frequency\n smax : Optional[float]\n Spreading parameter\n Returns\n --------\n numpy.ndarray\n 2D Numpy array of Mitsuyashu-type spectrum\n ";
10226 static PyMethodDef __pyx_mdef_9WaveTools_41mitsuyasu = {"mitsuyasu", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_41mitsuyasu, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_40mitsuyasu};
10227 static PyObject *__pyx_pw_9WaveTools_41mitsuyasu(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10228  PyObject *__pyx_v_theta = 0;
10229  PyObject *__pyx_v_fi = 0;
10230  PyObject *__pyx_v_f0 = 0;
10231  PyObject *__pyx_v_smax = 0;
10232  PyObject *__pyx_r = 0;
10233  __Pyx_RefNannyDeclarations
10234  __Pyx_RefNannySetupContext("mitsuyasu (wrapper)", 0);
10235  {
10236  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_theta,&__pyx_n_s_fi,&__pyx_n_s_f0,&__pyx_n_s_smax,0};
10237  PyObject* values[4] = {0,0,0,0};
10238  values[3] = ((PyObject *)((PyObject *)__pyx_int_10));
10239  if (unlikely(__pyx_kwds)) {
10240  Py_ssize_t kw_args;
10241  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10242  switch (pos_args) {
10243  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10244  CYTHON_FALLTHROUGH;
10245  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10246  CYTHON_FALLTHROUGH;
10247  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10248  CYTHON_FALLTHROUGH;
10249  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10250  CYTHON_FALLTHROUGH;
10251  case 0: break;
10252  default: goto __pyx_L5_argtuple_error;
10253  }
10254  kw_args = PyDict_Size(__pyx_kwds);
10255  switch (pos_args) {
10256  case 0:
10257  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--;
10258  else goto __pyx_L5_argtuple_error;
10259  CYTHON_FALLTHROUGH;
10260  case 1:
10261  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fi)) != 0)) kw_args--;
10262  else {
10263  __Pyx_RaiseArgtupleInvalid("mitsuyasu", 0, 3, 4, 1); __PYX_ERR(0, 553, __pyx_L3_error)
10264  }
10265  CYTHON_FALLTHROUGH;
10266  case 2:
10267  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_f0)) != 0)) kw_args--;
10268  else {
10269  __Pyx_RaiseArgtupleInvalid("mitsuyasu", 0, 3, 4, 2); __PYX_ERR(0, 553, __pyx_L3_error)
10270  }
10271  CYTHON_FALLTHROUGH;
10272  case 3:
10273  if (kw_args > 0) {
10274  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_smax);
10275  if (value) { values[3] = value; kw_args--; }
10276  }
10277  }
10278  if (unlikely(kw_args > 0)) {
10279  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mitsuyasu") < 0)) __PYX_ERR(0, 553, __pyx_L3_error)
10280  }
10281  } else {
10282  switch (PyTuple_GET_SIZE(__pyx_args)) {
10283  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10284  CYTHON_FALLTHROUGH;
10285  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10286  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10287  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10288  break;
10289  default: goto __pyx_L5_argtuple_error;
10290  }
10291  }
10292  __pyx_v_theta = values[0];
10293  __pyx_v_fi = values[1];
10294  __pyx_v_f0 = values[2];
10295  __pyx_v_smax = values[3];
10296  }
10297  goto __pyx_L4_argument_unpacking_done;
10298  __pyx_L5_argtuple_error:;
10299  __Pyx_RaiseArgtupleInvalid("mitsuyasu", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 553, __pyx_L3_error)
10300  __pyx_L3_error:;
10301  __Pyx_AddTraceback("WaveTools.mitsuyasu", __pyx_clineno, __pyx_lineno, __pyx_filename);
10302  __Pyx_RefNannyFinishContext();
10303  return NULL;
10304  __pyx_L4_argument_unpacking_done:;
10305  __pyx_r = __pyx_pf_9WaveTools_40mitsuyasu(__pyx_self, __pyx_v_theta, __pyx_v_fi, __pyx_v_f0, __pyx_v_smax);
10306 
10307  /* function exit code */
10308  __Pyx_RefNannyFinishContext();
10309  return __pyx_r;
10310 }
10311 
10312 static PyObject *__pyx_pf_9WaveTools_40mitsuyasu(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_theta, PyObject *__pyx_v_fi, PyObject *__pyx_v_f0, PyObject *__pyx_v_smax) {
10313  PyObject *__pyx_v_s = NULL;
10314  PyObject *__pyx_v_ii = NULL;
10315  PyObject *__pyx_v_fun = NULL;
10316  PyObject *__pyx_r = NULL;
10317  __Pyx_RefNannyDeclarations
10318  PyObject *__pyx_t_1 = NULL;
10319  PyObject *__pyx_t_2 = NULL;
10320  PyObject *__pyx_t_3 = NULL;
10321  int __pyx_t_4;
10322  PyObject *__pyx_t_5 = NULL;
10323  PyObject *__pyx_t_6 = NULL;
10324  Py_ssize_t __pyx_t_7;
10325  PyObject *(*__pyx_t_8)(PyObject *);
10326  PyObject *__pyx_t_9 = NULL;
10327  PyObject *__pyx_t_10 = NULL;
10328  __Pyx_RefNannySetupContext("mitsuyasu", 0);
10329 
10330  /* "WaveTools.py":575
10331  * """
10332  *
10333  * s = smax * (old_div(fi,f0))**(5) # <<<<<<<<<<<<<<
10334  * ii = np.where(fi>f0)[0][0]
10335  * s[ii:] = smax * (old_div(fi[ii:],f0))**(-2.5)
10336  */
10337  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
10338  __Pyx_GOTREF(__pyx_t_2);
10339  __pyx_t_3 = NULL;
10340  __pyx_t_4 = 0;
10341  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10342  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
10343  if (likely(__pyx_t_3)) {
10344  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10345  __Pyx_INCREF(__pyx_t_3);
10346  __Pyx_INCREF(function);
10347  __Pyx_DECREF_SET(__pyx_t_2, function);
10348  __pyx_t_4 = 1;
10349  }
10350  }
10351  #if CYTHON_FAST_PYCALL
10352  if (PyFunction_Check(__pyx_t_2)) {
10353  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fi, __pyx_v_f0};
10354  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
10355  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10356  __Pyx_GOTREF(__pyx_t_1);
10357  } else
10358  #endif
10359  #if CYTHON_FAST_PYCCALL
10360  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
10361  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fi, __pyx_v_f0};
10362  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
10363  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10364  __Pyx_GOTREF(__pyx_t_1);
10365  } else
10366  #endif
10367  {
10368  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
10369  __Pyx_GOTREF(__pyx_t_5);
10370  if (__pyx_t_3) {
10371  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
10372  }
10373  __Pyx_INCREF(__pyx_v_fi);
10374  __Pyx_GIVEREF(__pyx_v_fi);
10375  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_fi);
10376  __Pyx_INCREF(__pyx_v_f0);
10377  __Pyx_GIVEREF(__pyx_v_f0);
10378  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_f0);
10379  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
10380  __Pyx_GOTREF(__pyx_t_1);
10381  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10382  }
10383  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10384  __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_5, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
10385  __Pyx_GOTREF(__pyx_t_2);
10386  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10387  __pyx_t_1 = PyNumber_Multiply(__pyx_v_smax, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
10388  __Pyx_GOTREF(__pyx_t_1);
10389  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10390  __pyx_v_s = __pyx_t_1;
10391  __pyx_t_1 = 0;
10392 
10393  /* "WaveTools.py":576
10394  *
10395  * s = smax * (old_div(fi,f0))**(5)
10396  * ii = np.where(fi>f0)[0][0] # <<<<<<<<<<<<<<
10397  * s[ii:] = smax * (old_div(fi[ii:],f0))**(-2.5)
10398  * fun = np.zeros((len(theta),len(fi)),)
10399  */
10400  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
10401  __Pyx_GOTREF(__pyx_t_2);
10402  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
10403  __Pyx_GOTREF(__pyx_t_5);
10404  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10405  __pyx_t_2 = PyObject_RichCompare(__pyx_v_fi, __pyx_v_f0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
10406  __pyx_t_3 = NULL;
10407  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10408  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
10409  if (likely(__pyx_t_3)) {
10410  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10411  __Pyx_INCREF(__pyx_t_3);
10412  __Pyx_INCREF(function);
10413  __Pyx_DECREF_SET(__pyx_t_5, function);
10414  }
10415  }
10416  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
10417  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10418  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10419  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
10420  __Pyx_GOTREF(__pyx_t_1);
10421  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10422  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
10423  __Pyx_GOTREF(__pyx_t_5);
10424  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10425  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
10426  __Pyx_GOTREF(__pyx_t_1);
10427  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10428  __pyx_v_ii = __pyx_t_1;
10429  __pyx_t_1 = 0;
10430 
10431  /* "WaveTools.py":577
10432  * s = smax * (old_div(fi,f0))**(5)
10433  * ii = np.where(fi>f0)[0][0]
10434  * s[ii:] = smax * (old_div(fi[ii:],f0))**(-2.5) # <<<<<<<<<<<<<<
10435  * fun = np.zeros((len(theta),len(fi)),)
10436  * for ii in range(len(fun[0,:])):
10437  */
10438  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
10439  __Pyx_GOTREF(__pyx_t_5);
10440  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_fi, 0, 0, &__pyx_v_ii, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
10441  __Pyx_GOTREF(__pyx_t_2);
10442  __pyx_t_3 = NULL;
10443  __pyx_t_4 = 0;
10444  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10445  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
10446  if (likely(__pyx_t_3)) {
10447  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10448  __Pyx_INCREF(__pyx_t_3);
10449  __Pyx_INCREF(function);
10450  __Pyx_DECREF_SET(__pyx_t_5, function);
10451  __pyx_t_4 = 1;
10452  }
10453  }
10454  #if CYTHON_FAST_PYCALL
10455  if (PyFunction_Check(__pyx_t_5)) {
10456  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_v_f0};
10457  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
10458  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10459  __Pyx_GOTREF(__pyx_t_1);
10460  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10461  } else
10462  #endif
10463  #if CYTHON_FAST_PYCCALL
10464  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10465  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_v_f0};
10466  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
10467  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10468  __Pyx_GOTREF(__pyx_t_1);
10469  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10470  } else
10471  #endif
10472  {
10473  __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
10474  __Pyx_GOTREF(__pyx_t_6);
10475  if (__pyx_t_3) {
10476  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
10477  }
10478  __Pyx_GIVEREF(__pyx_t_2);
10479  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_t_2);
10480  __Pyx_INCREF(__pyx_v_f0);
10481  __Pyx_GIVEREF(__pyx_v_f0);
10482  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_f0);
10483  __pyx_t_2 = 0;
10484  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
10485  __Pyx_GOTREF(__pyx_t_1);
10486  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10487  }
10488  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10489  __pyx_t_5 = PyNumber_Power(__pyx_t_1, __pyx_float_neg_2_5, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
10490  __Pyx_GOTREF(__pyx_t_5);
10491  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10492  __pyx_t_1 = PyNumber_Multiply(__pyx_v_smax, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
10493  __Pyx_GOTREF(__pyx_t_1);
10494  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10495  if (__Pyx_PyObject_SetSlice(__pyx_v_s, __pyx_t_1, 0, 0, &__pyx_v_ii, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
10496  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10497 
10498  /* "WaveTools.py":578
10499  * ii = np.where(fi>f0)[0][0]
10500  * s[ii:] = smax * (old_div(fi[ii:],f0))**(-2.5)
10501  * fun = np.zeros((len(theta),len(fi)),) # <<<<<<<<<<<<<<
10502  * for ii in range(len(fun[0,:])):
10503  * fun[:,ii] = np.cos(old_div(theta,2))**(2.*s[ii])
10504  */
10505  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
10506  __Pyx_GOTREF(__pyx_t_5);
10507  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error)
10508  __Pyx_GOTREF(__pyx_t_6);
10509  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10510  __pyx_t_7 = PyObject_Length(__pyx_v_theta); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 578, __pyx_L1_error)
10511  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
10512  __Pyx_GOTREF(__pyx_t_5);
10513  __pyx_t_7 = PyObject_Length(__pyx_v_fi); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 578, __pyx_L1_error)
10514  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
10515  __Pyx_GOTREF(__pyx_t_2);
10516  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error)
10517  __Pyx_GOTREF(__pyx_t_3);
10518  __Pyx_GIVEREF(__pyx_t_5);
10519  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
10520  __Pyx_GIVEREF(__pyx_t_2);
10521  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
10522  __pyx_t_5 = 0;
10523  __pyx_t_2 = 0;
10524  __pyx_t_2 = NULL;
10525  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
10526  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
10527  if (likely(__pyx_t_2)) {
10528  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10529  __Pyx_INCREF(__pyx_t_2);
10530  __Pyx_INCREF(function);
10531  __Pyx_DECREF_SET(__pyx_t_6, function);
10532  }
10533  }
10534  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
10535  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10537  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
10538  __Pyx_GOTREF(__pyx_t_1);
10539  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10540  __pyx_v_fun = __pyx_t_1;
10541  __pyx_t_1 = 0;
10542 
10543  /* "WaveTools.py":579
10544  * s[ii:] = smax * (old_div(fi[ii:],f0))**(-2.5)
10545  * fun = np.zeros((len(theta),len(fi)),)
10546  * for ii in range(len(fun[0,:])): # <<<<<<<<<<<<<<
10547  * fun[:,ii] = np.cos(old_div(theta,2))**(2.*s[ii])
10548  * return fun
10549  */
10550  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L1_error)
10551  __Pyx_GOTREF(__pyx_t_6);
10552  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_fun, __pyx_tuple__11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
10553  __Pyx_GOTREF(__pyx_t_3);
10554  __pyx_t_7 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 579, __pyx_L1_error)
10555  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10556  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error)
10557  __Pyx_GOTREF(__pyx_t_3);
10558  __pyx_t_2 = NULL;
10559  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
10560  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
10561  if (likely(__pyx_t_2)) {
10562  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10563  __Pyx_INCREF(__pyx_t_2);
10564  __Pyx_INCREF(function);
10565  __Pyx_DECREF_SET(__pyx_t_6, function);
10566  }
10567  }
10568  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
10569  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10570  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10571  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
10572  __Pyx_GOTREF(__pyx_t_1);
10573  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10574  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
10575  __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
10576  __pyx_t_8 = NULL;
10577  } else {
10578  __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L1_error)
10579  __Pyx_GOTREF(__pyx_t_6);
10580  __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 579, __pyx_L1_error)
10581  }
10582  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10583  for (;;) {
10584  if (likely(!__pyx_t_8)) {
10585  if (likely(PyList_CheckExact(__pyx_t_6))) {
10586  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
10587  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10588  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 579, __pyx_L1_error)
10589  #else
10590  __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
10591  __Pyx_GOTREF(__pyx_t_1);
10592  #endif
10593  } else {
10594  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
10595  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10596  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 579, __pyx_L1_error)
10597  #else
10598  __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
10599  __Pyx_GOTREF(__pyx_t_1);
10600  #endif
10601  }
10602  } else {
10603  __pyx_t_1 = __pyx_t_8(__pyx_t_6);
10604  if (unlikely(!__pyx_t_1)) {
10605  PyObject* exc_type = PyErr_Occurred();
10606  if (exc_type) {
10607  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10608  else __PYX_ERR(0, 579, __pyx_L1_error)
10609  }
10610  break;
10611  }
10612  __Pyx_GOTREF(__pyx_t_1);
10613  }
10614  __Pyx_DECREF_SET(__pyx_v_ii, __pyx_t_1);
10615  __pyx_t_1 = 0;
10616 
10617  /* "WaveTools.py":580
10618  * fun = np.zeros((len(theta),len(fi)),)
10619  * for ii in range(len(fun[0,:])):
10620  * fun[:,ii] = np.cos(old_div(theta,2))**(2.*s[ii]) # <<<<<<<<<<<<<<
10621  * return fun
10622  *
10623  */
10624  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
10625  __Pyx_GOTREF(__pyx_t_3);
10626  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
10627  __Pyx_GOTREF(__pyx_t_2);
10628  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10629  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 580, __pyx_L1_error)
10630  __Pyx_GOTREF(__pyx_t_5);
10631  __pyx_t_9 = NULL;
10632  __pyx_t_4 = 0;
10633  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10634  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
10635  if (likely(__pyx_t_9)) {
10636  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10637  __Pyx_INCREF(__pyx_t_9);
10638  __Pyx_INCREF(function);
10639  __Pyx_DECREF_SET(__pyx_t_5, function);
10640  __pyx_t_4 = 1;
10641  }
10642  }
10643  #if CYTHON_FAST_PYCALL
10644  if (PyFunction_Check(__pyx_t_5)) {
10645  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_theta, __pyx_int_2};
10646  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
10647  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10648  __Pyx_GOTREF(__pyx_t_3);
10649  } else
10650  #endif
10651  #if CYTHON_FAST_PYCCALL
10652  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10653  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_theta, __pyx_int_2};
10654  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
10655  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
10656  __Pyx_GOTREF(__pyx_t_3);
10657  } else
10658  #endif
10659  {
10660  __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 580, __pyx_L1_error)
10661  __Pyx_GOTREF(__pyx_t_10);
10662  if (__pyx_t_9) {
10663  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
10664  }
10665  __Pyx_INCREF(__pyx_v_theta);
10666  __Pyx_GIVEREF(__pyx_v_theta);
10667  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_theta);
10668  __Pyx_INCREF(__pyx_int_2);
10669  __Pyx_GIVEREF(__pyx_int_2);
10670  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_int_2);
10671  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
10672  __Pyx_GOTREF(__pyx_t_3);
10673  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10674  }
10675  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10676  __pyx_t_5 = NULL;
10677  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
10678  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
10679  if (likely(__pyx_t_5)) {
10680  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10681  __Pyx_INCREF(__pyx_t_5);
10682  __Pyx_INCREF(function);
10683  __Pyx_DECREF_SET(__pyx_t_2, function);
10684  }
10685  }
10686  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
10687  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10688  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10689  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
10690  __Pyx_GOTREF(__pyx_t_1);
10691  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10692  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_s, __pyx_v_ii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
10693  __Pyx_GOTREF(__pyx_t_2);
10694  __pyx_t_3 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
10695  __Pyx_GOTREF(__pyx_t_3);
10696  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10697  __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error)
10698  __Pyx_GOTREF(__pyx_t_2);
10699  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10700  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10701  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error)
10702  __Pyx_GOTREF(__pyx_t_3);
10703  __Pyx_INCREF(__pyx_slice__4);
10704  __Pyx_GIVEREF(__pyx_slice__4);
10705  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_slice__4);
10706  __Pyx_INCREF(__pyx_v_ii);
10707  __Pyx_GIVEREF(__pyx_v_ii);
10708  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ii);
10709  if (unlikely(PyObject_SetItem(__pyx_v_fun, __pyx_t_3, __pyx_t_2) < 0)) __PYX_ERR(0, 580, __pyx_L1_error)
10710  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10711  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10712 
10713  /* "WaveTools.py":579
10714  * s[ii:] = smax * (old_div(fi[ii:],f0))**(-2.5)
10715  * fun = np.zeros((len(theta),len(fi)),)
10716  * for ii in range(len(fun[0,:])): # <<<<<<<<<<<<<<
10717  * fun[:,ii] = np.cos(old_div(theta,2))**(2.*s[ii])
10718  * return fun
10719  */
10720  }
10721  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10722 
10723  /* "WaveTools.py":581
10724  * for ii in range(len(fun[0,:])):
10725  * fun[:,ii] = np.cos(old_div(theta,2))**(2.*s[ii])
10726  * return fun # <<<<<<<<<<<<<<
10727  *
10728  *
10729  */
10730  __Pyx_XDECREF(__pyx_r);
10731  __Pyx_INCREF(__pyx_v_fun);
10732  __pyx_r = __pyx_v_fun;
10733  goto __pyx_L0;
10734 
10735  /* "WaveTools.py":553
10736  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
10737  * return fun
10738  * def mitsuyasu(theta,fi,f0,smax=10): # <<<<<<<<<<<<<<
10739  * """The cos2s wave directional spread with wave frequency dependency
10740  *
10741  */
10742 
10743  /* function exit code */
10744  __pyx_L1_error:;
10745  __Pyx_XDECREF(__pyx_t_1);
10746  __Pyx_XDECREF(__pyx_t_2);
10747  __Pyx_XDECREF(__pyx_t_3);
10748  __Pyx_XDECREF(__pyx_t_5);
10749  __Pyx_XDECREF(__pyx_t_6);
10750  __Pyx_XDECREF(__pyx_t_9);
10751  __Pyx_XDECREF(__pyx_t_10);
10752  __Pyx_AddTraceback("WaveTools.mitsuyasu", __pyx_clineno, __pyx_lineno, __pyx_filename);
10753  __pyx_r = NULL;
10754  __pyx_L0:;
10755  __Pyx_XDECREF(__pyx_v_s);
10756  __Pyx_XDECREF(__pyx_v_ii);
10757  __Pyx_XDECREF(__pyx_v_fun);
10758  __Pyx_XGIVEREF(__pyx_r);
10759  __Pyx_RefNannyFinishContext();
10760  return __pyx_r;
10761 }
10762 
10763 /* "WaveTools.py":587
10764  *
10765  *
10766  * def dispersion(w,d, g = 9.81,niter = 1000): # <<<<<<<<<<<<<<
10767  * """Calculates the wave number for single or multiple frequencies using linear dispersion relation.
10768  *
10769  */
10770 
10771 /* Python wrapper */
10772 static PyObject *__pyx_pw_9WaveTools_43dispersion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10773 static char __pyx_doc_9WaveTools_42dispersion[] = "Calculates the wave number for single or multiple frequencies using linear dispersion relation.\n\n Parameters\n ----------\n w : float or np.ndarray\n Angular frequency\n d : float\n Water depth\n g : Optional[float]\n Gravitational acceleration\n niter : Optional[int]\n Solution iterations\n\n Returns\n --------\n float or numpy.ndarray\n Wavenumber as a float or 1D array for multiple frequencies\n ";
10774 static PyMethodDef __pyx_mdef_9WaveTools_43dispersion = {"dispersion", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_43dispersion, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_42dispersion};
10775 static PyObject *__pyx_pw_9WaveTools_43dispersion(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10776  PyObject *__pyx_v_w = 0;
10777  PyObject *__pyx_v_d = 0;
10778  PyObject *__pyx_v_g = 0;
10779  PyObject *__pyx_v_niter = 0;
10780  PyObject *__pyx_r = 0;
10781  __Pyx_RefNannyDeclarations
10782  __Pyx_RefNannySetupContext("dispersion (wrapper)", 0);
10783  {
10784  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_w,&__pyx_n_s_d,&__pyx_n_s_g,&__pyx_n_s_niter,0};
10785  PyObject* values[4] = {0,0,0,0};
10786  values[2] = ((PyObject *)((PyObject*)__pyx_float_9_81));
10787  values[3] = ((PyObject *)((PyObject *)__pyx_int_1000));
10788  if (unlikely(__pyx_kwds)) {
10789  Py_ssize_t kw_args;
10790  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10791  switch (pos_args) {
10792  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10793  CYTHON_FALLTHROUGH;
10794  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10795  CYTHON_FALLTHROUGH;
10796  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10797  CYTHON_FALLTHROUGH;
10798  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10799  CYTHON_FALLTHROUGH;
10800  case 0: break;
10801  default: goto __pyx_L5_argtuple_error;
10802  }
10803  kw_args = PyDict_Size(__pyx_kwds);
10804  switch (pos_args) {
10805  case 0:
10806  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
10807  else goto __pyx_L5_argtuple_error;
10808  CYTHON_FALLTHROUGH;
10809  case 1:
10810  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
10811  else {
10812  __Pyx_RaiseArgtupleInvalid("dispersion", 0, 2, 4, 1); __PYX_ERR(0, 587, __pyx_L3_error)
10813  }
10814  CYTHON_FALLTHROUGH;
10815  case 2:
10816  if (kw_args > 0) {
10817  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g);
10818  if (value) { values[2] = value; kw_args--; }
10819  }
10820  CYTHON_FALLTHROUGH;
10821  case 3:
10822  if (kw_args > 0) {
10823  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_niter);
10824  if (value) { values[3] = value; kw_args--; }
10825  }
10826  }
10827  if (unlikely(kw_args > 0)) {
10828  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dispersion") < 0)) __PYX_ERR(0, 587, __pyx_L3_error)
10829  }
10830  } else {
10831  switch (PyTuple_GET_SIZE(__pyx_args)) {
10832  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10833  CYTHON_FALLTHROUGH;
10834  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10835  CYTHON_FALLTHROUGH;
10836  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10837  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10838  break;
10839  default: goto __pyx_L5_argtuple_error;
10840  }
10841  }
10842  __pyx_v_w = values[0];
10843  __pyx_v_d = values[1];
10844  __pyx_v_g = values[2];
10845  __pyx_v_niter = values[3];
10846  }
10847  goto __pyx_L4_argument_unpacking_done;
10848  __pyx_L5_argtuple_error:;
10849  __Pyx_RaiseArgtupleInvalid("dispersion", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 587, __pyx_L3_error)
10850  __pyx_L3_error:;
10851  __Pyx_AddTraceback("WaveTools.dispersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
10852  __Pyx_RefNannyFinishContext();
10853  return NULL;
10854  __pyx_L4_argument_unpacking_done:;
10855  __pyx_r = __pyx_pf_9WaveTools_42dispersion(__pyx_self, __pyx_v_w, __pyx_v_d, __pyx_v_g, __pyx_v_niter);
10856 
10857  /* function exit code */
10858  __Pyx_RefNannyFinishContext();
10859  return __pyx_r;
10860 }
10861 
10862 static PyObject *__pyx_pf_9WaveTools_42dispersion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_w, PyObject *__pyx_v_d, PyObject *__pyx_v_g, PyObject *__pyx_v_niter) {
10863  PyObject *__pyx_v_w_aux = NULL;
10864  PyObject *__pyx_v_K = NULL;
10865  CYTHON_UNUSED PyObject *__pyx_v_jj = NULL;
10866  PyObject *__pyx_r = NULL;
10867  __Pyx_RefNannyDeclarations
10868  PyObject *__pyx_t_1 = NULL;
10869  PyObject *__pyx_t_2 = NULL;
10870  PyObject *__pyx_t_3 = NULL;
10871  PyObject *__pyx_t_4 = NULL;
10872  int __pyx_t_5;
10873  PyObject *__pyx_t_6 = NULL;
10874  Py_ssize_t __pyx_t_7;
10875  PyObject *(*__pyx_t_8)(PyObject *);
10876  PyObject *__pyx_t_9 = NULL;
10877  PyObject *__pyx_t_10 = NULL;
10878  PyObject *__pyx_t_11 = NULL;
10879  int __pyx_t_12;
10880  int __pyx_t_13;
10881  __Pyx_RefNannySetupContext("dispersion", 0);
10882 
10883  /* "WaveTools.py":606
10884  * Wavenumber as a float or 1D array for multiple frequencies
10885  * """
10886  * w_aux = np.array(w) # <<<<<<<<<<<<<<
10887  * K = old_div(w_aux**2,g)
10888  * for jj in range(niter):
10889  */
10890  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
10891  __Pyx_GOTREF(__pyx_t_2);
10892  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 606, __pyx_L1_error)
10893  __Pyx_GOTREF(__pyx_t_3);
10894  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10895  __pyx_t_2 = NULL;
10896  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
10897  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
10898  if (likely(__pyx_t_2)) {
10899  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10900  __Pyx_INCREF(__pyx_t_2);
10901  __Pyx_INCREF(function);
10902  __Pyx_DECREF_SET(__pyx_t_3, function);
10903  }
10904  }
10905  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_w) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_w);
10906  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10907  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
10908  __Pyx_GOTREF(__pyx_t_1);
10909  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10910  __pyx_v_w_aux = __pyx_t_1;
10911  __pyx_t_1 = 0;
10912 
10913  /* "WaveTools.py":607
10914  * """
10915  * w_aux = np.array(w)
10916  * K = old_div(w_aux**2,g) # <<<<<<<<<<<<<<
10917  * for jj in range(niter):
10918  * K = old_div(w_aux**2,(g*np.tanh(K*d)))
10919  */
10920  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
10921  __Pyx_GOTREF(__pyx_t_3);
10922  __pyx_t_2 = PyNumber_Power(__pyx_v_w_aux, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
10923  __Pyx_GOTREF(__pyx_t_2);
10924  __pyx_t_4 = NULL;
10925  __pyx_t_5 = 0;
10926  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
10927  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
10928  if (likely(__pyx_t_4)) {
10929  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10930  __Pyx_INCREF(__pyx_t_4);
10931  __Pyx_INCREF(function);
10932  __Pyx_DECREF_SET(__pyx_t_3, function);
10933  __pyx_t_5 = 1;
10934  }
10935  }
10936  #if CYTHON_FAST_PYCALL
10937  if (PyFunction_Check(__pyx_t_3)) {
10938  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_g};
10939  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
10940  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10941  __Pyx_GOTREF(__pyx_t_1);
10942  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10943  } else
10944  #endif
10945  #if CYTHON_FAST_PYCCALL
10946  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
10947  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_g};
10948  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
10949  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10950  __Pyx_GOTREF(__pyx_t_1);
10951  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10952  } else
10953  #endif
10954  {
10955  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 607, __pyx_L1_error)
10956  __Pyx_GOTREF(__pyx_t_6);
10957  if (__pyx_t_4) {
10958  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
10959  }
10960  __Pyx_GIVEREF(__pyx_t_2);
10961  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
10962  __Pyx_INCREF(__pyx_v_g);
10963  __Pyx_GIVEREF(__pyx_v_g);
10964  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_g);
10965  __pyx_t_2 = 0;
10966  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
10967  __Pyx_GOTREF(__pyx_t_1);
10968  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10969  }
10970  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10971  __pyx_v_K = __pyx_t_1;
10972  __pyx_t_1 = 0;
10973 
10974  /* "WaveTools.py":608
10975  * w_aux = np.array(w)
10976  * K = old_div(w_aux**2,g)
10977  * for jj in range(niter): # <<<<<<<<<<<<<<
10978  * K = old_div(w_aux**2,(g*np.tanh(K*d)))
10979  * if type(K) is float:
10980  */
10981  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
10982  __Pyx_GOTREF(__pyx_t_3);
10983  __pyx_t_6 = NULL;
10984  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
10985  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
10986  if (likely(__pyx_t_6)) {
10987  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10988  __Pyx_INCREF(__pyx_t_6);
10989  __Pyx_INCREF(function);
10990  __Pyx_DECREF_SET(__pyx_t_3, function);
10991  }
10992  }
10993  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_niter) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_niter);
10994  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10995  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
10996  __Pyx_GOTREF(__pyx_t_1);
10997  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10998  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
10999  __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
11000  __pyx_t_8 = NULL;
11001  } else {
11002  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error)
11003  __Pyx_GOTREF(__pyx_t_3);
11004  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error)
11005  }
11006  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11007  for (;;) {
11008  if (likely(!__pyx_t_8)) {
11009  if (likely(PyList_CheckExact(__pyx_t_3))) {
11010  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
11011  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11012  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 608, __pyx_L1_error)
11013  #else
11014  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
11015  __Pyx_GOTREF(__pyx_t_1);
11016  #endif
11017  } else {
11018  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11019  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11020  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 608, __pyx_L1_error)
11021  #else
11022  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
11023  __Pyx_GOTREF(__pyx_t_1);
11024  #endif
11025  }
11026  } else {
11027  __pyx_t_1 = __pyx_t_8(__pyx_t_3);
11028  if (unlikely(!__pyx_t_1)) {
11029  PyObject* exc_type = PyErr_Occurred();
11030  if (exc_type) {
11031  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11032  else __PYX_ERR(0, 608, __pyx_L1_error)
11033  }
11034  break;
11035  }
11036  __Pyx_GOTREF(__pyx_t_1);
11037  }
11038  __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_1);
11039  __pyx_t_1 = 0;
11040 
11041  /* "WaveTools.py":609
11042  * K = old_div(w_aux**2,g)
11043  * for jj in range(niter):
11044  * K = old_div(w_aux**2,(g*np.tanh(K*d))) # <<<<<<<<<<<<<<
11045  * if type(K) is float:
11046  * return K[0]
11047  */
11048  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
11049  __Pyx_GOTREF(__pyx_t_6);
11050  __pyx_t_2 = PyNumber_Power(__pyx_v_w_aux, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error)
11051  __Pyx_GOTREF(__pyx_t_2);
11052  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 609, __pyx_L1_error)
11053  __Pyx_GOTREF(__pyx_t_9);
11054  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_tanh); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 609, __pyx_L1_error)
11055  __Pyx_GOTREF(__pyx_t_10);
11056  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11057  __pyx_t_9 = PyNumber_Multiply(__pyx_v_K, __pyx_v_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 609, __pyx_L1_error)
11058  __Pyx_GOTREF(__pyx_t_9);
11059  __pyx_t_11 = NULL;
11060  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
11061  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
11062  if (likely(__pyx_t_11)) {
11063  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
11064  __Pyx_INCREF(__pyx_t_11);
11065  __Pyx_INCREF(function);
11066  __Pyx_DECREF_SET(__pyx_t_10, function);
11067  }
11068  }
11069  __pyx_t_4 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
11070  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
11071  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11072  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error)
11073  __Pyx_GOTREF(__pyx_t_4);
11074  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11075  __pyx_t_10 = PyNumber_Multiply(__pyx_v_g, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 609, __pyx_L1_error)
11076  __Pyx_GOTREF(__pyx_t_10);
11077  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11078  __pyx_t_4 = NULL;
11079  __pyx_t_5 = 0;
11080  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
11081  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
11082  if (likely(__pyx_t_4)) {
11083  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11084  __Pyx_INCREF(__pyx_t_4);
11085  __Pyx_INCREF(function);
11086  __Pyx_DECREF_SET(__pyx_t_6, function);
11087  __pyx_t_5 = 1;
11088  }
11089  }
11090  #if CYTHON_FAST_PYCALL
11091  if (PyFunction_Check(__pyx_t_6)) {
11092  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_10};
11093  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
11094  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11095  __Pyx_GOTREF(__pyx_t_1);
11096  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11097  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11098  } else
11099  #endif
11100  #if CYTHON_FAST_PYCCALL
11101  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11102  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_10};
11103  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
11104  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11105  __Pyx_GOTREF(__pyx_t_1);
11106  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11107  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11108  } else
11109  #endif
11110  {
11111  __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 609, __pyx_L1_error)
11112  __Pyx_GOTREF(__pyx_t_9);
11113  if (__pyx_t_4) {
11114  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
11115  }
11116  __Pyx_GIVEREF(__pyx_t_2);
11117  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_2);
11118  __Pyx_GIVEREF(__pyx_t_10);
11119  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_10);
11120  __pyx_t_2 = 0;
11121  __pyx_t_10 = 0;
11122  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
11123  __Pyx_GOTREF(__pyx_t_1);
11124  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11125  }
11126  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11127  __Pyx_DECREF_SET(__pyx_v_K, __pyx_t_1);
11128  __pyx_t_1 = 0;
11129 
11130  /* "WaveTools.py":608
11131  * w_aux = np.array(w)
11132  * K = old_div(w_aux**2,g)
11133  * for jj in range(niter): # <<<<<<<<<<<<<<
11134  * K = old_div(w_aux**2,(g*np.tanh(K*d)))
11135  * if type(K) is float:
11136  */
11137  }
11138  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11139 
11140  /* "WaveTools.py":610
11141  * for jj in range(niter):
11142  * K = old_div(w_aux**2,(g*np.tanh(K*d)))
11143  * if type(K) is float: # <<<<<<<<<<<<<<
11144  * return K[0]
11145  * else:
11146  */
11147  __pyx_t_12 = (((PyObject *)Py_TYPE(__pyx_v_K)) == ((PyObject *)(&PyFloat_Type)));
11148  __pyx_t_13 = (__pyx_t_12 != 0);
11149  if (__pyx_t_13) {
11150 
11151  /* "WaveTools.py":611
11152  * K = old_div(w_aux**2,(g*np.tanh(K*d)))
11153  * if type(K) is float:
11154  * return K[0] # <<<<<<<<<<<<<<
11155  * else:
11156  * return K
11157  */
11158  __Pyx_XDECREF(__pyx_r);
11159  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_K, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error)
11160  __Pyx_GOTREF(__pyx_t_3);
11161  __pyx_r = __pyx_t_3;
11162  __pyx_t_3 = 0;
11163  goto __pyx_L0;
11164 
11165  /* "WaveTools.py":610
11166  * for jj in range(niter):
11167  * K = old_div(w_aux**2,(g*np.tanh(K*d)))
11168  * if type(K) is float: # <<<<<<<<<<<<<<
11169  * return K[0]
11170  * else:
11171  */
11172  }
11173 
11174  /* "WaveTools.py":613
11175  * return K[0]
11176  * else:
11177  * return K # <<<<<<<<<<<<<<
11178  *
11179  *
11180  */
11181  /*else*/ {
11182  __Pyx_XDECREF(__pyx_r);
11183  __Pyx_INCREF(__pyx_v_K);
11184  __pyx_r = __pyx_v_K;
11185  goto __pyx_L0;
11186  }
11187 
11188  /* "WaveTools.py":587
11189  *
11190  *
11191  * def dispersion(w,d, g = 9.81,niter = 1000): # <<<<<<<<<<<<<<
11192  * """Calculates the wave number for single or multiple frequencies using linear dispersion relation.
11193  *
11194  */
11195 
11196  /* function exit code */
11197  __pyx_L1_error:;
11198  __Pyx_XDECREF(__pyx_t_1);
11199  __Pyx_XDECREF(__pyx_t_2);
11200  __Pyx_XDECREF(__pyx_t_3);
11201  __Pyx_XDECREF(__pyx_t_4);
11202  __Pyx_XDECREF(__pyx_t_6);
11203  __Pyx_XDECREF(__pyx_t_9);
11204  __Pyx_XDECREF(__pyx_t_10);
11205  __Pyx_XDECREF(__pyx_t_11);
11206  __Pyx_AddTraceback("WaveTools.dispersion", __pyx_clineno, __pyx_lineno, __pyx_filename);
11207  __pyx_r = NULL;
11208  __pyx_L0:;
11209  __Pyx_XDECREF(__pyx_v_w_aux);
11210  __Pyx_XDECREF(__pyx_v_K);
11211  __Pyx_XDECREF(__pyx_v_jj);
11212  __Pyx_XGIVEREF(__pyx_r);
11213  __Pyx_RefNannyFinishContext();
11214  return __pyx_r;
11215 }
11216 
11217 /* "WaveTools.py":616
11218  *
11219  *
11220  * def tophat(l,cutoff): # <<<<<<<<<<<<<<
11221  * """ Calculates and returns a top hat filter array
11222  *
11223  */
11224 
11225 /* Python wrapper */
11226 static PyObject *__pyx_pw_9WaveTools_45tophat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11227 static char __pyx_doc_9WaveTools_44tophat[] = " Calculates and returns a top hat filter array\n\n Parameters\n ----------\n l : int\n Length of array\n cutoff : float\n Cut off fraction at both the leading and tailing part of the array\n\n Returns\n --------\n numpy.ndarray\n\n ";
11228 static PyMethodDef __pyx_mdef_9WaveTools_45tophat = {"tophat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_45tophat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_44tophat};
11229 static PyObject *__pyx_pw_9WaveTools_45tophat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11230  PyObject *__pyx_v_l = 0;
11231  PyObject *__pyx_v_cutoff = 0;
11232  PyObject *__pyx_r = 0;
11233  __Pyx_RefNannyDeclarations
11234  __Pyx_RefNannySetupContext("tophat (wrapper)", 0);
11235  {
11236  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_cutoff,0};
11237  PyObject* values[2] = {0,0};
11238  if (unlikely(__pyx_kwds)) {
11239  Py_ssize_t kw_args;
11240  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11241  switch (pos_args) {
11242  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11243  CYTHON_FALLTHROUGH;
11244  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11245  CYTHON_FALLTHROUGH;
11246  case 0: break;
11247  default: goto __pyx_L5_argtuple_error;
11248  }
11249  kw_args = PyDict_Size(__pyx_kwds);
11250  switch (pos_args) {
11251  case 0:
11252  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
11253  else goto __pyx_L5_argtuple_error;
11254  CYTHON_FALLTHROUGH;
11255  case 1:
11256  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff)) != 0)) kw_args--;
11257  else {
11258  __Pyx_RaiseArgtupleInvalid("tophat", 1, 2, 2, 1); __PYX_ERR(0, 616, __pyx_L3_error)
11259  }
11260  }
11261  if (unlikely(kw_args > 0)) {
11262  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tophat") < 0)) __PYX_ERR(0, 616, __pyx_L3_error)
11263  }
11264  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11265  goto __pyx_L5_argtuple_error;
11266  } else {
11267  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11268  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11269  }
11270  __pyx_v_l = values[0];
11271  __pyx_v_cutoff = values[1];
11272  }
11273  goto __pyx_L4_argument_unpacking_done;
11274  __pyx_L5_argtuple_error:;
11275  __Pyx_RaiseArgtupleInvalid("tophat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 616, __pyx_L3_error)
11276  __pyx_L3_error:;
11277  __Pyx_AddTraceback("WaveTools.tophat", __pyx_clineno, __pyx_lineno, __pyx_filename);
11278  __Pyx_RefNannyFinishContext();
11279  return NULL;
11280  __pyx_L4_argument_unpacking_done:;
11281  __pyx_r = __pyx_pf_9WaveTools_44tophat(__pyx_self, __pyx_v_l, __pyx_v_cutoff);
11282 
11283  /* function exit code */
11284  __Pyx_RefNannyFinishContext();
11285  return __pyx_r;
11286 }
11287 
11288 static PyObject *__pyx_pf_9WaveTools_44tophat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_cutoff) {
11289  PyObject *__pyx_v_a = NULL;
11290  PyObject *__pyx_v_cut = NULL;
11291  PyObject *__pyx_r = NULL;
11292  __Pyx_RefNannyDeclarations
11293  PyObject *__pyx_t_1 = NULL;
11294  PyObject *__pyx_t_2 = NULL;
11295  PyObject *__pyx_t_3 = NULL;
11296  __Pyx_RefNannySetupContext("tophat", 0);
11297 
11298  /* "WaveTools.py":631
11299  *
11300  * """
11301  * a = np.zeros(l,) # <<<<<<<<<<<<<<
11302  * cut = int(cutoff*l)
11303  * a[cut:-cut] = 1.
11304  */
11305  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error)
11306  __Pyx_GOTREF(__pyx_t_2);
11307  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 631, __pyx_L1_error)
11308  __Pyx_GOTREF(__pyx_t_3);
11309  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11310  __pyx_t_2 = NULL;
11311  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11312  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
11313  if (likely(__pyx_t_2)) {
11314  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11315  __Pyx_INCREF(__pyx_t_2);
11316  __Pyx_INCREF(function);
11317  __Pyx_DECREF_SET(__pyx_t_3, function);
11318  }
11319  }
11320  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_l) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_l);
11321  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11322  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
11323  __Pyx_GOTREF(__pyx_t_1);
11324  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11325  __pyx_v_a = __pyx_t_1;
11326  __pyx_t_1 = 0;
11327 
11328  /* "WaveTools.py":632
11329  * """
11330  * a = np.zeros(l,)
11331  * cut = int(cutoff*l) # <<<<<<<<<<<<<<
11332  * a[cut:-cut] = 1.
11333  * return a
11334  */
11335  __pyx_t_1 = PyNumber_Multiply(__pyx_v_cutoff, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error)
11336  __Pyx_GOTREF(__pyx_t_1);
11337  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 632, __pyx_L1_error)
11338  __Pyx_GOTREF(__pyx_t_3);
11339  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11340  __pyx_v_cut = __pyx_t_3;
11341  __pyx_t_3 = 0;
11342 
11343  /* "WaveTools.py":633
11344  * a = np.zeros(l,)
11345  * cut = int(cutoff*l)
11346  * a[cut:-cut] = 1. # <<<<<<<<<<<<<<
11347  * return a
11348  *
11349  */
11350  __pyx_t_3 = PyNumber_Negative(__pyx_v_cut); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L1_error)
11351  __Pyx_GOTREF(__pyx_t_3);
11352  if (__Pyx_PyObject_SetSlice(__pyx_v_a, __pyx_float_1_, 0, 0, &__pyx_v_cut, &__pyx_t_3, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 633, __pyx_L1_error)
11353  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11354 
11355  /* "WaveTools.py":634
11356  * cut = int(cutoff*l)
11357  * a[cut:-cut] = 1.
11358  * return a # <<<<<<<<<<<<<<
11359  *
11360  * def costap(l,cutoff=0.1):
11361  */
11362  __Pyx_XDECREF(__pyx_r);
11363  __Pyx_INCREF(__pyx_v_a);
11364  __pyx_r = __pyx_v_a;
11365  goto __pyx_L0;
11366 
11367  /* "WaveTools.py":616
11368  *
11369  *
11370  * def tophat(l,cutoff): # <<<<<<<<<<<<<<
11371  * """ Calculates and returns a top hat filter array
11372  *
11373  */
11374 
11375  /* function exit code */
11376  __pyx_L1_error:;
11377  __Pyx_XDECREF(__pyx_t_1);
11378  __Pyx_XDECREF(__pyx_t_2);
11379  __Pyx_XDECREF(__pyx_t_3);
11380  __Pyx_AddTraceback("WaveTools.tophat", __pyx_clineno, __pyx_lineno, __pyx_filename);
11381  __pyx_r = NULL;
11382  __pyx_L0:;
11383  __Pyx_XDECREF(__pyx_v_a);
11384  __Pyx_XDECREF(__pyx_v_cut);
11385  __Pyx_XGIVEREF(__pyx_r);
11386  __Pyx_RefNannyFinishContext();
11387  return __pyx_r;
11388 }
11389 
11390 /* "WaveTools.py":636
11391  * return a
11392  *
11393  * def costap(l,cutoff=0.1): # <<<<<<<<<<<<<<
11394  * """ Calculates and returns a top hat filter array
11395  *
11396  */
11397 
11398 /* Python wrapper */
11399 static PyObject *__pyx_pw_9WaveTools_47costap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11400 static char __pyx_doc_9WaveTools_46costap[] = " Calculates and returns a top hat filter array\n\n Parameters\n ----------\n l : int\n Length of array\n cutoff : float\n Cut off fraction at both the leading and tailing part of the array\n\n Returns\n --------\n numpy.ndarray\n ";
11401 static PyMethodDef __pyx_mdef_9WaveTools_47costap = {"costap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_47costap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_46costap};
11402 static PyObject *__pyx_pw_9WaveTools_47costap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11403  PyObject *__pyx_v_l = 0;
11404  PyObject *__pyx_v_cutoff = 0;
11405  PyObject *__pyx_r = 0;
11406  __Pyx_RefNannyDeclarations
11407  __Pyx_RefNannySetupContext("costap (wrapper)", 0);
11408  {
11409  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_l,&__pyx_n_s_cutoff,0};
11410  PyObject* values[2] = {0,0};
11411  values[1] = ((PyObject *)((PyObject*)__pyx_float_0_1));
11412  if (unlikely(__pyx_kwds)) {
11413  Py_ssize_t kw_args;
11414  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11415  switch (pos_args) {
11416  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11417  CYTHON_FALLTHROUGH;
11418  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11419  CYTHON_FALLTHROUGH;
11420  case 0: break;
11421  default: goto __pyx_L5_argtuple_error;
11422  }
11423  kw_args = PyDict_Size(__pyx_kwds);
11424  switch (pos_args) {
11425  case 0:
11426  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_l)) != 0)) kw_args--;
11427  else goto __pyx_L5_argtuple_error;
11428  CYTHON_FALLTHROUGH;
11429  case 1:
11430  if (kw_args > 0) {
11431  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
11432  if (value) { values[1] = value; kw_args--; }
11433  }
11434  }
11435  if (unlikely(kw_args > 0)) {
11436  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "costap") < 0)) __PYX_ERR(0, 636, __pyx_L3_error)
11437  }
11438  } else {
11439  switch (PyTuple_GET_SIZE(__pyx_args)) {
11440  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11441  CYTHON_FALLTHROUGH;
11442  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11443  break;
11444  default: goto __pyx_L5_argtuple_error;
11445  }
11446  }
11447  __pyx_v_l = values[0];
11448  __pyx_v_cutoff = values[1];
11449  }
11450  goto __pyx_L4_argument_unpacking_done;
11451  __pyx_L5_argtuple_error:;
11452  __Pyx_RaiseArgtupleInvalid("costap", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 636, __pyx_L3_error)
11453  __pyx_L3_error:;
11454  __Pyx_AddTraceback("WaveTools.costap", __pyx_clineno, __pyx_lineno, __pyx_filename);
11455  __Pyx_RefNannyFinishContext();
11456  return NULL;
11457  __pyx_L4_argument_unpacking_done:;
11458  __pyx_r = __pyx_pf_9WaveTools_46costap(__pyx_self, __pyx_v_l, __pyx_v_cutoff);
11459 
11460  /* function exit code */
11461  __Pyx_RefNannyFinishContext();
11462  return __pyx_r;
11463 }
11464 
11465 static PyObject *__pyx_pf_9WaveTools_46costap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_l, PyObject *__pyx_v_cutoff) {
11466  PyObject *__pyx_v_npoints = NULL;
11467  PyObject *__pyx_v_wind = NULL;
11468  PyObject *__pyx_v_k = NULL;
11469  PyObject *__pyx_r = NULL;
11470  __Pyx_RefNannyDeclarations
11471  PyObject *__pyx_t_1 = NULL;
11472  PyObject *__pyx_t_2 = NULL;
11473  PyObject *__pyx_t_3 = NULL;
11474  Py_ssize_t __pyx_t_4;
11475  PyObject *(*__pyx_t_5)(PyObject *);
11476  int __pyx_t_6;
11477  double __pyx_t_7;
11478  double __pyx_t_8;
11479  __Pyx_RefNannySetupContext("costap", 0);
11480 
11481  /* "WaveTools.py":650
11482  * numpy.ndarray
11483  * """
11484  * npoints = int(cutoff*l) # <<<<<<<<<<<<<<
11485  * wind = np.ones(l)
11486  * for k in range(l): # (k,np) = (n,N) normally used
11487  */
11488  __pyx_t_1 = PyNumber_Multiply(__pyx_v_cutoff, __pyx_v_l); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
11489  __Pyx_GOTREF(__pyx_t_1);
11490  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 650, __pyx_L1_error)
11491  __Pyx_GOTREF(__pyx_t_2);
11492  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11493  __pyx_v_npoints = __pyx_t_2;
11494  __pyx_t_2 = 0;
11495 
11496  /* "WaveTools.py":651
11497  * """
11498  * npoints = int(cutoff*l)
11499  * wind = np.ones(l) # <<<<<<<<<<<<<<
11500  * for k in range(l): # (k,np) = (n,N) normally used
11501  * if k < npoints:
11502  */
11503  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 651, __pyx_L1_error)
11504  __Pyx_GOTREF(__pyx_t_1);
11505  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error)
11506  __Pyx_GOTREF(__pyx_t_3);
11507  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11508  __pyx_t_1 = NULL;
11509  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11510  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
11511  if (likely(__pyx_t_1)) {
11512  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11513  __Pyx_INCREF(__pyx_t_1);
11514  __Pyx_INCREF(function);
11515  __Pyx_DECREF_SET(__pyx_t_3, function);
11516  }
11517  }
11518  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_l) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_l);
11519  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11520  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 651, __pyx_L1_error)
11521  __Pyx_GOTREF(__pyx_t_2);
11522  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11523  __pyx_v_wind = __pyx_t_2;
11524  __pyx_t_2 = 0;
11525 
11526  /* "WaveTools.py":652
11527  * npoints = int(cutoff*l)
11528  * wind = np.ones(l)
11529  * for k in range(l): # (k,np) = (n,N) normally used # <<<<<<<<<<<<<<
11530  * if k < npoints:
11531  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11532  */
11533  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error)
11534  __Pyx_GOTREF(__pyx_t_3);
11535  __pyx_t_1 = NULL;
11536  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
11537  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
11538  if (likely(__pyx_t_1)) {
11539  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11540  __Pyx_INCREF(__pyx_t_1);
11541  __Pyx_INCREF(function);
11542  __Pyx_DECREF_SET(__pyx_t_3, function);
11543  }
11544  }
11545  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_l) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_l);
11546  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11547  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
11548  __Pyx_GOTREF(__pyx_t_2);
11549  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11550  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
11551  __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
11552  __pyx_t_5 = NULL;
11553  } else {
11554  __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 652, __pyx_L1_error)
11555  __Pyx_GOTREF(__pyx_t_3);
11556  __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
11557  }
11558  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11559  for (;;) {
11560  if (likely(!__pyx_t_5)) {
11561  if (likely(PyList_CheckExact(__pyx_t_3))) {
11562  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
11563  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11564  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 652, __pyx_L1_error)
11565  #else
11566  __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
11567  __Pyx_GOTREF(__pyx_t_2);
11568  #endif
11569  } else {
11570  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
11571  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11572  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 652, __pyx_L1_error)
11573  #else
11574  __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error)
11575  __Pyx_GOTREF(__pyx_t_2);
11576  #endif
11577  }
11578  } else {
11579  __pyx_t_2 = __pyx_t_5(__pyx_t_3);
11580  if (unlikely(!__pyx_t_2)) {
11581  PyObject* exc_type = PyErr_Occurred();
11582  if (exc_type) {
11583  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11584  else __PYX_ERR(0, 652, __pyx_L1_error)
11585  }
11586  break;
11587  }
11588  __Pyx_GOTREF(__pyx_t_2);
11589  }
11590  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2);
11591  __pyx_t_2 = 0;
11592 
11593  /* "WaveTools.py":653
11594  * wind = np.ones(l)
11595  * for k in range(l): # (k,np) = (n,N) normally used
11596  * if k < npoints: # <<<<<<<<<<<<<<
11597  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11598  * if k > l - npoints -1:
11599  */
11600  __pyx_t_2 = PyObject_RichCompare(__pyx_v_k, __pyx_v_npoints, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
11601  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 653, __pyx_L1_error)
11602  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11603  if (__pyx_t_6) {
11604 
11605  /* "WaveTools.py":654
11606  * for k in range(l): # (k,np) = (n,N) normally used
11607  * if k < npoints:
11608  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints))) # <<<<<<<<<<<<<<
11609  * if k > l - npoints -1:
11610  * wind[k] = 0.5*(1.-cos(M_PI*float(l-k-1)/float(npoints)))
11611  */
11612  __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_k); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error)
11613  __pyx_t_8 = (M_PI * __pyx_t_7);
11614  __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_npoints); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error)
11615  if (unlikely(__pyx_t_7 == 0)) {
11616  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11617  __PYX_ERR(0, 654, __pyx_L1_error)
11618  }
11619  __pyx_t_2 = PyFloat_FromDouble((0.5 * (1. - cos((__pyx_t_8 / __pyx_t_7))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
11620  __Pyx_GOTREF(__pyx_t_2);
11621  if (unlikely(PyObject_SetItem(__pyx_v_wind, __pyx_v_k, __pyx_t_2) < 0)) __PYX_ERR(0, 654, __pyx_L1_error)
11622  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11623 
11624  /* "WaveTools.py":653
11625  * wind = np.ones(l)
11626  * for k in range(l): # (k,np) = (n,N) normally used
11627  * if k < npoints: # <<<<<<<<<<<<<<
11628  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11629  * if k > l - npoints -1:
11630  */
11631  }
11632 
11633  /* "WaveTools.py":655
11634  * if k < npoints:
11635  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11636  * if k > l - npoints -1: # <<<<<<<<<<<<<<
11637  * wind[k] = 0.5*(1.-cos(M_PI*float(l-k-1)/float(npoints)))
11638  * return wind
11639  */
11640  __pyx_t_2 = PyNumber_Subtract(__pyx_v_l, __pyx_v_npoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
11641  __Pyx_GOTREF(__pyx_t_2);
11642  __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
11643  __Pyx_GOTREF(__pyx_t_1);
11644  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11645  __pyx_t_2 = PyObject_RichCompare(__pyx_v_k, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
11646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11647  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 655, __pyx_L1_error)
11648  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11649  if (__pyx_t_6) {
11650 
11651  /* "WaveTools.py":656
11652  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11653  * if k > l - npoints -1:
11654  * wind[k] = 0.5*(1.-cos(M_PI*float(l-k-1)/float(npoints))) # <<<<<<<<<<<<<<
11655  * return wind
11656  *
11657  */
11658  __pyx_t_2 = PyNumber_Subtract(__pyx_v_l, __pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
11659  __Pyx_GOTREF(__pyx_t_2);
11660  __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
11661  __Pyx_GOTREF(__pyx_t_1);
11662  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11663  __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_1); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error)
11664  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11665  __pyx_t_8 = (M_PI * __pyx_t_7);
11666  __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_npoints); if (unlikely(__pyx_t_7 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error)
11667  if (unlikely(__pyx_t_7 == 0)) {
11668  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
11669  __PYX_ERR(0, 656, __pyx_L1_error)
11670  }
11671  __pyx_t_1 = PyFloat_FromDouble((0.5 * (1. - cos((__pyx_t_8 / __pyx_t_7))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 656, __pyx_L1_error)
11672  __Pyx_GOTREF(__pyx_t_1);
11673  if (unlikely(PyObject_SetItem(__pyx_v_wind, __pyx_v_k, __pyx_t_1) < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
11674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11675 
11676  /* "WaveTools.py":655
11677  * if k < npoints:
11678  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11679  * if k > l - npoints -1: # <<<<<<<<<<<<<<
11680  * wind[k] = 0.5*(1.-cos(M_PI*float(l-k-1)/float(npoints)))
11681  * return wind
11682  */
11683  }
11684 
11685  /* "WaveTools.py":652
11686  * npoints = int(cutoff*l)
11687  * wind = np.ones(l)
11688  * for k in range(l): # (k,np) = (n,N) normally used # <<<<<<<<<<<<<<
11689  * if k < npoints:
11690  * wind[k] = 0.5*(1.-cos(M_PI*float(k)/float(npoints)))
11691  */
11692  }
11693  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11694 
11695  /* "WaveTools.py":657
11696  * if k > l - npoints -1:
11697  * wind[k] = 0.5*(1.-cos(M_PI*float(l-k-1)/float(npoints)))
11698  * return wind # <<<<<<<<<<<<<<
11699  *
11700  * def decompose_tseries(time,eta,dt):
11701  */
11702  __Pyx_XDECREF(__pyx_r);
11703  __Pyx_INCREF(__pyx_v_wind);
11704  __pyx_r = __pyx_v_wind;
11705  goto __pyx_L0;
11706 
11707  /* "WaveTools.py":636
11708  * return a
11709  *
11710  * def costap(l,cutoff=0.1): # <<<<<<<<<<<<<<
11711  * """ Calculates and returns a top hat filter array
11712  *
11713  */
11714 
11715  /* function exit code */
11716  __pyx_L1_error:;
11717  __Pyx_XDECREF(__pyx_t_1);
11718  __Pyx_XDECREF(__pyx_t_2);
11719  __Pyx_XDECREF(__pyx_t_3);
11720  __Pyx_AddTraceback("WaveTools.costap", __pyx_clineno, __pyx_lineno, __pyx_filename);
11721  __pyx_r = NULL;
11722  __pyx_L0:;
11723  __Pyx_XDECREF(__pyx_v_npoints);
11724  __Pyx_XDECREF(__pyx_v_wind);
11725  __Pyx_XDECREF(__pyx_v_k);
11726  __Pyx_XGIVEREF(__pyx_r);
11727  __Pyx_RefNannyFinishContext();
11728  return __pyx_r;
11729 }
11730 
11731 /* "WaveTools.py":659
11732  * return wind
11733  *
11734  * def decompose_tseries(time,eta,dt): # <<<<<<<<<<<<<<
11735  * """ Performs spectral analysis and calculates angular frequency components, amplitude, phase and mean level power
11736  * of a time series with constant sampling.
11737  */
11738 
11739 /* Python wrapper */
11740 static PyObject *__pyx_pw_9WaveTools_49decompose_tseries(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11741 static char __pyx_doc_9WaveTools_48decompose_tseries[] = " Performs spectral analysis and calculates angular frequency components, amplitude, phase and mean level power\n of a time series with constant sampling.\n\n Parameters\n ----------\n time : numpy.ndarray\n Time array\n eta :numpy.ndarray\n Signal array\n dt : float\n Sampling interval\n\n Returns\n --------\n List\n A list with results with four entries:\n 0 -> numpy array with angular frequency components\n 1 -> numpy array with amplitude of each component aa\n 2 -> numpy array with phase of each component pp\n 3 -> float of the 0th fourier mode (wave setup)\n\n ";
11742 static PyMethodDef __pyx_mdef_9WaveTools_49decompose_tseries = {"decompose_tseries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_49decompose_tseries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_48decompose_tseries};
11743 static PyObject *__pyx_pw_9WaveTools_49decompose_tseries(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11744  PyObject *__pyx_v_time = 0;
11745  PyObject *__pyx_v_eta = 0;
11746  PyObject *__pyx_v_dt = 0;
11747  PyObject *__pyx_r = 0;
11748  __Pyx_RefNannyDeclarations
11749  __Pyx_RefNannySetupContext("decompose_tseries (wrapper)", 0);
11750  {
11751  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_time,&__pyx_n_s_eta,&__pyx_n_s_dt,0};
11752  PyObject* values[3] = {0,0,0};
11753  if (unlikely(__pyx_kwds)) {
11754  Py_ssize_t kw_args;
11755  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11756  switch (pos_args) {
11757  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11758  CYTHON_FALLTHROUGH;
11759  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11760  CYTHON_FALLTHROUGH;
11761  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11762  CYTHON_FALLTHROUGH;
11763  case 0: break;
11764  default: goto __pyx_L5_argtuple_error;
11765  }
11766  kw_args = PyDict_Size(__pyx_kwds);
11767  switch (pos_args) {
11768  case 0:
11769  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_time)) != 0)) kw_args--;
11770  else goto __pyx_L5_argtuple_error;
11771  CYTHON_FALLTHROUGH;
11772  case 1:
11773  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_eta)) != 0)) kw_args--;
11774  else {
11775  __Pyx_RaiseArgtupleInvalid("decompose_tseries", 1, 3, 3, 1); __PYX_ERR(0, 659, __pyx_L3_error)
11776  }
11777  CYTHON_FALLTHROUGH;
11778  case 2:
11779  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
11780  else {
11781  __Pyx_RaiseArgtupleInvalid("decompose_tseries", 1, 3, 3, 2); __PYX_ERR(0, 659, __pyx_L3_error)
11782  }
11783  }
11784  if (unlikely(kw_args > 0)) {
11785  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "decompose_tseries") < 0)) __PYX_ERR(0, 659, __pyx_L3_error)
11786  }
11787  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
11788  goto __pyx_L5_argtuple_error;
11789  } else {
11790  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11791  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11792  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11793  }
11794  __pyx_v_time = values[0];
11795  __pyx_v_eta = values[1];
11796  __pyx_v_dt = values[2];
11797  }
11798  goto __pyx_L4_argument_unpacking_done;
11799  __pyx_L5_argtuple_error:;
11800  __Pyx_RaiseArgtupleInvalid("decompose_tseries", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 659, __pyx_L3_error)
11801  __pyx_L3_error:;
11802  __Pyx_AddTraceback("WaveTools.decompose_tseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
11803  __Pyx_RefNannyFinishContext();
11804  return NULL;
11805  __pyx_L4_argument_unpacking_done:;
11806  __pyx_r = __pyx_pf_9WaveTools_48decompose_tseries(__pyx_self, __pyx_v_time, __pyx_v_eta, __pyx_v_dt);
11807 
11808  /* function exit code */
11809  __Pyx_RefNannyFinishContext();
11810  return __pyx_r;
11811 }
11812 
11813 static PyObject *__pyx_pf_9WaveTools_48decompose_tseries(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time, PyObject *__pyx_v_eta, PyObject *__pyx_v_dt) {
11814  PyObject *__pyx_v_nfft = NULL;
11815  PyObject *__pyx_v_results = NULL;
11816  PyObject *__pyx_v_fft_x = NULL;
11817  PyObject *__pyx_v_freq = NULL;
11818  PyObject *__pyx_v_iend = NULL;
11819  PyObject *__pyx_v_setup = NULL;
11820  PyObject *__pyx_v_aa = NULL;
11821  PyObject *__pyx_v_ww = NULL;
11822  PyObject *__pyx_v_pp = NULL;
11823  PyObject *__pyx_v_k = NULL;
11824  PyObject *__pyx_r = NULL;
11825  __Pyx_RefNannyDeclarations
11826  Py_ssize_t __pyx_t_1;
11827  PyObject *__pyx_t_2 = NULL;
11828  PyObject *__pyx_t_3 = NULL;
11829  PyObject *__pyx_t_4 = NULL;
11830  int __pyx_t_5;
11831  PyObject *__pyx_t_6 = NULL;
11832  PyObject *__pyx_t_7 = NULL;
11833  PyObject *__pyx_t_8 = NULL;
11834  PyObject *(*__pyx_t_9)(PyObject *);
11835  int __pyx_t_10;
11836  __Pyx_RefNannySetupContext("decompose_tseries", 0);
11837 
11838  /* "WaveTools.py":682
11839  *
11840  * """
11841  * nfft = len(time) # <<<<<<<<<<<<<<
11842  * results = []
11843  * fft_x = np.fft.fft(eta,nfft)
11844  */
11845  __pyx_t_1 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 682, __pyx_L1_error)
11846  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 682, __pyx_L1_error)
11847  __Pyx_GOTREF(__pyx_t_2);
11848  __pyx_v_nfft = __pyx_t_2;
11849  __pyx_t_2 = 0;
11850 
11851  /* "WaveTools.py":683
11852  * """
11853  * nfft = len(time)
11854  * results = [] # <<<<<<<<<<<<<<
11855  * fft_x = np.fft.fft(eta,nfft)
11856  * freq = np.fft.fftfreq(nfft,dt) #%complex spectrum
11857  */
11858  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 683, __pyx_L1_error)
11859  __Pyx_GOTREF(__pyx_t_2);
11860  __pyx_v_results = ((PyObject*)__pyx_t_2);
11861  __pyx_t_2 = 0;
11862 
11863  /* "WaveTools.py":684
11864  * nfft = len(time)
11865  * results = []
11866  * fft_x = np.fft.fft(eta,nfft) # <<<<<<<<<<<<<<
11867  * freq = np.fft.fftfreq(nfft,dt) #%complex spectrum
11868  * iend = np.where(freq<0)[0][0]
11869  */
11870  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error)
11871  __Pyx_GOTREF(__pyx_t_3);
11872  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fft); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error)
11873  __Pyx_GOTREF(__pyx_t_4);
11874  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11875  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_fft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 684, __pyx_L1_error)
11876  __Pyx_GOTREF(__pyx_t_3);
11877  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11878  __pyx_t_4 = NULL;
11879  __pyx_t_5 = 0;
11880  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11881  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
11882  if (likely(__pyx_t_4)) {
11883  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11884  __Pyx_INCREF(__pyx_t_4);
11885  __Pyx_INCREF(function);
11886  __Pyx_DECREF_SET(__pyx_t_3, function);
11887  __pyx_t_5 = 1;
11888  }
11889  }
11890  #if CYTHON_FAST_PYCALL
11891  if (PyFunction_Check(__pyx_t_3)) {
11892  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_eta, __pyx_v_nfft};
11893  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
11894  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11895  __Pyx_GOTREF(__pyx_t_2);
11896  } else
11897  #endif
11898  #if CYTHON_FAST_PYCCALL
11899  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
11900  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_eta, __pyx_v_nfft};
11901  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
11902  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11903  __Pyx_GOTREF(__pyx_t_2);
11904  } else
11905  #endif
11906  {
11907  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
11908  __Pyx_GOTREF(__pyx_t_6);
11909  if (__pyx_t_4) {
11910  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
11911  }
11912  __Pyx_INCREF(__pyx_v_eta);
11913  __Pyx_GIVEREF(__pyx_v_eta);
11914  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_eta);
11915  __Pyx_INCREF(__pyx_v_nfft);
11916  __Pyx_GIVEREF(__pyx_v_nfft);
11917  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_nfft);
11918  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 684, __pyx_L1_error)
11919  __Pyx_GOTREF(__pyx_t_2);
11920  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11921  }
11922  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11923  __pyx_v_fft_x = __pyx_t_2;
11924  __pyx_t_2 = 0;
11925 
11926  /* "WaveTools.py":685
11927  * results = []
11928  * fft_x = np.fft.fft(eta,nfft)
11929  * freq = np.fft.fftfreq(nfft,dt) #%complex spectrum # <<<<<<<<<<<<<<
11930  * iend = np.where(freq<0)[0][0]
11931  * setup = old_div(np.real(fft_x[0]),nfft)
11932  */
11933  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
11934  __Pyx_GOTREF(__pyx_t_3);
11935  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_fft); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
11936  __Pyx_GOTREF(__pyx_t_6);
11937  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11938  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_fftfreq); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error)
11939  __Pyx_GOTREF(__pyx_t_3);
11940  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11941  __pyx_t_6 = NULL;
11942  __pyx_t_5 = 0;
11943  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
11944  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
11945  if (likely(__pyx_t_6)) {
11946  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
11947  __Pyx_INCREF(__pyx_t_6);
11948  __Pyx_INCREF(function);
11949  __Pyx_DECREF_SET(__pyx_t_3, function);
11950  __pyx_t_5 = 1;
11951  }
11952  }
11953  #if CYTHON_FAST_PYCALL
11954  if (PyFunction_Check(__pyx_t_3)) {
11955  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_nfft, __pyx_v_dt};
11956  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
11957  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11958  __Pyx_GOTREF(__pyx_t_2);
11959  } else
11960  #endif
11961  #if CYTHON_FAST_PYCCALL
11962  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
11963  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_nfft, __pyx_v_dt};
11964  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
11965  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11966  __Pyx_GOTREF(__pyx_t_2);
11967  } else
11968  #endif
11969  {
11970  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
11971  __Pyx_GOTREF(__pyx_t_4);
11972  if (__pyx_t_6) {
11973  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
11974  }
11975  __Pyx_INCREF(__pyx_v_nfft);
11976  __Pyx_GIVEREF(__pyx_v_nfft);
11977  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_nfft);
11978  __Pyx_INCREF(__pyx_v_dt);
11979  __Pyx_GIVEREF(__pyx_v_dt);
11980  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_dt);
11981  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error)
11982  __Pyx_GOTREF(__pyx_t_2);
11983  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11984  }
11985  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11986  __pyx_v_freq = __pyx_t_2;
11987  __pyx_t_2 = 0;
11988 
11989  /* "WaveTools.py":686
11990  * fft_x = np.fft.fft(eta,nfft)
11991  * freq = np.fft.fftfreq(nfft,dt) #%complex spectrum
11992  * iend = np.where(freq<0)[0][0] # <<<<<<<<<<<<<<
11993  * setup = old_div(np.real(fft_x[0]),nfft)
11994  * fft_x = fft_x[1:iend]
11995  */
11996  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
11997  __Pyx_GOTREF(__pyx_t_3);
11998  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
11999  __Pyx_GOTREF(__pyx_t_4);
12000  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12001  __pyx_t_3 = PyObject_RichCompare(__pyx_v_freq, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 686, __pyx_L1_error)
12002  __pyx_t_6 = NULL;
12003  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12004  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
12005  if (likely(__pyx_t_6)) {
12006  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12007  __Pyx_INCREF(__pyx_t_6);
12008  __Pyx_INCREF(function);
12009  __Pyx_DECREF_SET(__pyx_t_4, function);
12010  }
12011  }
12012  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
12013  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12014  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12015  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
12016  __Pyx_GOTREF(__pyx_t_2);
12017  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12018  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
12019  __Pyx_GOTREF(__pyx_t_4);
12020  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12021  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 686, __pyx_L1_error)
12022  __Pyx_GOTREF(__pyx_t_2);
12023  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12024  __pyx_v_iend = __pyx_t_2;
12025  __pyx_t_2 = 0;
12026 
12027  /* "WaveTools.py":687
12028  * freq = np.fft.fftfreq(nfft,dt) #%complex spectrum
12029  * iend = np.where(freq<0)[0][0]
12030  * setup = old_div(np.real(fft_x[0]),nfft) # <<<<<<<<<<<<<<
12031  * fft_x = fft_x[1:iend]
12032  * freq = freq[1:iend]
12033  */
12034  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_old_div); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error)
12035  __Pyx_GOTREF(__pyx_t_4);
12036  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error)
12037  __Pyx_GOTREF(__pyx_t_6);
12038  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error)
12039  __Pyx_GOTREF(__pyx_t_7);
12040  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12041  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_fft_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error)
12042  __Pyx_GOTREF(__pyx_t_6);
12043  __pyx_t_8 = NULL;
12044  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
12045  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
12046  if (likely(__pyx_t_8)) {
12047  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
12048  __Pyx_INCREF(__pyx_t_8);
12049  __Pyx_INCREF(function);
12050  __Pyx_DECREF_SET(__pyx_t_7, function);
12051  }
12052  }
12053  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
12054  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12055  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12056  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
12057  __Pyx_GOTREF(__pyx_t_3);
12058  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12059  __pyx_t_7 = NULL;
12060  __pyx_t_5 = 0;
12061  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12062  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
12063  if (likely(__pyx_t_7)) {
12064  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12065  __Pyx_INCREF(__pyx_t_7);
12066  __Pyx_INCREF(function);
12067  __Pyx_DECREF_SET(__pyx_t_4, function);
12068  __pyx_t_5 = 1;
12069  }
12070  }
12071  #if CYTHON_FAST_PYCALL
12072  if (PyFunction_Check(__pyx_t_4)) {
12073  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_v_nfft};
12074  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
12075  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12076  __Pyx_GOTREF(__pyx_t_2);
12077  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12078  } else
12079  #endif
12080  #if CYTHON_FAST_PYCCALL
12081  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12082  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_v_nfft};
12083  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
12084  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12085  __Pyx_GOTREF(__pyx_t_2);
12086  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12087  } else
12088  #endif
12089  {
12090  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 687, __pyx_L1_error)
12091  __Pyx_GOTREF(__pyx_t_6);
12092  if (__pyx_t_7) {
12093  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
12094  }
12095  __Pyx_GIVEREF(__pyx_t_3);
12096  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
12097  __Pyx_INCREF(__pyx_v_nfft);
12098  __Pyx_GIVEREF(__pyx_v_nfft);
12099  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_nfft);
12100  __pyx_t_3 = 0;
12101  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
12102  __Pyx_GOTREF(__pyx_t_2);
12103  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12104  }
12105  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12106  __pyx_v_setup = __pyx_t_2;
12107  __pyx_t_2 = 0;
12108 
12109  /* "WaveTools.py":688
12110  * iend = np.where(freq<0)[0][0]
12111  * setup = old_div(np.real(fft_x[0]),nfft)
12112  * fft_x = fft_x[1:iend] # <<<<<<<<<<<<<<
12113  * freq = freq[1:iend]
12114  * #%retaining only first half of the spectrum
12115  */
12116  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_fft_x, 1, 0, NULL, &__pyx_v_iend, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 688, __pyx_L1_error)
12117  __Pyx_GOTREF(__pyx_t_2);
12118  __Pyx_DECREF_SET(__pyx_v_fft_x, __pyx_t_2);
12119  __pyx_t_2 = 0;
12120 
12121  /* "WaveTools.py":689
12122  * setup = old_div(np.real(fft_x[0]),nfft)
12123  * fft_x = fft_x[1:iend]
12124  * freq = freq[1:iend] # <<<<<<<<<<<<<<
12125  * #%retaining only first half of the spectrum
12126  * aa = 2.*abs(fft_x)/nfft #%amplitudes (only the ones related to positive frequencies)
12127  */
12128  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_freq, 1, 0, NULL, &__pyx_v_iend, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 689, __pyx_L1_error)
12129  __Pyx_GOTREF(__pyx_t_2);
12130  __Pyx_DECREF_SET(__pyx_v_freq, __pyx_t_2);
12131  __pyx_t_2 = 0;
12132 
12133  /* "WaveTools.py":691
12134  * freq = freq[1:iend]
12135  * #%retaining only first half of the spectrum
12136  * aa = 2.*abs(fft_x)/nfft #%amplitudes (only the ones related to positive frequencies) # <<<<<<<<<<<<<<
12137  * ww = 2*M_PI*freq
12138  *
12139  */
12140  __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_v_fft_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
12141  __Pyx_GOTREF(__pyx_t_2);
12142  __pyx_t_4 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error)
12143  __Pyx_GOTREF(__pyx_t_4);
12144  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12145  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_nfft); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error)
12146  __Pyx_GOTREF(__pyx_t_2);
12147  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12148  __pyx_v_aa = __pyx_t_2;
12149  __pyx_t_2 = 0;
12150 
12151  /* "WaveTools.py":692
12152  * #%retaining only first half of the spectrum
12153  * aa = 2.*abs(fft_x)/nfft #%amplitudes (only the ones related to positive frequencies)
12154  * ww = 2*M_PI*freq # <<<<<<<<<<<<<<
12155  *
12156  *
12157  */
12158  __pyx_t_2 = PyFloat_FromDouble((2.0 * M_PI)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 692, __pyx_L1_error)
12159  __Pyx_GOTREF(__pyx_t_2);
12160  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_freq); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
12161  __Pyx_GOTREF(__pyx_t_4);
12162  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12163  __pyx_v_ww = __pyx_t_4;
12164  __pyx_t_4 = 0;
12165 
12166  /* "WaveTools.py":695
12167  *
12168  *
12169  * pp = np.zeros(len(aa),complex) # <<<<<<<<<<<<<<
12170  * for k in range(len(aa)):
12171  * pp[k]=cmat.phase(fft_x[k]) #% Calculating phases phases
12172  */
12173  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
12174  __Pyx_GOTREF(__pyx_t_2);
12175  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 695, __pyx_L1_error)
12176  __Pyx_GOTREF(__pyx_t_6);
12177  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12178  __pyx_t_1 = PyObject_Length(__pyx_v_aa); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 695, __pyx_L1_error)
12179  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L1_error)
12180  __Pyx_GOTREF(__pyx_t_2);
12181  __pyx_t_3 = NULL;
12182  __pyx_t_5 = 0;
12183  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12184  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
12185  if (likely(__pyx_t_3)) {
12186  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12187  __Pyx_INCREF(__pyx_t_3);
12188  __Pyx_INCREF(function);
12189  __Pyx_DECREF_SET(__pyx_t_6, function);
12190  __pyx_t_5 = 1;
12191  }
12192  }
12193  #if CYTHON_FAST_PYCALL
12194  if (PyFunction_Check(__pyx_t_6)) {
12195  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, ((PyObject *)(&PyComplex_Type))};
12196  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
12197  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12198  __Pyx_GOTREF(__pyx_t_4);
12199  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12200  } else
12201  #endif
12202  #if CYTHON_FAST_PYCCALL
12203  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12204  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, ((PyObject *)(&PyComplex_Type))};
12205  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
12206  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12207  __Pyx_GOTREF(__pyx_t_4);
12208  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12209  } else
12210  #endif
12211  {
12212  __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 695, __pyx_L1_error)
12213  __Pyx_GOTREF(__pyx_t_7);
12214  if (__pyx_t_3) {
12215  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
12216  }
12217  __Pyx_GIVEREF(__pyx_t_2);
12218  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_t_2);
12219  __Pyx_INCREF(((PyObject *)(&PyComplex_Type)));
12220  __Pyx_GIVEREF(((PyObject *)(&PyComplex_Type)));
12221  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, ((PyObject *)(&PyComplex_Type)));
12222  __pyx_t_2 = 0;
12223  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 695, __pyx_L1_error)
12224  __Pyx_GOTREF(__pyx_t_4);
12225  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12226  }
12227  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12228  __pyx_v_pp = __pyx_t_4;
12229  __pyx_t_4 = 0;
12230 
12231  /* "WaveTools.py":696
12232  *
12233  * pp = np.zeros(len(aa),complex)
12234  * for k in range(len(aa)): # <<<<<<<<<<<<<<
12235  * pp[k]=cmat.phase(fft_x[k]) #% Calculating phases phases
12236  * pp = np.real(pp) # Append results to list
12237  */
12238  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
12239  __Pyx_GOTREF(__pyx_t_6);
12240  __pyx_t_1 = PyObject_Length(__pyx_v_aa); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 696, __pyx_L1_error)
12241  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error)
12242  __Pyx_GOTREF(__pyx_t_7);
12243  __pyx_t_2 = NULL;
12244  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
12245  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
12246  if (likely(__pyx_t_2)) {
12247  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12248  __Pyx_INCREF(__pyx_t_2);
12249  __Pyx_INCREF(function);
12250  __Pyx_DECREF_SET(__pyx_t_6, function);
12251  }
12252  }
12253  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7);
12254  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12255  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12256  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
12257  __Pyx_GOTREF(__pyx_t_4);
12258  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12259  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
12260  __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_1 = 0;
12261  __pyx_t_9 = NULL;
12262  } else {
12263  __pyx_t_1 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
12264  __Pyx_GOTREF(__pyx_t_6);
12265  __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 696, __pyx_L1_error)
12266  }
12267  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12268  for (;;) {
12269  if (likely(!__pyx_t_9)) {
12270  if (likely(PyList_CheckExact(__pyx_t_6))) {
12271  if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_6)) break;
12272  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12273  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 696, __pyx_L1_error)
12274  #else
12275  __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
12276  __Pyx_GOTREF(__pyx_t_4);
12277  #endif
12278  } else {
12279  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
12280  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12281  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_1); __Pyx_INCREF(__pyx_t_4); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 696, __pyx_L1_error)
12282  #else
12283  __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 696, __pyx_L1_error)
12284  __Pyx_GOTREF(__pyx_t_4);
12285  #endif
12286  }
12287  } else {
12288  __pyx_t_4 = __pyx_t_9(__pyx_t_6);
12289  if (unlikely(!__pyx_t_4)) {
12290  PyObject* exc_type = PyErr_Occurred();
12291  if (exc_type) {
12292  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12293  else __PYX_ERR(0, 696, __pyx_L1_error)
12294  }
12295  break;
12296  }
12297  __Pyx_GOTREF(__pyx_t_4);
12298  }
12299  __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4);
12300  __pyx_t_4 = 0;
12301 
12302  /* "WaveTools.py":697
12303  * pp = np.zeros(len(aa),complex)
12304  * for k in range(len(aa)):
12305  * pp[k]=cmat.phase(fft_x[k]) #% Calculating phases phases # <<<<<<<<<<<<<<
12306  * pp = np.real(pp) # Append results to list
12307  * results.append(ww)
12308  */
12309  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_cmat); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 697, __pyx_L1_error)
12310  __Pyx_GOTREF(__pyx_t_7);
12311  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_phase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
12312  __Pyx_GOTREF(__pyx_t_2);
12313  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12314  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_fft_x, __pyx_v_k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 697, __pyx_L1_error)
12315  __Pyx_GOTREF(__pyx_t_7);
12316  __pyx_t_3 = NULL;
12317  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
12318  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
12319  if (likely(__pyx_t_3)) {
12320  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12321  __Pyx_INCREF(__pyx_t_3);
12322  __Pyx_INCREF(function);
12323  __Pyx_DECREF_SET(__pyx_t_2, function);
12324  }
12325  }
12326  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7);
12327  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12328  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12329  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 697, __pyx_L1_error)
12330  __Pyx_GOTREF(__pyx_t_4);
12331  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12332  if (unlikely(PyObject_SetItem(__pyx_v_pp, __pyx_v_k, __pyx_t_4) < 0)) __PYX_ERR(0, 697, __pyx_L1_error)
12333  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12334 
12335  /* "WaveTools.py":696
12336  *
12337  * pp = np.zeros(len(aa),complex)
12338  * for k in range(len(aa)): # <<<<<<<<<<<<<<
12339  * pp[k]=cmat.phase(fft_x[k]) #% Calculating phases phases
12340  * pp = np.real(pp) # Append results to list
12341  */
12342  }
12343  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12344 
12345  /* "WaveTools.py":698
12346  * for k in range(len(aa)):
12347  * pp[k]=cmat.phase(fft_x[k]) #% Calculating phases phases
12348  * pp = np.real(pp) # Append results to list # <<<<<<<<<<<<<<
12349  * results.append(ww)
12350  * results.append(aa)
12351  */
12352  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
12353  __Pyx_GOTREF(__pyx_t_4);
12354  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 698, __pyx_L1_error)
12355  __Pyx_GOTREF(__pyx_t_2);
12356  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12357  __pyx_t_4 = NULL;
12358  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
12359  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
12360  if (likely(__pyx_t_4)) {
12361  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12362  __Pyx_INCREF(__pyx_t_4);
12363  __Pyx_INCREF(function);
12364  __Pyx_DECREF_SET(__pyx_t_2, function);
12365  }
12366  }
12367  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v_pp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pp);
12368  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12369  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 698, __pyx_L1_error)
12370  __Pyx_GOTREF(__pyx_t_6);
12371  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12372  __Pyx_DECREF_SET(__pyx_v_pp, __pyx_t_6);
12373  __pyx_t_6 = 0;
12374 
12375  /* "WaveTools.py":699
12376  * pp[k]=cmat.phase(fft_x[k]) #% Calculating phases phases
12377  * pp = np.real(pp) # Append results to list
12378  * results.append(ww) # <<<<<<<<<<<<<<
12379  * results.append(aa)
12380  * results.append(pp)
12381  */
12382  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_ww); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 699, __pyx_L1_error)
12383 
12384  /* "WaveTools.py":700
12385  * pp = np.real(pp) # Append results to list
12386  * results.append(ww)
12387  * results.append(aa) # <<<<<<<<<<<<<<
12388  * results.append(pp)
12389  * results.append(setup)
12390  */
12391  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_aa); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 700, __pyx_L1_error)
12392 
12393  /* "WaveTools.py":701
12394  * results.append(ww)
12395  * results.append(aa)
12396  * results.append(pp) # <<<<<<<<<<<<<<
12397  * results.append(setup)
12398  * return results
12399  */
12400  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_pp); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 701, __pyx_L1_error)
12401 
12402  /* "WaveTools.py":702
12403  * results.append(aa)
12404  * results.append(pp)
12405  * results.append(setup) # <<<<<<<<<<<<<<
12406  * return results
12407  *
12408  */
12409  __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_results, __pyx_v_setup); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 702, __pyx_L1_error)
12410 
12411  /* "WaveTools.py":703
12412  * results.append(pp)
12413  * results.append(setup)
12414  * return results # <<<<<<<<<<<<<<
12415  *
12416  * class SteadyCurrent(object):
12417  */
12418  __Pyx_XDECREF(__pyx_r);
12419  __Pyx_INCREF(__pyx_v_results);
12420  __pyx_r = __pyx_v_results;
12421  goto __pyx_L0;
12422 
12423  /* "WaveTools.py":659
12424  * return wind
12425  *
12426  * def decompose_tseries(time,eta,dt): # <<<<<<<<<<<<<<
12427  * """ Performs spectral analysis and calculates angular frequency components, amplitude, phase and mean level power
12428  * of a time series with constant sampling.
12429  */
12430 
12431  /* function exit code */
12432  __pyx_L1_error:;
12433  __Pyx_XDECREF(__pyx_t_2);
12434  __Pyx_XDECREF(__pyx_t_3);
12435  __Pyx_XDECREF(__pyx_t_4);
12436  __Pyx_XDECREF(__pyx_t_6);
12437  __Pyx_XDECREF(__pyx_t_7);
12438  __Pyx_XDECREF(__pyx_t_8);
12439  __Pyx_AddTraceback("WaveTools.decompose_tseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
12440  __pyx_r = NULL;
12441  __pyx_L0:;
12442  __Pyx_XDECREF(__pyx_v_nfft);
12443  __Pyx_XDECREF(__pyx_v_results);
12444  __Pyx_XDECREF(__pyx_v_fft_x);
12445  __Pyx_XDECREF(__pyx_v_freq);
12446  __Pyx_XDECREF(__pyx_v_iend);
12447  __Pyx_XDECREF(__pyx_v_setup);
12448  __Pyx_XDECREF(__pyx_v_aa);
12449  __Pyx_XDECREF(__pyx_v_ww);
12450  __Pyx_XDECREF(__pyx_v_pp);
12451  __Pyx_XDECREF(__pyx_v_k);
12452  __Pyx_XGIVEREF(__pyx_r);
12453  __Pyx_RefNannyFinishContext();
12454  return __pyx_r;
12455 }
12456 
12457 /* "WaveTools.py":719
12458  *
12459  * """
12460  * def __init__(self, # <<<<<<<<<<<<<<
12461  * U,
12462  * mwl,
12463  */
12464 
12465 /* Python wrapper */
12466 static int __pyx_pw_9WaveTools_13SteadyCurrent_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12467 static int __pyx_pw_9WaveTools_13SteadyCurrent_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12468  PyObject *__pyx_v_U = 0;
12469  PyObject *__pyx_v_mwl = 0;
12470  PyObject *__pyx_v_rampTime = 0;
12471  int __pyx_r;
12472  __Pyx_RefNannyDeclarations
12473  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
12474  {
12475  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_U,&__pyx_n_s_mwl,&__pyx_n_s_rampTime,0};
12476  PyObject* values[3] = {0,0,0};
12477  values[2] = ((PyObject *)__pyx_float_0_);
12478  if (unlikely(__pyx_kwds)) {
12479  Py_ssize_t kw_args;
12480  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12481  switch (pos_args) {
12482  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12483  CYTHON_FALLTHROUGH;
12484  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12485  CYTHON_FALLTHROUGH;
12486  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12487  CYTHON_FALLTHROUGH;
12488  case 0: break;
12489  default: goto __pyx_L5_argtuple_error;
12490  }
12491  kw_args = PyDict_Size(__pyx_kwds);
12492  switch (pos_args) {
12493  case 0:
12494  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_U)) != 0)) kw_args--;
12495  else goto __pyx_L5_argtuple_error;
12496  CYTHON_FALLTHROUGH;
12497  case 1:
12498  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
12499  else {
12500  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 719, __pyx_L3_error)
12501  }
12502  CYTHON_FALLTHROUGH;
12503  case 2:
12504  if (kw_args > 0) {
12505  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rampTime);
12506  if (value) { values[2] = value; kw_args--; }
12507  }
12508  }
12509  if (unlikely(kw_args > 0)) {
12510  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 719, __pyx_L3_error)
12511  }
12512  } else {
12513  switch (PyTuple_GET_SIZE(__pyx_args)) {
12514  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12515  CYTHON_FALLTHROUGH;
12516  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12517  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12518  break;
12519  default: goto __pyx_L5_argtuple_error;
12520  }
12521  }
12522  __pyx_v_U = values[0];
12523  __pyx_v_mwl = values[1];
12524  __pyx_v_rampTime = values[2];
12525  }
12526  goto __pyx_L4_argument_unpacking_done;
12527  __pyx_L5_argtuple_error:;
12528  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 719, __pyx_L3_error)
12529  __pyx_L3_error:;
12530  __Pyx_AddTraceback("WaveTools.SteadyCurrent.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12531  __Pyx_RefNannyFinishContext();
12532  return -1;
12533  __pyx_L4_argument_unpacking_done:;
12534  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent___init__(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self), __pyx_v_U, __pyx_v_mwl, __pyx_v_rampTime);
12535 
12536  /* function exit code */
12537  __Pyx_RefNannyFinishContext();
12538  return __pyx_r;
12539 }
12540 
12541 static int __pyx_pf_9WaveTools_13SteadyCurrent___init__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, PyObject *__pyx_v_U, PyObject *__pyx_v_mwl, PyObject *__pyx_v_rampTime) {
12542  int __pyx_r;
12543  __Pyx_RefNannyDeclarations
12544  double __pyx_t_1;
12545  PyObject *__pyx_t_2 = NULL;
12546  PyObject *__pyx_t_3 = NULL;
12547  PyObject *__pyx_t_4 = NULL;
12548  Py_ssize_t __pyx_t_5;
12549  int __pyx_t_6;
12550  PyObject *__pyx_t_7 = NULL;
12551  PyObject *__pyx_t_8 = NULL;
12552  PyObject *__pyx_t_9 = NULL;
12553  PyObject *__pyx_t_10 = NULL;
12554  PyObject *__pyx_t_11 = NULL;
12555  PyObject *__pyx_t_12 = NULL;
12556  __Pyx_RefNannySetupContext("__init__", 0);
12557 
12558  /* "WaveTools.py":723
12559  * mwl,
12560  * rampTime = 0.):
12561  * self.mwl = mwl # <<<<<<<<<<<<<<
12562  * try:
12563  * if len(U)!=3:
12564  */
12565  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 723, __pyx_L1_error)
12566  __pyx_v_self->mwl = __pyx_t_1;
12567 
12568  /* "WaveTools.py":724
12569  * rampTime = 0.):
12570  * self.mwl = mwl
12571  * try: # <<<<<<<<<<<<<<
12572  * if len(U)!=3:
12573  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12574  */
12575  {
12576  __Pyx_PyThreadState_declare
12577  __Pyx_PyThreadState_assign
12578  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
12579  __Pyx_XGOTREF(__pyx_t_2);
12580  __Pyx_XGOTREF(__pyx_t_3);
12581  __Pyx_XGOTREF(__pyx_t_4);
12582  /*try:*/ {
12583 
12584  /* "WaveTools.py":725
12585  * self.mwl = mwl
12586  * try:
12587  * if len(U)!=3: # <<<<<<<<<<<<<<
12588  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12589  * sys.exit(1)
12590  */
12591  __pyx_t_5 = PyObject_Length(__pyx_v_U); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 725, __pyx_L3_error)
12592  __pyx_t_6 = ((__pyx_t_5 != 3) != 0);
12593  if (__pyx_t_6) {
12594 
12595  /* "WaveTools.py":726
12596  * try:
12597  * if len(U)!=3:
12598  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3") # <<<<<<<<<<<<<<
12599  * sys.exit(1)
12600  *
12601  */
12602  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 726, __pyx_L3_error)
12603  __Pyx_GOTREF(__pyx_t_8);
12604  __pyx_t_9 = NULL;
12605  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
12606  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
12607  if (likely(__pyx_t_9)) {
12608  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
12609  __Pyx_INCREF(__pyx_t_9);
12610  __Pyx_INCREF(function);
12611  __Pyx_DECREF_SET(__pyx_t_8, function);
12612  }
12613  }
12614  __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_ERROR_Wavetools_py_SteadyCurrent) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_ERROR_Wavetools_py_SteadyCurrent);
12615  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12616  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L3_error)
12617  __Pyx_GOTREF(__pyx_t_7);
12618  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12619  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12620 
12621  /* "WaveTools.py":727
12622  * if len(U)!=3:
12623  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12624  * sys.exit(1) # <<<<<<<<<<<<<<
12625  *
12626  * except:
12627  */
12628  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sys); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 727, __pyx_L3_error)
12629  __Pyx_GOTREF(__pyx_t_8);
12630  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 727, __pyx_L3_error)
12631  __Pyx_GOTREF(__pyx_t_9);
12632  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12633  __pyx_t_8 = NULL;
12634  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
12635  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
12636  if (likely(__pyx_t_8)) {
12637  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
12638  __Pyx_INCREF(__pyx_t_8);
12639  __Pyx_INCREF(function);
12640  __Pyx_DECREF_SET(__pyx_t_9, function);
12641  }
12642  }
12643  __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_int_1);
12644  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12645  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L3_error)
12646  __Pyx_GOTREF(__pyx_t_7);
12647  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12648  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12649 
12650  /* "WaveTools.py":725
12651  * self.mwl = mwl
12652  * try:
12653  * if len(U)!=3: # <<<<<<<<<<<<<<
12654  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12655  * sys.exit(1)
12656  */
12657  }
12658 
12659  /* "WaveTools.py":724
12660  * rampTime = 0.):
12661  * self.mwl = mwl
12662  * try: # <<<<<<<<<<<<<<
12663  * if len(U)!=3:
12664  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12665  */
12666  }
12667  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12668  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
12669  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
12670  goto __pyx_L8_try_end;
12671  __pyx_L3_error:;
12672  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12673  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12674  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12675 
12676  /* "WaveTools.py":729
12677  * sys.exit(1)
12678  *
12679  * except: # <<<<<<<<<<<<<<
12680  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12681  * sys.exit(1)
12682  */
12683  /*except:*/ {
12684  __Pyx_AddTraceback("WaveTools.SteadyCurrent.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12685  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(0, 729, __pyx_L5_except_error)
12686  __Pyx_GOTREF(__pyx_t_7);
12687  __Pyx_GOTREF(__pyx_t_9);
12688  __Pyx_GOTREF(__pyx_t_8);
12689 
12690  /* "WaveTools.py":730
12691  *
12692  * except:
12693  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3") # <<<<<<<<<<<<<<
12694  * sys.exit(1)
12695  * self.U = np.array(U)
12696  */
12697  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 730, __pyx_L5_except_error)
12698  __Pyx_GOTREF(__pyx_t_11);
12699  __pyx_t_12 = NULL;
12700  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
12701  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
12702  if (likely(__pyx_t_12)) {
12703  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
12704  __Pyx_INCREF(__pyx_t_12);
12705  __Pyx_INCREF(function);
12706  __Pyx_DECREF_SET(__pyx_t_11, function);
12707  }
12708  }
12709  __pyx_t_10 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_kp_s_ERROR_Wavetools_py_SteadyCurrent) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_kp_s_ERROR_Wavetools_py_SteadyCurrent);
12710  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
12711  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 730, __pyx_L5_except_error)
12712  __Pyx_GOTREF(__pyx_t_10);
12713  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12714  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12715 
12716  /* "WaveTools.py":731
12717  * except:
12718  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12719  * sys.exit(1) # <<<<<<<<<<<<<<
12720  * self.U = np.array(U)
12721  * self.ramp = rampTime
12722  */
12723  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 731, __pyx_L5_except_error)
12724  __Pyx_GOTREF(__pyx_t_11);
12725  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 731, __pyx_L5_except_error)
12726  __Pyx_GOTREF(__pyx_t_12);
12727  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
12728  __pyx_t_11 = NULL;
12729  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
12730  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
12731  if (likely(__pyx_t_11)) {
12732  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
12733  __Pyx_INCREF(__pyx_t_11);
12734  __Pyx_INCREF(function);
12735  __Pyx_DECREF_SET(__pyx_t_12, function);
12736  }
12737  }
12738  __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_int_1);
12739  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
12740  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 731, __pyx_L5_except_error)
12741  __Pyx_GOTREF(__pyx_t_10);
12742  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
12743  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12744  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12745  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12746  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
12747  goto __pyx_L4_exception_handled;
12748  }
12749  __pyx_L5_except_error:;
12750 
12751  /* "WaveTools.py":724
12752  * rampTime = 0.):
12753  * self.mwl = mwl
12754  * try: # <<<<<<<<<<<<<<
12755  * if len(U)!=3:
12756  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12757  */
12758  __Pyx_XGIVEREF(__pyx_t_2);
12759  __Pyx_XGIVEREF(__pyx_t_3);
12760  __Pyx_XGIVEREF(__pyx_t_4);
12761  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12762  goto __pyx_L1_error;
12763  __pyx_L4_exception_handled:;
12764  __Pyx_XGIVEREF(__pyx_t_2);
12765  __Pyx_XGIVEREF(__pyx_t_3);
12766  __Pyx_XGIVEREF(__pyx_t_4);
12767  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12768  __pyx_L8_try_end:;
12769  }
12770 
12771  /* "WaveTools.py":732
12772  * logEvent("ERROR! Wavetools.py: SteadyCurrent velocity argument needs to be a vector with length = 3")
12773  * sys.exit(1)
12774  * self.U = np.array(U) # <<<<<<<<<<<<<<
12775  * self.ramp = rampTime
12776  *
12777  */
12778  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 732, __pyx_L1_error)
12779  __Pyx_GOTREF(__pyx_t_9);
12780  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error)
12781  __Pyx_GOTREF(__pyx_t_7);
12782  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12783  __pyx_t_9 = NULL;
12784  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
12785  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
12786  if (likely(__pyx_t_9)) {
12787  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
12788  __Pyx_INCREF(__pyx_t_9);
12789  __Pyx_INCREF(function);
12790  __Pyx_DECREF_SET(__pyx_t_7, function);
12791  }
12792  }
12793  __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_v_U) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_U);
12794  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12795  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 732, __pyx_L1_error)
12796  __Pyx_GOTREF(__pyx_t_8);
12797  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12798  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 732, __pyx_L1_error)
12799  __Pyx_GIVEREF(__pyx_t_8);
12800  __Pyx_GOTREF(__pyx_v_self->U);
12801  __Pyx_DECREF(((PyObject *)__pyx_v_self->U));
12802  __pyx_v_self->U = ((PyArrayObject *)__pyx_t_8);
12803  __pyx_t_8 = 0;
12804 
12805  /* "WaveTools.py":733
12806  * sys.exit(1)
12807  * self.U = np.array(U)
12808  * self.ramp = rampTime # <<<<<<<<<<<<<<
12809  *
12810  * def eta(self,x,t):
12811  */
12812  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_rampTime); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 733, __pyx_L1_error)
12813  __pyx_v_self->ramp = __pyx_t_1;
12814 
12815  /* "WaveTools.py":719
12816  *
12817  * """
12818  * def __init__(self, # <<<<<<<<<<<<<<
12819  * U,
12820  * mwl,
12821  */
12822 
12823  /* function exit code */
12824  __pyx_r = 0;
12825  goto __pyx_L0;
12826  __pyx_L1_error:;
12827  __Pyx_XDECREF(__pyx_t_7);
12828  __Pyx_XDECREF(__pyx_t_8);
12829  __Pyx_XDECREF(__pyx_t_9);
12830  __Pyx_XDECREF(__pyx_t_10);
12831  __Pyx_XDECREF(__pyx_t_11);
12832  __Pyx_XDECREF(__pyx_t_12);
12833  __Pyx_AddTraceback("WaveTools.SteadyCurrent.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12834  __pyx_r = -1;
12835  __pyx_L0:;
12836  __Pyx_RefNannyFinishContext();
12837  return __pyx_r;
12838 }
12839 
12840 /* "WaveTools.py":735
12841  * self.ramp = rampTime
12842  *
12843  * def eta(self,x,t): # <<<<<<<<<<<<<<
12844  * """Calculates free surface elevation (SolitaryWave class)
12845  * Parameters
12846  */
12847 
12848 /* Python wrapper */
12849 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12850 static char __pyx_doc_9WaveTools_13SteadyCurrent_2eta[] = "Calculates free surface elevation (SolitaryWave class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
12851 static PyMethodDef __pyx_mdef_9WaveTools_13SteadyCurrent_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13SteadyCurrent_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13SteadyCurrent_2eta};
12852 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12853  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
12854  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
12855  PyObject *__pyx_r = 0;
12856  __Pyx_RefNannyDeclarations
12857  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
12858  {
12859  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
12860  PyObject* values[2] = {0,0};
12861  if (unlikely(__pyx_kwds)) {
12862  Py_ssize_t kw_args;
12863  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12864  switch (pos_args) {
12865  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12866  CYTHON_FALLTHROUGH;
12867  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12868  CYTHON_FALLTHROUGH;
12869  case 0: break;
12870  default: goto __pyx_L5_argtuple_error;
12871  }
12872  kw_args = PyDict_Size(__pyx_kwds);
12873  switch (pos_args) {
12874  case 0:
12875  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
12876  else goto __pyx_L5_argtuple_error;
12877  CYTHON_FALLTHROUGH;
12878  case 1:
12879  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
12880  else {
12881  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 735, __pyx_L3_error)
12882  }
12883  }
12884  if (unlikely(kw_args > 0)) {
12885  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 735, __pyx_L3_error)
12886  }
12887  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12888  goto __pyx_L5_argtuple_error;
12889  } else {
12890  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12891  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12892  }
12893  __pyx_v_x = values[0];
12894  __pyx_v_t = values[1];
12895  }
12896  goto __pyx_L4_argument_unpacking_done;
12897  __pyx_L5_argtuple_error:;
12898  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 735, __pyx_L3_error)
12899  __pyx_L3_error:;
12900  __Pyx_AddTraceback("WaveTools.SteadyCurrent.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
12901  __Pyx_RefNannyFinishContext();
12902  return NULL;
12903  __pyx_L4_argument_unpacking_done:;
12904  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent_2eta(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
12905 
12906  /* function exit code */
12907  __Pyx_RefNannyFinishContext();
12908  return __pyx_r;
12909 }
12910 
12911 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_2eta(CYTHON_UNUSED struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
12912  PyObject *__pyx_r = NULL;
12913  __Pyx_RefNannyDeclarations
12914  __Pyx_RefNannySetupContext("eta", 0);
12915 
12916  /* "WaveTools.py":750
12917  *
12918  * """
12919  * return 0. # <<<<<<<<<<<<<<
12920  * def u(self,x,t):
12921  * """Calculates wave velocity vector (SolitaryWave class).
12922  */
12923  __Pyx_XDECREF(__pyx_r);
12924  __Pyx_INCREF(__pyx_float_0_);
12925  __pyx_r = __pyx_float_0_;
12926  goto __pyx_L0;
12927 
12928  /* "WaveTools.py":735
12929  * self.ramp = rampTime
12930  *
12931  * def eta(self,x,t): # <<<<<<<<<<<<<<
12932  * """Calculates free surface elevation (SolitaryWave class)
12933  * Parameters
12934  */
12935 
12936  /* function exit code */
12937  __pyx_L0:;
12938  __Pyx_XGIVEREF(__pyx_r);
12939  __Pyx_RefNannyFinishContext();
12940  return __pyx_r;
12941 }
12942 
12943 /* "WaveTools.py":751
12944  * """
12945  * return 0.
12946  * def u(self,x,t): # <<<<<<<<<<<<<<
12947  * """Calculates wave velocity vector (SolitaryWave class).
12948  * Parameters
12949  */
12950 
12951 /* Python wrapper */
12952 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12953 static char __pyx_doc_9WaveTools_13SteadyCurrent_4u[] = "Calculates wave velocity vector (SolitaryWave class).\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
12954 static PyMethodDef __pyx_mdef_9WaveTools_13SteadyCurrent_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13SteadyCurrent_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13SteadyCurrent_4u};
12955 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12956  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
12957  PyObject *__pyx_v_t = 0;
12958  PyObject *__pyx_r = 0;
12959  __Pyx_RefNannyDeclarations
12960  __Pyx_RefNannySetupContext("u (wrapper)", 0);
12961  {
12962  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
12963  PyObject* values[2] = {0,0};
12964  if (unlikely(__pyx_kwds)) {
12965  Py_ssize_t kw_args;
12966  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12967  switch (pos_args) {
12968  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12969  CYTHON_FALLTHROUGH;
12970  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12971  CYTHON_FALLTHROUGH;
12972  case 0: break;
12973  default: goto __pyx_L5_argtuple_error;
12974  }
12975  kw_args = PyDict_Size(__pyx_kwds);
12976  switch (pos_args) {
12977  case 0:
12978  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
12979  else goto __pyx_L5_argtuple_error;
12980  CYTHON_FALLTHROUGH;
12981  case 1:
12982  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
12983  else {
12984  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 751, __pyx_L3_error)
12985  }
12986  }
12987  if (unlikely(kw_args > 0)) {
12988  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 751, __pyx_L3_error)
12989  }
12990  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12991  goto __pyx_L5_argtuple_error;
12992  } else {
12993  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12994  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12995  }
12996  __pyx_v_x = values[0];
12997  __pyx_v_t = values[1];
12998  }
12999  goto __pyx_L4_argument_unpacking_done;
13000  __pyx_L5_argtuple_error:;
13001  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 751, __pyx_L3_error)
13002  __pyx_L3_error:;
13003  __Pyx_AddTraceback("WaveTools.SteadyCurrent.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
13004  __Pyx_RefNannyFinishContext();
13005  return NULL;
13006  __pyx_L4_argument_unpacking_done:;
13007  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent_4u(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
13008 
13009  /* function exit code */
13010  __Pyx_RefNannyFinishContext();
13011  return __pyx_r;
13012 }
13013 
13014 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_4u(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
13015  PyObject *__pyx_v_U = NULL;
13016  PyObject *__pyx_r = NULL;
13017  __Pyx_RefNannyDeclarations
13018  PyObject *__pyx_t_1 = NULL;
13019  PyObject *__pyx_t_2 = NULL;
13020  PyObject *__pyx_t_3 = NULL;
13021  int __pyx_t_4;
13022  __Pyx_RefNannySetupContext("u", 0);
13023 
13024  /* "WaveTools.py":766
13025  *
13026  * """
13027  * U = np.zeros(3,) # <<<<<<<<<<<<<<
13028  * if(t<self.ramp):
13029  * U=self.U*t/self.ramp
13030  */
13031  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
13032  __Pyx_GOTREF(__pyx_t_2);
13033  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
13034  __Pyx_GOTREF(__pyx_t_3);
13035  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13036  __pyx_t_2 = NULL;
13037  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
13038  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
13039  if (likely(__pyx_t_2)) {
13040  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13041  __Pyx_INCREF(__pyx_t_2);
13042  __Pyx_INCREF(function);
13043  __Pyx_DECREF_SET(__pyx_t_3, function);
13044  }
13045  }
13046  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
13047  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13048  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
13049  __Pyx_GOTREF(__pyx_t_1);
13050  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13051  __pyx_v_U = __pyx_t_1;
13052  __pyx_t_1 = 0;
13053 
13054  /* "WaveTools.py":767
13055  * """
13056  * U = np.zeros(3,)
13057  * if(t<self.ramp): # <<<<<<<<<<<<<<
13058  * U=self.U*t/self.ramp
13059  * else:
13060  */
13061  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->ramp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 767, __pyx_L1_error)
13062  __Pyx_GOTREF(__pyx_t_1);
13063  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
13064  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13065  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 767, __pyx_L1_error)
13066  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13067  if (__pyx_t_4) {
13068 
13069  /* "WaveTools.py":768
13070  * U = np.zeros(3,)
13071  * if(t<self.ramp):
13072  * U=self.U*t/self.ramp # <<<<<<<<<<<<<<
13073  * else:
13074  * U=self.U
13075  */
13076  __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_self->U), __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error)
13077  __Pyx_GOTREF(__pyx_t_3);
13078  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->ramp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error)
13079  __Pyx_GOTREF(__pyx_t_1);
13080  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
13081  __Pyx_GOTREF(__pyx_t_2);
13082  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13083  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13084  __Pyx_DECREF_SET(__pyx_v_U, __pyx_t_2);
13085  __pyx_t_2 = 0;
13086 
13087  /* "WaveTools.py":767
13088  * """
13089  * U = np.zeros(3,)
13090  * if(t<self.ramp): # <<<<<<<<<<<<<<
13091  * U=self.U*t/self.ramp
13092  * else:
13093  */
13094  goto __pyx_L3;
13095  }
13096 
13097  /* "WaveTools.py":770
13098  * U=self.U*t/self.ramp
13099  * else:
13100  * U=self.U # <<<<<<<<<<<<<<
13101  * return U
13102  *
13103  */
13104  /*else*/ {
13105  __pyx_t_2 = ((PyObject *)__pyx_v_self->U);
13106  __Pyx_INCREF(__pyx_t_2);
13107  __Pyx_DECREF_SET(__pyx_v_U, __pyx_t_2);
13108  __pyx_t_2 = 0;
13109  }
13110  __pyx_L3:;
13111 
13112  /* "WaveTools.py":771
13113  * else:
13114  * U=self.U
13115  * return U # <<<<<<<<<<<<<<
13116  *
13117  *
13118  */
13119  __Pyx_XDECREF(__pyx_r);
13120  __Pyx_INCREF(__pyx_v_U);
13121  __pyx_r = __pyx_v_U;
13122  goto __pyx_L0;
13123 
13124  /* "WaveTools.py":751
13125  * """
13126  * return 0.
13127  * def u(self,x,t): # <<<<<<<<<<<<<<
13128  * """Calculates wave velocity vector (SolitaryWave class).
13129  * Parameters
13130  */
13131 
13132  /* function exit code */
13133  __pyx_L1_error:;
13134  __Pyx_XDECREF(__pyx_t_1);
13135  __Pyx_XDECREF(__pyx_t_2);
13136  __Pyx_XDECREF(__pyx_t_3);
13137  __Pyx_AddTraceback("WaveTools.SteadyCurrent.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
13138  __pyx_r = NULL;
13139  __pyx_L0:;
13140  __Pyx_XDECREF(__pyx_v_U);
13141  __Pyx_XGIVEREF(__pyx_r);
13142  __Pyx_RefNannyFinishContext();
13143  return __pyx_r;
13144 }
13145 
13146 /* "WaveTools.pxd":39
13147  * cdef class SteadyCurrent:
13148  * cdef public:
13149  * double mwl # <<<<<<<<<<<<<<
13150  * cdef np.ndarray U
13151  * cdef double ramp
13152  */
13153 
13154 /* Python wrapper */
13155 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
13156 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_3mwl_1__get__(PyObject *__pyx_v_self) {
13157  PyObject *__pyx_r = 0;
13158  __Pyx_RefNannyDeclarations
13159  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13160  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent_3mwl___get__(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self));
13161 
13162  /* function exit code */
13163  __Pyx_RefNannyFinishContext();
13164  return __pyx_r;
13165 }
13166 
13167 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_3mwl___get__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self) {
13168  PyObject *__pyx_r = NULL;
13169  __Pyx_RefNannyDeclarations
13170  PyObject *__pyx_t_1 = NULL;
13171  __Pyx_RefNannySetupContext("__get__", 0);
13172  __Pyx_XDECREF(__pyx_r);
13173  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 39, __pyx_L1_error)
13174  __Pyx_GOTREF(__pyx_t_1);
13175  __pyx_r = __pyx_t_1;
13176  __pyx_t_1 = 0;
13177  goto __pyx_L0;
13178 
13179  /* function exit code */
13180  __pyx_L1_error:;
13181  __Pyx_XDECREF(__pyx_t_1);
13182  __Pyx_AddTraceback("WaveTools.SteadyCurrent.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13183  __pyx_r = NULL;
13184  __pyx_L0:;
13185  __Pyx_XGIVEREF(__pyx_r);
13186  __Pyx_RefNannyFinishContext();
13187  return __pyx_r;
13188 }
13189 
13190 /* Python wrapper */
13191 static int __pyx_pw_9WaveTools_13SteadyCurrent_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
13192 static int __pyx_pw_9WaveTools_13SteadyCurrent_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
13193  int __pyx_r;
13194  __Pyx_RefNannyDeclarations
13195  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
13196  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent_3mwl_2__set__(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self), ((PyObject *)__pyx_v_value));
13197 
13198  /* function exit code */
13199  __Pyx_RefNannyFinishContext();
13200  return __pyx_r;
13201 }
13202 
13203 static int __pyx_pf_9WaveTools_13SteadyCurrent_3mwl_2__set__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, PyObject *__pyx_v_value) {
13204  int __pyx_r;
13205  __Pyx_RefNannyDeclarations
13206  double __pyx_t_1;
13207  __Pyx_RefNannySetupContext("__set__", 0);
13208  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 39, __pyx_L1_error)
13209  __pyx_v_self->mwl = __pyx_t_1;
13210 
13211  /* function exit code */
13212  __pyx_r = 0;
13213  goto __pyx_L0;
13214  __pyx_L1_error:;
13215  __Pyx_AddTraceback("WaveTools.SteadyCurrent.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13216  __pyx_r = -1;
13217  __pyx_L0:;
13218  __Pyx_RefNannyFinishContext();
13219  return __pyx_r;
13220 }
13221 
13222 /* "(tree fragment)":1
13223  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13224  * cdef tuple state
13225  * cdef object _dict
13226  */
13227 
13228 /* Python wrapper */
13229 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13230 static PyMethodDef __pyx_mdef_9WaveTools_13SteadyCurrent_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_13SteadyCurrent_7__reduce_cython__, METH_NOARGS, 0};
13231 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13232  PyObject *__pyx_r = 0;
13233  __Pyx_RefNannyDeclarations
13234  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13235  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent_6__reduce_cython__(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self));
13236 
13237  /* function exit code */
13238  __Pyx_RefNannyFinishContext();
13239  return __pyx_r;
13240 }
13241 
13242 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_6__reduce_cython__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self) {
13243  PyObject *__pyx_v_state = 0;
13244  PyObject *__pyx_v__dict = 0;
13245  int __pyx_v_use_setstate;
13246  PyObject *__pyx_r = NULL;
13247  __Pyx_RefNannyDeclarations
13248  PyObject *__pyx_t_1 = NULL;
13249  PyObject *__pyx_t_2 = NULL;
13250  PyObject *__pyx_t_3 = NULL;
13251  int __pyx_t_4;
13252  int __pyx_t_5;
13253  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13254 
13255  /* "(tree fragment)":5
13256  * cdef object _dict
13257  * cdef bint use_setstate
13258  * state = (self.U, self.mwl, self.ramp) # <<<<<<<<<<<<<<
13259  * _dict = getattr(self, '__dict__', None)
13260  * if _dict is not None:
13261  */
13262  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13263  __Pyx_GOTREF(__pyx_t_1);
13264  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->ramp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
13265  __Pyx_GOTREF(__pyx_t_2);
13266  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
13267  __Pyx_GOTREF(__pyx_t_3);
13268  __Pyx_INCREF(((PyObject *)__pyx_v_self->U));
13269  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->U));
13270  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->U));
13271  __Pyx_GIVEREF(__pyx_t_1);
13272  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13273  __Pyx_GIVEREF(__pyx_t_2);
13274  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13275  __pyx_t_1 = 0;
13276  __pyx_t_2 = 0;
13277  __pyx_v_state = ((PyObject*)__pyx_t_3);
13278  __pyx_t_3 = 0;
13279 
13280  /* "(tree fragment)":6
13281  * cdef bint use_setstate
13282  * state = (self.U, self.mwl, self.ramp)
13283  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
13284  * if _dict is not None:
13285  * state += (_dict,)
13286  */
13287  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
13288  __Pyx_GOTREF(__pyx_t_3);
13289  __pyx_v__dict = __pyx_t_3;
13290  __pyx_t_3 = 0;
13291 
13292  /* "(tree fragment)":7
13293  * state = (self.U, self.mwl, self.ramp)
13294  * _dict = getattr(self, '__dict__', None)
13295  * if _dict is not None: # <<<<<<<<<<<<<<
13296  * state += (_dict,)
13297  * use_setstate = True
13298  */
13299  __pyx_t_4 = (__pyx_v__dict != Py_None);
13300  __pyx_t_5 = (__pyx_t_4 != 0);
13301  if (__pyx_t_5) {
13302 
13303  /* "(tree fragment)":8
13304  * _dict = getattr(self, '__dict__', None)
13305  * if _dict is not None:
13306  * state += (_dict,) # <<<<<<<<<<<<<<
13307  * use_setstate = True
13308  * else:
13309  */
13310  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
13311  __Pyx_GOTREF(__pyx_t_3);
13312  __Pyx_INCREF(__pyx_v__dict);
13313  __Pyx_GIVEREF(__pyx_v__dict);
13314  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
13315  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
13316  __Pyx_GOTREF(__pyx_t_2);
13317  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13318  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
13319  __pyx_t_2 = 0;
13320 
13321  /* "(tree fragment)":9
13322  * if _dict is not None:
13323  * state += (_dict,)
13324  * use_setstate = True # <<<<<<<<<<<<<<
13325  * else:
13326  * use_setstate = self.U is not None
13327  */
13328  __pyx_v_use_setstate = 1;
13329 
13330  /* "(tree fragment)":7
13331  * state = (self.U, self.mwl, self.ramp)
13332  * _dict = getattr(self, '__dict__', None)
13333  * if _dict is not None: # <<<<<<<<<<<<<<
13334  * state += (_dict,)
13335  * use_setstate = True
13336  */
13337  goto __pyx_L3;
13338  }
13339 
13340  /* "(tree fragment)":11
13341  * use_setstate = True
13342  * else:
13343  * use_setstate = self.U is not None # <<<<<<<<<<<<<<
13344  * if use_setstate:
13345  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, None), state
13346  */
13347  /*else*/ {
13348  __pyx_t_5 = (((PyObject *)__pyx_v_self->U) != Py_None);
13349  __pyx_v_use_setstate = __pyx_t_5;
13350  }
13351  __pyx_L3:;
13352 
13353  /* "(tree fragment)":12
13354  * else:
13355  * use_setstate = self.U is not None
13356  * if use_setstate: # <<<<<<<<<<<<<<
13357  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, None), state
13358  * else:
13359  */
13360  __pyx_t_5 = (__pyx_v_use_setstate != 0);
13361  if (__pyx_t_5) {
13362 
13363  /* "(tree fragment)":13
13364  * use_setstate = self.U is not None
13365  * if use_setstate:
13366  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, None), state # <<<<<<<<<<<<<<
13367  * else:
13368  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state)
13369  */
13370  __Pyx_XDECREF(__pyx_r);
13371  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_SteadyCurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
13372  __Pyx_GOTREF(__pyx_t_2);
13373  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
13374  __Pyx_GOTREF(__pyx_t_3);
13375  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13376  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13377  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13378  __Pyx_INCREF(__pyx_int_237135047);
13379  __Pyx_GIVEREF(__pyx_int_237135047);
13380  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_237135047);
13381  __Pyx_INCREF(Py_None);
13382  __Pyx_GIVEREF(Py_None);
13383  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
13384  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
13385  __Pyx_GOTREF(__pyx_t_1);
13386  __Pyx_GIVEREF(__pyx_t_2);
13387  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
13388  __Pyx_GIVEREF(__pyx_t_3);
13389  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
13390  __Pyx_INCREF(__pyx_v_state);
13391  __Pyx_GIVEREF(__pyx_v_state);
13392  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
13393  __pyx_t_2 = 0;
13394  __pyx_t_3 = 0;
13395  __pyx_r = __pyx_t_1;
13396  __pyx_t_1 = 0;
13397  goto __pyx_L0;
13398 
13399  /* "(tree fragment)":12
13400  * else:
13401  * use_setstate = self.U is not None
13402  * if use_setstate: # <<<<<<<<<<<<<<
13403  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, None), state
13404  * else:
13405  */
13406  }
13407 
13408  /* "(tree fragment)":15
13409  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, None), state
13410  * else:
13411  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state) # <<<<<<<<<<<<<<
13412  * def __setstate_cython__(self, __pyx_state):
13413  * __pyx_unpickle_SteadyCurrent__set_state(self, __pyx_state)
13414  */
13415  /*else*/ {
13416  __Pyx_XDECREF(__pyx_r);
13417  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_SteadyCurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
13418  __Pyx_GOTREF(__pyx_t_1);
13419  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
13420  __Pyx_GOTREF(__pyx_t_3);
13421  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13422  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13423  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13424  __Pyx_INCREF(__pyx_int_237135047);
13425  __Pyx_GIVEREF(__pyx_int_237135047);
13426  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_237135047);
13427  __Pyx_INCREF(__pyx_v_state);
13428  __Pyx_GIVEREF(__pyx_v_state);
13429  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
13430  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
13431  __Pyx_GOTREF(__pyx_t_2);
13432  __Pyx_GIVEREF(__pyx_t_1);
13433  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13434  __Pyx_GIVEREF(__pyx_t_3);
13435  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
13436  __pyx_t_1 = 0;
13437  __pyx_t_3 = 0;
13438  __pyx_r = __pyx_t_2;
13439  __pyx_t_2 = 0;
13440  goto __pyx_L0;
13441  }
13442 
13443  /* "(tree fragment)":1
13444  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13445  * cdef tuple state
13446  * cdef object _dict
13447  */
13448 
13449  /* function exit code */
13450  __pyx_L1_error:;
13451  __Pyx_XDECREF(__pyx_t_1);
13452  __Pyx_XDECREF(__pyx_t_2);
13453  __Pyx_XDECREF(__pyx_t_3);
13454  __Pyx_AddTraceback("WaveTools.SteadyCurrent.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13455  __pyx_r = NULL;
13456  __pyx_L0:;
13457  __Pyx_XDECREF(__pyx_v_state);
13458  __Pyx_XDECREF(__pyx_v__dict);
13459  __Pyx_XGIVEREF(__pyx_r);
13460  __Pyx_RefNannyFinishContext();
13461  return __pyx_r;
13462 }
13463 
13464 /* "(tree fragment)":16
13465  * else:
13466  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state)
13467  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13468  * __pyx_unpickle_SteadyCurrent__set_state(self, __pyx_state)
13469  */
13470 
13471 /* Python wrapper */
13472 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13473 static PyMethodDef __pyx_mdef_9WaveTools_13SteadyCurrent_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_13SteadyCurrent_9__setstate_cython__, METH_O, 0};
13474 static PyObject *__pyx_pw_9WaveTools_13SteadyCurrent_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13475  PyObject *__pyx_r = 0;
13476  __Pyx_RefNannyDeclarations
13477  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13478  __pyx_r = __pyx_pf_9WaveTools_13SteadyCurrent_8__setstate_cython__(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13479 
13480  /* function exit code */
13481  __Pyx_RefNannyFinishContext();
13482  return __pyx_r;
13483 }
13484 
13485 static PyObject *__pyx_pf_9WaveTools_13SteadyCurrent_8__setstate_cython__(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13486  PyObject *__pyx_r = NULL;
13487  __Pyx_RefNannyDeclarations
13488  PyObject *__pyx_t_1 = NULL;
13489  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13490 
13491  /* "(tree fragment)":17
13492  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state)
13493  * def __setstate_cython__(self, __pyx_state):
13494  * __pyx_unpickle_SteadyCurrent__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
13495  */
13496  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13497  __pyx_t_1 = __pyx_f_9WaveTools___pyx_unpickle_SteadyCurrent__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13498  __Pyx_GOTREF(__pyx_t_1);
13499  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13500 
13501  /* "(tree fragment)":16
13502  * else:
13503  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state)
13504  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13505  * __pyx_unpickle_SteadyCurrent__set_state(self, __pyx_state)
13506  */
13507 
13508  /* function exit code */
13509  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13510  goto __pyx_L0;
13511  __pyx_L1_error:;
13512  __Pyx_XDECREF(__pyx_t_1);
13513  __Pyx_AddTraceback("WaveTools.SteadyCurrent.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13514  __pyx_r = NULL;
13515  __pyx_L0:;
13516  __Pyx_XGIVEREF(__pyx_r);
13517  __Pyx_RefNannyFinishContext();
13518  return __pyx_r;
13519 }
13520 
13521 /* "WaveTools.py":797
13522  *
13523  * """
13524  * def __init__(self, # <<<<<<<<<<<<<<
13525  * waveHeight,
13526  * mwl,
13527  */
13528 
13529 /* Python wrapper */
13530 static int __pyx_pw_9WaveTools_12SolitaryWave_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13531 static int __pyx_pw_9WaveTools_12SolitaryWave_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13532  PyObject *__pyx_v_waveHeight = 0;
13533  PyObject *__pyx_v_mwl = 0;
13534  PyObject *__pyx_v_depth = 0;
13535  PyObject *__pyx_v_g = 0;
13536  PyObject *__pyx_v_waveDir = 0;
13537  PyObject *__pyx_v_trans = 0;
13538  PyObject *__pyx_v_fast = 0;
13539  int __pyx_r;
13540  __Pyx_RefNannyDeclarations
13541  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
13542  {
13543  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_waveHeight,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_g,&__pyx_n_s_waveDir,&__pyx_n_s_trans,&__pyx_n_s_fast,0};
13544  PyObject* values[7] = {0,0,0,0,0,0,0};
13545  values[5] = __pyx_k__12;
13546 
13547  /* "WaveTools.py":804
13548  * waveDir,
13549  * trans = np.zeros(3,"d"),
13550  * fast = True): # <<<<<<<<<<<<<<
13551  *
13552  * self.H = waveHeight
13553  */
13554  values[6] = ((PyObject *)Py_True);
13555  if (unlikely(__pyx_kwds)) {
13556  Py_ssize_t kw_args;
13557  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13558  switch (pos_args) {
13559  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13560  CYTHON_FALLTHROUGH;
13561  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13562  CYTHON_FALLTHROUGH;
13563  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13564  CYTHON_FALLTHROUGH;
13565  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13566  CYTHON_FALLTHROUGH;
13567  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13568  CYTHON_FALLTHROUGH;
13569  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13570  CYTHON_FALLTHROUGH;
13571  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13572  CYTHON_FALLTHROUGH;
13573  case 0: break;
13574  default: goto __pyx_L5_argtuple_error;
13575  }
13576  kw_args = PyDict_Size(__pyx_kwds);
13577  switch (pos_args) {
13578  case 0:
13579  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveHeight)) != 0)) kw_args--;
13580  else goto __pyx_L5_argtuple_error;
13581  CYTHON_FALLTHROUGH;
13582  case 1:
13583  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
13584  else {
13585  __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 1); __PYX_ERR(0, 797, __pyx_L3_error)
13586  }
13587  CYTHON_FALLTHROUGH;
13588  case 2:
13589  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
13590  else {
13591  __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 2); __PYX_ERR(0, 797, __pyx_L3_error)
13592  }
13593  CYTHON_FALLTHROUGH;
13594  case 3:
13595  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
13596  else {
13597  __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 3); __PYX_ERR(0, 797, __pyx_L3_error)
13598  }
13599  CYTHON_FALLTHROUGH;
13600  case 4:
13601  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
13602  else {
13603  __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, 4); __PYX_ERR(0, 797, __pyx_L3_error)
13604  }
13605  CYTHON_FALLTHROUGH;
13606  case 5:
13607  if (kw_args > 0) {
13608  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_trans);
13609  if (value) { values[5] = value; kw_args--; }
13610  }
13611  CYTHON_FALLTHROUGH;
13612  case 6:
13613  if (kw_args > 0) {
13614  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
13615  if (value) { values[6] = value; kw_args--; }
13616  }
13617  }
13618  if (unlikely(kw_args > 0)) {
13619  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 797, __pyx_L3_error)
13620  }
13621  } else {
13622  switch (PyTuple_GET_SIZE(__pyx_args)) {
13623  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
13624  CYTHON_FALLTHROUGH;
13625  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
13626  CYTHON_FALLTHROUGH;
13627  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13628  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13629  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13630  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13631  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13632  break;
13633  default: goto __pyx_L5_argtuple_error;
13634  }
13635  }
13636  __pyx_v_waveHeight = values[0];
13637  __pyx_v_mwl = values[1];
13638  __pyx_v_depth = values[2];
13639  __pyx_v_g = values[3];
13640  __pyx_v_waveDir = values[4];
13641  __pyx_v_trans = values[5];
13642  __pyx_v_fast = values[6];
13643  }
13644  goto __pyx_L4_argument_unpacking_done;
13645  __pyx_L5_argtuple_error:;
13646  __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 797, __pyx_L3_error)
13647  __pyx_L3_error:;
13648  __Pyx_AddTraceback("WaveTools.SolitaryWave.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13649  __Pyx_RefNannyFinishContext();
13650  return -1;
13651  __pyx_L4_argument_unpacking_done:;
13652  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave___init__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self), __pyx_v_waveHeight, __pyx_v_mwl, __pyx_v_depth, __pyx_v_g, __pyx_v_waveDir, __pyx_v_trans, __pyx_v_fast);
13653 
13654  /* "WaveTools.py":797
13655  *
13656  * """
13657  * def __init__(self, # <<<<<<<<<<<<<<
13658  * waveHeight,
13659  * mwl,
13660  */
13661 
13662  /* function exit code */
13663  __Pyx_RefNannyFinishContext();
13664  return __pyx_r;
13665 }
13666 
13667 static int __pyx_pf_9WaveTools_12SolitaryWave___init__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_waveHeight, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_g, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_trans, PyObject *__pyx_v_fast) {
13668  int __pyx_r;
13669  __Pyx_RefNannyDeclarations
13670  double __pyx_t_1;
13671  bool __pyx_t_2;
13672  PyObject *__pyx_t_3 = NULL;
13673  PyObject *__pyx_t_4 = NULL;
13674  PyObject *__pyx_t_5 = NULL;
13675  PyObject *__pyx_t_6 = NULL;
13676  PyObject *__pyx_t_7 = NULL;
13677  double __pyx_t_8;
13678  PyObject *__pyx_t_9 = NULL;
13679  int __pyx_t_10;
13680  __Pyx_RefNannySetupContext("__init__", 0);
13681 
13682  /* "WaveTools.py":806
13683  * fast = True):
13684  *
13685  * self.H = waveHeight # <<<<<<<<<<<<<<
13686  * self.fast = fast
13687  * self.g = np.array(g)
13688  */
13689  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_waveHeight); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L1_error)
13690  __pyx_v_self->H = __pyx_t_1;
13691 
13692  /* "WaveTools.py":807
13693  *
13694  * self.H = waveHeight
13695  * self.fast = fast # <<<<<<<<<<<<<<
13696  * self.g = np.array(g)
13697  * self.waveDir = setDirVector(np.array(waveDir))
13698  */
13699  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 807, __pyx_L1_error)
13700  __pyx_v_self->fast = __pyx_t_2;
13701 
13702  /* "WaveTools.py":808
13703  * self.H = waveHeight
13704  * self.fast = fast
13705  * self.g = np.array(g) # <<<<<<<<<<<<<<
13706  * self.waveDir = setDirVector(np.array(waveDir))
13707  * self.vDir = setVertDir(g)
13708  */
13709  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
13710  __Pyx_GOTREF(__pyx_t_4);
13711  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 808, __pyx_L1_error)
13712  __Pyx_GOTREF(__pyx_t_5);
13713  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13714  __pyx_t_4 = NULL;
13715  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
13716  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
13717  if (likely(__pyx_t_4)) {
13718  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13719  __Pyx_INCREF(__pyx_t_4);
13720  __Pyx_INCREF(function);
13721  __Pyx_DECREF_SET(__pyx_t_5, function);
13722  }
13723  }
13724  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_g);
13725  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13726  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error)
13727  __Pyx_GOTREF(__pyx_t_3);
13728  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13729  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 808, __pyx_L1_error)
13730  __Pyx_GIVEREF(__pyx_t_3);
13731  __Pyx_GOTREF(__pyx_v_self->g);
13732  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
13733  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_3);
13734  __pyx_t_3 = 0;
13735 
13736  /* "WaveTools.py":809
13737  * self.fast = fast
13738  * self.g = np.array(g)
13739  * self.waveDir = setDirVector(np.array(waveDir)) # <<<<<<<<<<<<<<
13740  * self.vDir = setVertDir(g)
13741  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
13742  */
13743  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 809, __pyx_L1_error)
13744  __Pyx_GOTREF(__pyx_t_5);
13745  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 809, __pyx_L1_error)
13746  __Pyx_GOTREF(__pyx_t_6);
13747  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 809, __pyx_L1_error)
13748  __Pyx_GOTREF(__pyx_t_7);
13749  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13750  __pyx_t_6 = NULL;
13751  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
13752  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
13753  if (likely(__pyx_t_6)) {
13754  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
13755  __Pyx_INCREF(__pyx_t_6);
13756  __Pyx_INCREF(function);
13757  __Pyx_DECREF_SET(__pyx_t_7, function);
13758  }
13759  }
13760  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_waveDir) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_waveDir);
13761  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13762  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error)
13763  __Pyx_GOTREF(__pyx_t_4);
13764  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13765  __pyx_t_7 = NULL;
13766  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
13767  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
13768  if (likely(__pyx_t_7)) {
13769  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13770  __Pyx_INCREF(__pyx_t_7);
13771  __Pyx_INCREF(function);
13772  __Pyx_DECREF_SET(__pyx_t_5, function);
13773  }
13774  }
13775  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4);
13776  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13777  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13778  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error)
13779  __Pyx_GOTREF(__pyx_t_3);
13780  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13781  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 809, __pyx_L1_error)
13782  __Pyx_GIVEREF(__pyx_t_3);
13783  __Pyx_GOTREF(__pyx_v_self->waveDir);
13784  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
13785  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_3);
13786  __pyx_t_3 = 0;
13787 
13788  /* "WaveTools.py":810
13789  * self.g = np.array(g)
13790  * self.waveDir = setDirVector(np.array(waveDir))
13791  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
13792  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
13793  * self.trans = trans
13794  */
13795  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 810, __pyx_L1_error)
13796  __Pyx_GOTREF(__pyx_t_5);
13797  __pyx_t_4 = NULL;
13798  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
13799  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
13800  if (likely(__pyx_t_4)) {
13801  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13802  __Pyx_INCREF(__pyx_t_4);
13803  __Pyx_INCREF(function);
13804  __Pyx_DECREF_SET(__pyx_t_5, function);
13805  }
13806  }
13807  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_g);
13808  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
13809  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
13810  __Pyx_GOTREF(__pyx_t_3);
13811  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13812  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 810, __pyx_L1_error)
13813  __Pyx_GIVEREF(__pyx_t_3);
13814  __Pyx_GOTREF(__pyx_v_self->vDir);
13815  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
13816  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_3);
13817  __pyx_t_3 = 0;
13818 
13819  /* "WaveTools.py":811
13820  * self.waveDir = setDirVector(np.array(waveDir))
13821  * self.vDir = setVertDir(g)
13822  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2]) # <<<<<<<<<<<<<<
13823  * self.trans = trans
13824  * self.c = np.sqrt(self.gAbs * (depth+self.H))
13825  */
13826  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
13827  __Pyx_GOTREF(__pyx_t_3);
13828  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
13829  __Pyx_GOTREF(__pyx_t_5);
13830  __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
13831  __Pyx_GOTREF(__pyx_t_4);
13832  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13833  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13834  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
13835  __Pyx_GOTREF(__pyx_t_5);
13836  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
13837  __Pyx_GOTREF(__pyx_t_3);
13838  __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
13839  __Pyx_GOTREF(__pyx_t_7);
13840  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13841  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13842  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
13843  __Pyx_GOTREF(__pyx_t_3);
13844  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13845  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13846  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
13847  __Pyx_GOTREF(__pyx_t_7);
13848  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
13849  __Pyx_GOTREF(__pyx_t_4);
13850  __pyx_t_5 = PyNumber_Multiply(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
13851  __Pyx_GOTREF(__pyx_t_5);
13852  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13853  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13854  __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 811, __pyx_L1_error)
13855  __Pyx_GOTREF(__pyx_t_4);
13856  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13857  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13858  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L1_error)
13859  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13860  __pyx_v_self->gAbs = sqrt(__pyx_t_1);
13861 
13862  /* "WaveTools.py":812
13863  * self.vDir = setVertDir(g)
13864  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
13865  * self.trans = trans # <<<<<<<<<<<<<<
13866  * self.c = np.sqrt(self.gAbs * (depth+self.H))
13867  * self.mwl = mwl
13868  */
13869  if (!(likely(((__pyx_v_trans) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_trans, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 812, __pyx_L1_error)
13870  __pyx_t_4 = __pyx_v_trans;
13871  __Pyx_INCREF(__pyx_t_4);
13872  __Pyx_GIVEREF(__pyx_t_4);
13873  __Pyx_GOTREF(__pyx_v_self->trans);
13874  __Pyx_DECREF(((PyObject *)__pyx_v_self->trans));
13875  __pyx_v_self->trans = ((PyArrayObject *)__pyx_t_4);
13876  __pyx_t_4 = 0;
13877 
13878  /* "WaveTools.py":813
13879  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
13880  * self.trans = trans
13881  * self.c = np.sqrt(self.gAbs * (depth+self.H)) # <<<<<<<<<<<<<<
13882  * self.mwl = mwl
13883  * self.depth = depth
13884  */
13885  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 813, __pyx_L1_error)
13886  __Pyx_GOTREF(__pyx_t_5);
13887  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error)
13888  __Pyx_GOTREF(__pyx_t_3);
13889  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13890  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 813, __pyx_L1_error)
13891  __Pyx_GOTREF(__pyx_t_5);
13892  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->H); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
13893  __Pyx_GOTREF(__pyx_t_7);
13894  __pyx_t_6 = PyNumber_Add(__pyx_v_depth, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 813, __pyx_L1_error)
13895  __Pyx_GOTREF(__pyx_t_6);
13896  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13897  __pyx_t_7 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
13898  __Pyx_GOTREF(__pyx_t_7);
13899  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13900  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13901  __pyx_t_6 = NULL;
13902  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
13903  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
13904  if (likely(__pyx_t_6)) {
13905  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13906  __Pyx_INCREF(__pyx_t_6);
13907  __Pyx_INCREF(function);
13908  __Pyx_DECREF_SET(__pyx_t_3, function);
13909  }
13910  }
13911  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7);
13912  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13913  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13914  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error)
13915  __Pyx_GOTREF(__pyx_t_4);
13916  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13917  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 813, __pyx_L1_error)
13918  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13919  __pyx_v_self->c = __pyx_t_1;
13920 
13921  /* "WaveTools.py":814
13922  * self.trans = trans
13923  * self.c = np.sqrt(self.gAbs * (depth+self.H))
13924  * self.mwl = mwl # <<<<<<<<<<<<<<
13925  * self.depth = depth
13926  * self.K = old_div(np.sqrt(3. *self.H/ (4. * self.depth)),self.depth)
13927  */
13928  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 814, __pyx_L1_error)
13929  __pyx_v_self->mwl = __pyx_t_1;
13930 
13931  /* "WaveTools.py":815
13932  * self.c = np.sqrt(self.gAbs * (depth+self.H))
13933  * self.mwl = mwl
13934  * self.depth = depth # <<<<<<<<<<<<<<
13935  * self.K = old_div(np.sqrt(3. *self.H/ (4. * self.depth)),self.depth)
13936  * self.d2 = depth*depth
13937  */
13938  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 815, __pyx_L1_error)
13939  __pyx_v_self->depth = __pyx_t_1;
13940 
13941  /* "WaveTools.py":816
13942  * self.mwl = mwl
13943  * self.depth = depth
13944  * self.K = old_div(np.sqrt(3. *self.H/ (4. * self.depth)),self.depth) # <<<<<<<<<<<<<<
13945  * self.d2 = depth*depth
13946  * self.d3 = self.d2 * depth
13947  */
13948  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error)
13949  __Pyx_GOTREF(__pyx_t_3);
13950  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 816, __pyx_L1_error)
13951  __Pyx_GOTREF(__pyx_t_6);
13952  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error)
13953  __Pyx_GOTREF(__pyx_t_5);
13954  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13955  __pyx_t_1 = (3. * __pyx_v_self->H);
13956  __pyx_t_8 = (4. * __pyx_v_self->depth);
13957  if (unlikely(__pyx_t_8 == 0)) {
13958  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
13959  __PYX_ERR(0, 816, __pyx_L1_error)
13960  }
13961  __pyx_t_6 = PyFloat_FromDouble((__pyx_t_1 / __pyx_t_8)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 816, __pyx_L1_error)
13962  __Pyx_GOTREF(__pyx_t_6);
13963  __pyx_t_9 = NULL;
13964  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
13965  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
13966  if (likely(__pyx_t_9)) {
13967  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
13968  __Pyx_INCREF(__pyx_t_9);
13969  __Pyx_INCREF(function);
13970  __Pyx_DECREF_SET(__pyx_t_5, function);
13971  }
13972  }
13973  __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
13974  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
13975  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13976  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L1_error)
13977  __Pyx_GOTREF(__pyx_t_7);
13978  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13979  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 816, __pyx_L1_error)
13980  __Pyx_GOTREF(__pyx_t_5);
13981  __pyx_t_6 = NULL;
13982  __pyx_t_10 = 0;
13983  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
13984  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
13985  if (likely(__pyx_t_6)) {
13986  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
13987  __Pyx_INCREF(__pyx_t_6);
13988  __Pyx_INCREF(function);
13989  __Pyx_DECREF_SET(__pyx_t_3, function);
13990  __pyx_t_10 = 1;
13991  }
13992  }
13993  #if CYTHON_FAST_PYCALL
13994  if (PyFunction_Check(__pyx_t_3)) {
13995  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_5};
13996  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
13997  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13998  __Pyx_GOTREF(__pyx_t_4);
13999  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14000  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14001  } else
14002  #endif
14003  #if CYTHON_FAST_PYCCALL
14004  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
14005  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_5};
14006  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
14007  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14008  __Pyx_GOTREF(__pyx_t_4);
14009  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14010  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14011  } else
14012  #endif
14013  {
14014  __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 816, __pyx_L1_error)
14015  __Pyx_GOTREF(__pyx_t_9);
14016  if (__pyx_t_6) {
14017  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
14018  }
14019  __Pyx_GIVEREF(__pyx_t_7);
14020  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_7);
14021  __Pyx_GIVEREF(__pyx_t_5);
14022  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_t_5);
14023  __pyx_t_7 = 0;
14024  __pyx_t_5 = 0;
14025  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
14026  __Pyx_GOTREF(__pyx_t_4);
14027  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14028  }
14029  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14030  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error)
14031  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14032  __pyx_v_self->K = __pyx_t_8;
14033 
14034  /* "WaveTools.py":817
14035  * self.depth = depth
14036  * self.K = old_div(np.sqrt(3. *self.H/ (4. * self.depth)),self.depth)
14037  * self.d2 = depth*depth # <<<<<<<<<<<<<<
14038  * self.d3 = self.d2 * depth
14039  * #Checking if g and waveDir are perpendicular
14040  */
14041  __pyx_t_4 = PyNumber_Multiply(__pyx_v_depth, __pyx_v_depth); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 817, __pyx_L1_error)
14042  __Pyx_GOTREF(__pyx_t_4);
14043  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 817, __pyx_L1_error)
14044  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14045  __pyx_v_self->d2 = __pyx_t_8;
14046 
14047  /* "WaveTools.py":818
14048  * self.K = old_div(np.sqrt(3. *self.H/ (4. * self.depth)),self.depth)
14049  * self.d2 = depth*depth
14050  * self.d3 = self.d2 * depth # <<<<<<<<<<<<<<
14051  * #Checking if g and waveDir are perpendicular
14052  * dirCheck(self.waveDir,self.vDir)
14053  */
14054  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->d2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 818, __pyx_L1_error)
14055  __Pyx_GOTREF(__pyx_t_4);
14056  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
14057  __Pyx_GOTREF(__pyx_t_3);
14058  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14059  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L1_error)
14060  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14061  __pyx_v_self->d3 = __pyx_t_8;
14062 
14063  /* "WaveTools.py":820
14064  * self.d3 = self.d2 * depth
14065  * #Checking if g and waveDir are perpendicular
14066  * dirCheck(self.waveDir,self.vDir) # <<<<<<<<<<<<<<
14067  *
14068  * def eta(self,x,t):
14069  */
14070  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_dirCheck); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 820, __pyx_L1_error)
14071  __Pyx_GOTREF(__pyx_t_4);
14072  __pyx_t_9 = NULL;
14073  __pyx_t_10 = 0;
14074  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
14075  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
14076  if (likely(__pyx_t_9)) {
14077  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
14078  __Pyx_INCREF(__pyx_t_9);
14079  __Pyx_INCREF(function);
14080  __Pyx_DECREF_SET(__pyx_t_4, function);
14081  __pyx_t_10 = 1;
14082  }
14083  }
14084  #if CYTHON_FAST_PYCALL
14085  if (PyFunction_Check(__pyx_t_4)) {
14086  PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
14087  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error)
14088  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14089  __Pyx_GOTREF(__pyx_t_3);
14090  } else
14091  #endif
14092  #if CYTHON_FAST_PYCCALL
14093  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
14094  PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
14095  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error)
14096  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
14097  __Pyx_GOTREF(__pyx_t_3);
14098  } else
14099  #endif
14100  {
14101  __pyx_t_5 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 820, __pyx_L1_error)
14102  __Pyx_GOTREF(__pyx_t_5);
14103  if (__pyx_t_9) {
14104  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = NULL;
14105  }
14106  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
14107  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->waveDir));
14108  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, ((PyObject *)__pyx_v_self->waveDir));
14109  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
14110  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->vDir));
14111  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, ((PyObject *)__pyx_v_self->vDir));
14112  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error)
14113  __Pyx_GOTREF(__pyx_t_3);
14114  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14115  }
14116  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14117  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14118 
14119  /* "WaveTools.py":797
14120  *
14121  * """
14122  * def __init__(self, # <<<<<<<<<<<<<<
14123  * waveHeight,
14124  * mwl,
14125  */
14126 
14127  /* function exit code */
14128  __pyx_r = 0;
14129  goto __pyx_L0;
14130  __pyx_L1_error:;
14131  __Pyx_XDECREF(__pyx_t_3);
14132  __Pyx_XDECREF(__pyx_t_4);
14133  __Pyx_XDECREF(__pyx_t_5);
14134  __Pyx_XDECREF(__pyx_t_6);
14135  __Pyx_XDECREF(__pyx_t_7);
14136  __Pyx_XDECREF(__pyx_t_9);
14137  __Pyx_AddTraceback("WaveTools.SolitaryWave.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14138  __pyx_r = -1;
14139  __pyx_L0:;
14140  __Pyx_RefNannyFinishContext();
14141  return __pyx_r;
14142 }
14143 
14144 /* "WaveTools.py":822
14145  * dirCheck(self.waveDir,self.vDir)
14146  *
14147  * def eta(self,x,t): # <<<<<<<<<<<<<<
14148  * """Calculates free surface elevation (SolitaryWave class)
14149  * Parameters
14150  */
14151 
14152 /* Python wrapper */
14153 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14154 static char __pyx_doc_9WaveTools_12SolitaryWave_2eta[] = "Calculates free surface elevation (SolitaryWave class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
14155 static PyMethodDef __pyx_mdef_9WaveTools_12SolitaryWave_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12SolitaryWave_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_12SolitaryWave_2eta};
14156 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14157  PyObject *__pyx_v_x = 0;
14158  PyObject *__pyx_v_t = 0;
14159  PyObject *__pyx_r = 0;
14160  __Pyx_RefNannyDeclarations
14161  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
14162  {
14163  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
14164  PyObject* values[2] = {0,0};
14165  if (unlikely(__pyx_kwds)) {
14166  Py_ssize_t kw_args;
14167  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14168  switch (pos_args) {
14169  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14170  CYTHON_FALLTHROUGH;
14171  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14172  CYTHON_FALLTHROUGH;
14173  case 0: break;
14174  default: goto __pyx_L5_argtuple_error;
14175  }
14176  kw_args = PyDict_Size(__pyx_kwds);
14177  switch (pos_args) {
14178  case 0:
14179  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
14180  else goto __pyx_L5_argtuple_error;
14181  CYTHON_FALLTHROUGH;
14182  case 1:
14183  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
14184  else {
14185  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 822, __pyx_L3_error)
14186  }
14187  }
14188  if (unlikely(kw_args > 0)) {
14189  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 822, __pyx_L3_error)
14190  }
14191  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14192  goto __pyx_L5_argtuple_error;
14193  } else {
14194  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14195  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14196  }
14197  __pyx_v_x = values[0];
14198  __pyx_v_t = values[1];
14199  }
14200  goto __pyx_L4_argument_unpacking_done;
14201  __pyx_L5_argtuple_error:;
14202  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 822, __pyx_L3_error)
14203  __pyx_L3_error:;
14204  __Pyx_AddTraceback("WaveTools.SolitaryWave.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
14205  __Pyx_RefNannyFinishContext();
14206  return NULL;
14207  __pyx_L4_argument_unpacking_done:;
14208  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_2eta(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
14209 
14210  /* function exit code */
14211  __Pyx_RefNannyFinishContext();
14212  return __pyx_r;
14213 }
14214 
14215 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_2eta(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
14216  PyObject *__pyx_v_phase = NULL;
14217  PyObject *__pyx_v_a1 = NULL;
14218  PyObject *__pyx_r = NULL;
14219  __Pyx_RefNannyDeclarations
14220  PyObject *__pyx_t_1 = NULL;
14221  PyObject *__pyx_t_2 = NULL;
14222  PyObject *__pyx_t_3 = NULL;
14223  double __pyx_t_4;
14224  double __pyx_t_5;
14225  double __pyx_t_6;
14226  __Pyx_RefNannySetupContext("eta", 0);
14227 
14228  /* "WaveTools.py":837
14229  *
14230  * """
14231  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t # <<<<<<<<<<<<<<
14232  * a1 = self.K*phase
14233  * return self.H*1.0/ cosh(a1)**2
14234  */
14235  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
14236  __Pyx_GOTREF(__pyx_t_1);
14237  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->trans), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
14238  __Pyx_GOTREF(__pyx_t_2);
14239  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
14240  __Pyx_GOTREF(__pyx_t_3);
14241  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14242  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14243  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
14244  __Pyx_GOTREF(__pyx_t_2);
14245  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
14246  __Pyx_GOTREF(__pyx_t_1);
14247  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14248  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14249  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 837, __pyx_L1_error)
14250  __Pyx_GOTREF(__pyx_t_2);
14251  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14252  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
14253  __Pyx_GOTREF(__pyx_t_1);
14254  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error)
14255  __Pyx_GOTREF(__pyx_t_3);
14256  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14257  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
14258  __Pyx_GOTREF(__pyx_t_1);
14259  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14260  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14261  __pyx_v_phase = __pyx_t_1;
14262  __pyx_t_1 = 0;
14263 
14264  /* "WaveTools.py":838
14265  * """
14266  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
14267  * a1 = self.K*phase # <<<<<<<<<<<<<<
14268  * return self.H*1.0/ cosh(a1)**2
14269  * def u(self,x,t):
14270  */
14271  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->K); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
14272  __Pyx_GOTREF(__pyx_t_1);
14273  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_phase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error)
14274  __Pyx_GOTREF(__pyx_t_3);
14275  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14276  __pyx_v_a1 = __pyx_t_3;
14277  __pyx_t_3 = 0;
14278 
14279  /* "WaveTools.py":839
14280  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
14281  * a1 = self.K*phase
14282  * return self.H*1.0/ cosh(a1)**2 # <<<<<<<<<<<<<<
14283  * def u(self,x,t):
14284  * """Calculates wave velocity vector (SolitaryWave class).
14285  */
14286  __Pyx_XDECREF(__pyx_r);
14287  __pyx_t_4 = (__pyx_v_self->H * 1.0);
14288  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_a1); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 839, __pyx_L1_error)
14289  __pyx_t_6 = pow(cosh(__pyx_t_5), 2.0);
14290  if (unlikely(__pyx_t_6 == 0)) {
14291  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
14292  __PYX_ERR(0, 839, __pyx_L1_error)
14293  }
14294  __pyx_t_3 = PyFloat_FromDouble((__pyx_t_4 / __pyx_t_6)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error)
14295  __Pyx_GOTREF(__pyx_t_3);
14296  __pyx_r = __pyx_t_3;
14297  __pyx_t_3 = 0;
14298  goto __pyx_L0;
14299 
14300  /* "WaveTools.py":822
14301  * dirCheck(self.waveDir,self.vDir)
14302  *
14303  * def eta(self,x,t): # <<<<<<<<<<<<<<
14304  * """Calculates free surface elevation (SolitaryWave class)
14305  * Parameters
14306  */
14307 
14308  /* function exit code */
14309  __pyx_L1_error:;
14310  __Pyx_XDECREF(__pyx_t_1);
14311  __Pyx_XDECREF(__pyx_t_2);
14312  __Pyx_XDECREF(__pyx_t_3);
14313  __Pyx_AddTraceback("WaveTools.SolitaryWave.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
14314  __pyx_r = NULL;
14315  __pyx_L0:;
14316  __Pyx_XDECREF(__pyx_v_phase);
14317  __Pyx_XDECREF(__pyx_v_a1);
14318  __Pyx_XGIVEREF(__pyx_r);
14319  __Pyx_RefNannyFinishContext();
14320  return __pyx_r;
14321 }
14322 
14323 /* "WaveTools.py":840
14324  * a1 = self.K*phase
14325  * return self.H*1.0/ cosh(a1)**2
14326  * def u(self,x,t): # <<<<<<<<<<<<<<
14327  * """Calculates wave velocity vector (SolitaryWave class).
14328  * Parameters
14329  */
14330 
14331 /* Python wrapper */
14332 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14333 static char __pyx_doc_9WaveTools_12SolitaryWave_4u[] = "Calculates wave velocity vector (SolitaryWave class).\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
14334 static PyMethodDef __pyx_mdef_9WaveTools_12SolitaryWave_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12SolitaryWave_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_12SolitaryWave_4u};
14335 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14336  PyObject *__pyx_v_x = 0;
14337  PyObject *__pyx_v_t = 0;
14338  PyObject *__pyx_r = 0;
14339  __Pyx_RefNannyDeclarations
14340  __Pyx_RefNannySetupContext("u (wrapper)", 0);
14341  {
14342  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
14343  PyObject* values[2] = {0,0};
14344  if (unlikely(__pyx_kwds)) {
14345  Py_ssize_t kw_args;
14346  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14347  switch (pos_args) {
14348  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14349  CYTHON_FALLTHROUGH;
14350  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14351  CYTHON_FALLTHROUGH;
14352  case 0: break;
14353  default: goto __pyx_L5_argtuple_error;
14354  }
14355  kw_args = PyDict_Size(__pyx_kwds);
14356  switch (pos_args) {
14357  case 0:
14358  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
14359  else goto __pyx_L5_argtuple_error;
14360  CYTHON_FALLTHROUGH;
14361  case 1:
14362  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
14363  else {
14364  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 840, __pyx_L3_error)
14365  }
14366  }
14367  if (unlikely(kw_args > 0)) {
14368  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 840, __pyx_L3_error)
14369  }
14370  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14371  goto __pyx_L5_argtuple_error;
14372  } else {
14373  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14374  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14375  }
14376  __pyx_v_x = values[0];
14377  __pyx_v_t = values[1];
14378  }
14379  goto __pyx_L4_argument_unpacking_done;
14380  __pyx_L5_argtuple_error:;
14381  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 840, __pyx_L3_error)
14382  __pyx_L3_error:;
14383  __Pyx_AddTraceback("WaveTools.SolitaryWave.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
14384  __Pyx_RefNannyFinishContext();
14385  return NULL;
14386  __pyx_L4_argument_unpacking_done:;
14387  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_4u(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
14388 
14389  /* function exit code */
14390  __Pyx_RefNannyFinishContext();
14391  return __pyx_r;
14392 }
14393 
14394 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_4u(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
14395  PyObject *__pyx_v_phase = NULL;
14396  double __pyx_v_a1;
14397  double __pyx_v_a2;
14398  PyObject *__pyx_v_Z = NULL;
14399  PyObject *__pyx_v_Uhorz = NULL;
14400  PyObject *__pyx_v_Uvert = NULL;
14401  PyObject *__pyx_r = NULL;
14402  __Pyx_RefNannyDeclarations
14403  PyObject *__pyx_t_1 = NULL;
14404  PyObject *__pyx_t_2 = NULL;
14405  PyObject *__pyx_t_3 = NULL;
14406  double __pyx_t_4;
14407  PyObject *__pyx_t_5 = NULL;
14408  PyObject *__pyx_t_6 = NULL;
14409  PyObject *__pyx_t_7 = NULL;
14410  int __pyx_t_8;
14411  PyObject *__pyx_t_9 = NULL;
14412  double __pyx_t_10;
14413  __Pyx_RefNannySetupContext("u", 0);
14414 
14415  /* "WaveTools.py":855
14416  *
14417  * """
14418  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t # <<<<<<<<<<<<<<
14419  * a1 = cosh(self.K*phase*2.)
14420  * a2 = cosh(self.K*phase)
14421  */
14422  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_x, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
14423  __Pyx_GOTREF(__pyx_t_1);
14424  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->trans), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
14425  __Pyx_GOTREF(__pyx_t_2);
14426  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
14427  __Pyx_GOTREF(__pyx_t_3);
14428  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14429  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14430  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
14431  __Pyx_GOTREF(__pyx_t_2);
14432  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
14433  __Pyx_GOTREF(__pyx_t_1);
14434  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14435  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14436  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error)
14437  __Pyx_GOTREF(__pyx_t_2);
14438  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14439  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
14440  __Pyx_GOTREF(__pyx_t_1);
14441  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 855, __pyx_L1_error)
14442  __Pyx_GOTREF(__pyx_t_3);
14443  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14444  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
14445  __Pyx_GOTREF(__pyx_t_1);
14446  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14447  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14448  __pyx_v_phase = __pyx_t_1;
14449  __pyx_t_1 = 0;
14450 
14451  /* "WaveTools.py":856
14452  * """
14453  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
14454  * a1 = cosh(self.K*phase*2.) # <<<<<<<<<<<<<<
14455  * a2 = cosh(self.K*phase)
14456  *
14457  */
14458  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->K); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
14459  __Pyx_GOTREF(__pyx_t_1);
14460  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_phase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
14461  __Pyx_GOTREF(__pyx_t_3);
14462  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14463  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_float_2_); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
14464  __Pyx_GOTREF(__pyx_t_1);
14465  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14466  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L1_error)
14467  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14468  __pyx_v_a1 = cosh(__pyx_t_4);
14469 
14470  /* "WaveTools.py":857
14471  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
14472  * a1 = cosh(self.K*phase*2.)
14473  * a2 = cosh(self.K*phase) # <<<<<<<<<<<<<<
14474  *
14475  * Z = (self.vDir[0]*x[0] + self.vDir[1]*x[1]+ self.vDir[2]*x[2]) - self.mwl
14476  */
14477  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->K); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
14478  __Pyx_GOTREF(__pyx_t_1);
14479  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_phase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
14480  __Pyx_GOTREF(__pyx_t_3);
14481  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14482  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 857, __pyx_L1_error)
14483  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14484  __pyx_v_a2 = cosh(__pyx_t_4);
14485 
14486  /* "WaveTools.py":859
14487  * a2 = cosh(self.K*phase)
14488  *
14489  * Z = (self.vDir[0]*x[0] + self.vDir[1]*x[1]+ self.vDir[2]*x[2]) - self.mwl # <<<<<<<<<<<<<<
14490  *
14491  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *(
14492  */
14493  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->vDir), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
14494  __Pyx_GOTREF(__pyx_t_3);
14495  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
14496  __Pyx_GOTREF(__pyx_t_1);
14497  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
14498  __Pyx_GOTREF(__pyx_t_2);
14499  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14500  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14501  __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->vDir), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
14502  __Pyx_GOTREF(__pyx_t_1);
14503  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
14504  __Pyx_GOTREF(__pyx_t_3);
14505  __pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
14506  __Pyx_GOTREF(__pyx_t_5);
14507  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14508  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14509  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
14510  __Pyx_GOTREF(__pyx_t_3);
14511  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14512  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14513  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->vDir), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
14514  __Pyx_GOTREF(__pyx_t_5);
14515  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
14516  __Pyx_GOTREF(__pyx_t_2);
14517  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
14518  __Pyx_GOTREF(__pyx_t_1);
14519  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14520  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14521  __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
14522  __Pyx_GOTREF(__pyx_t_2);
14523  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14524  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14525  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error)
14526  __Pyx_GOTREF(__pyx_t_1);
14527  __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
14528  __Pyx_GOTREF(__pyx_t_3);
14529  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14530  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14531  __pyx_v_Z = __pyx_t_3;
14532  __pyx_t_3 = 0;
14533 
14534  /* "WaveTools.py":861
14535  * Z = (self.vDir[0]*x[0] + self.vDir[1]*x[1]+ self.vDir[2]*x[2]) - self.mwl
14536  *
14537  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *( # <<<<<<<<<<<<<<
14538  * 2.0 * self.d3 + self.d2 * self.H + 12.0 * self.depth * self.H * Z + 6.0 * self.H * Z**2.0 +
14539  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4
14540  */
14541  __pyx_t_4 = (4.0 * pow(__pyx_v_self->depth, 4.0));
14542  if (unlikely(__pyx_t_4 == 0)) {
14543  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
14544  __PYX_ERR(0, 861, __pyx_L1_error)
14545  }
14546  __pyx_t_3 = PyFloat_FromDouble((1.0 / __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
14547  __Pyx_GOTREF(__pyx_t_3);
14548  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
14549  __Pyx_GOTREF(__pyx_t_2);
14550  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error)
14551  __Pyx_GOTREF(__pyx_t_5);
14552  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14553  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_self->gAbs * __pyx_v_self->depth)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
14554  __Pyx_GOTREF(__pyx_t_2);
14555  __pyx_t_6 = NULL;
14556  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
14557  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
14558  if (likely(__pyx_t_6)) {
14559  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
14560  __Pyx_INCREF(__pyx_t_6);
14561  __Pyx_INCREF(function);
14562  __Pyx_DECREF_SET(__pyx_t_5, function);
14563  }
14564  }
14565  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2);
14566  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
14567  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14568  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
14569  __Pyx_GOTREF(__pyx_t_1);
14570  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14571  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error)
14572  __Pyx_GOTREF(__pyx_t_5);
14573  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14574  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14575  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->H); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 861, __pyx_L1_error)
14576  __Pyx_GOTREF(__pyx_t_1);
14577  __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
14578  __Pyx_GOTREF(__pyx_t_3);
14579  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14580  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14581 
14582  /* "WaveTools.py":862
14583  *
14584  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *(
14585  * 2.0 * self.d3 + self.d2 * self.H + 12.0 * self.depth * self.H * Z + 6.0 * self.H * Z**2.0 + # <<<<<<<<<<<<<<
14586  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4
14587  *
14588  */
14589  __pyx_t_1 = PyFloat_FromDouble(((2.0 * __pyx_v_self->d3) + (__pyx_v_self->d2 * __pyx_v_self->H))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
14590  __Pyx_GOTREF(__pyx_t_1);
14591  __pyx_t_5 = PyFloat_FromDouble(((12.0 * __pyx_v_self->depth) * __pyx_v_self->H)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
14592  __Pyx_GOTREF(__pyx_t_5);
14593  __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_v_Z); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error)
14594  __Pyx_GOTREF(__pyx_t_2);
14595  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14596  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 862, __pyx_L1_error)
14597  __Pyx_GOTREF(__pyx_t_5);
14598  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14599  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14600  __pyx_t_2 = PyFloat_FromDouble((6.0 * __pyx_v_self->H)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error)
14601  __Pyx_GOTREF(__pyx_t_2);
14602  __pyx_t_1 = PyNumber_Power(__pyx_v_Z, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
14603  __Pyx_GOTREF(__pyx_t_1);
14604  __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 862, __pyx_L1_error)
14605  __Pyx_GOTREF(__pyx_t_6);
14606  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14607  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14608  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 862, __pyx_L1_error)
14609  __Pyx_GOTREF(__pyx_t_1);
14610  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14611  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14612 
14613  /* "WaveTools.py":863
14614  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *(
14615  * 2.0 * self.d3 + self.d2 * self.H + 12.0 * self.depth * self.H * Z + 6.0 * self.H * Z**2.0 +
14616  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4 # <<<<<<<<<<<<<<
14617  *
14618  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*(
14619  */
14620  __pyx_t_6 = PyFloat_FromDouble(((2.0 * __pyx_v_self->d3) - (__pyx_v_self->d2 * __pyx_v_self->H))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error)
14621  __Pyx_GOTREF(__pyx_t_6);
14622  __pyx_t_5 = PyFloat_FromDouble(((6.0 * __pyx_v_self->depth) * __pyx_v_self->H)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
14623  __Pyx_GOTREF(__pyx_t_5);
14624  __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_v_Z); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
14625  __Pyx_GOTREF(__pyx_t_2);
14626  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14627  __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
14628  __Pyx_GOTREF(__pyx_t_5);
14629  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14630  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14631  __pyx_t_2 = PyFloat_FromDouble((3.0 * __pyx_v_self->H)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 863, __pyx_L1_error)
14632  __Pyx_GOTREF(__pyx_t_2);
14633  __pyx_t_6 = PyNumber_Power(__pyx_v_Z, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error)
14634  __Pyx_GOTREF(__pyx_t_6);
14635  __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L1_error)
14636  __Pyx_GOTREF(__pyx_t_7);
14637  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14638  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14639  __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 863, __pyx_L1_error)
14640  __Pyx_GOTREF(__pyx_t_6);
14641  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14642  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14643  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_a1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L1_error)
14644  __Pyx_GOTREF(__pyx_t_7);
14645  __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 863, __pyx_L1_error)
14646  __Pyx_GOTREF(__pyx_t_5);
14647  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14648  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14649 
14650  /* "WaveTools.py":862
14651  *
14652  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *(
14653  * 2.0 * self.d3 + self.d2 * self.H + 12.0 * self.depth * self.H * Z + 6.0 * self.H * Z**2.0 + # <<<<<<<<<<<<<<
14654  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4
14655  *
14656  */
14657  __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 862, __pyx_L1_error)
14658  __Pyx_GOTREF(__pyx_t_7);
14659  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14660  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14661 
14662  /* "WaveTools.py":861
14663  * Z = (self.vDir[0]*x[0] + self.vDir[1]*x[1]+ self.vDir[2]*x[2]) - self.mwl
14664  *
14665  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *( # <<<<<<<<<<<<<<
14666  * 2.0 * self.d3 + self.d2 * self.H + 12.0 * self.depth * self.H * Z + 6.0 * self.H * Z**2.0 +
14667  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4
14668  */
14669  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error)
14670  __Pyx_GOTREF(__pyx_t_5);
14671  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14672  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14673 
14674  /* "WaveTools.py":863
14675  * Uhorz = 1.0 /(4.0 * self.depth**4 ) * np.sqrt(self.gAbs * self.depth) * self.H *(
14676  * 2.0 * self.d3 + self.d2 * self.H + 12.0 * self.depth * self.H * Z + 6.0 * self.H * Z**2.0 +
14677  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4 # <<<<<<<<<<<<<<
14678  *
14679  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*(
14680  */
14681  __pyx_t_7 = PyFloat_FromDouble(pow(__pyx_v_a2, 4.0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 863, __pyx_L1_error)
14682  __Pyx_GOTREF(__pyx_t_7);
14683  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 863, __pyx_L1_error)
14684  __Pyx_GOTREF(__pyx_t_3);
14685  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14686  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14687  __pyx_v_Uhorz = __pyx_t_3;
14688  __pyx_t_3 = 0;
14689 
14690  /* "WaveTools.py":865
14691  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4
14692  *
14693  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*( # <<<<<<<<<<<<<<
14694  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 +
14695  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
14696  */
14697  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error)
14698  __Pyx_GOTREF(__pyx_t_7);
14699  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14700  __Pyx_GOTREF(__pyx_t_5);
14701  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14702  __pyx_t_7 = PyFloat_FromDouble((__pyx_v_self->gAbs * __pyx_v_self->depth)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error)
14703  __Pyx_GOTREF(__pyx_t_7);
14704  __pyx_t_1 = NULL;
14705  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
14706  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
14707  if (likely(__pyx_t_1)) {
14708  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
14709  __Pyx_INCREF(__pyx_t_1);
14710  __Pyx_INCREF(function);
14711  __Pyx_DECREF_SET(__pyx_t_5, function);
14712  }
14713  }
14714  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
14715  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
14716  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14717  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
14718  __Pyx_GOTREF(__pyx_t_3);
14719  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14720  __pyx_t_5 = PyNumber_Multiply(__pyx_float_4_0, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14721  __Pyx_GOTREF(__pyx_t_5);
14722  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14723  __pyx_t_3 = __Pyx_PyFloat_TrueDivideCObj(__pyx_float_1_0, __pyx_t_5, 1.0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
14724  __Pyx_GOTREF(__pyx_t_3);
14725  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14726  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error)
14727  __Pyx_GOTREF(__pyx_t_7);
14728  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
14729  __Pyx_GOTREF(__pyx_t_1);
14730  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14731  __pyx_t_7 = NULL;
14732  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
14733  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
14734  if (likely(__pyx_t_7)) {
14735  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
14736  __Pyx_INCREF(__pyx_t_7);
14737  __Pyx_INCREF(function);
14738  __Pyx_DECREF_SET(__pyx_t_1, function);
14739  }
14740  }
14741  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_float_3_0) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_float_3_0);
14742  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
14743  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14744  __Pyx_GOTREF(__pyx_t_5);
14745  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14746  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
14747  __Pyx_GOTREF(__pyx_t_1);
14748  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14749  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14750  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14751  __Pyx_GOTREF(__pyx_t_5);
14752  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
14753  __Pyx_GOTREF(__pyx_t_3);
14754  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14755  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14756  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
14757  __Pyx_GOTREF(__pyx_t_1);
14758  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->H); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error)
14759  __Pyx_GOTREF(__pyx_t_7);
14760  __pyx_t_6 = PyFloat_FromDouble(pow(__pyx_v_self->depth, 3.0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 865, __pyx_L1_error)
14761  __Pyx_GOTREF(__pyx_t_6);
14762  __pyx_t_2 = NULL;
14763  __pyx_t_8 = 0;
14764  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
14765  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
14766  if (likely(__pyx_t_2)) {
14767  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
14768  __Pyx_INCREF(__pyx_t_2);
14769  __Pyx_INCREF(function);
14770  __Pyx_DECREF_SET(__pyx_t_1, function);
14771  __pyx_t_8 = 1;
14772  }
14773  }
14774  #if CYTHON_FAST_PYCALL
14775  if (PyFunction_Check(__pyx_t_1)) {
14776  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_t_6};
14777  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14778  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14779  __Pyx_GOTREF(__pyx_t_5);
14780  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14781  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14782  } else
14783  #endif
14784  #if CYTHON_FAST_PYCCALL
14785  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
14786  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_7, __pyx_t_6};
14787  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14788  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14789  __Pyx_GOTREF(__pyx_t_5);
14790  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14791  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14792  } else
14793  #endif
14794  {
14795  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error)
14796  __Pyx_GOTREF(__pyx_t_9);
14797  if (__pyx_t_2) {
14798  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
14799  }
14800  __Pyx_GIVEREF(__pyx_t_7);
14801  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_7);
14802  __Pyx_GIVEREF(__pyx_t_6);
14803  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
14804  __pyx_t_7 = 0;
14805  __pyx_t_6 = 0;
14806  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14807  __Pyx_GOTREF(__pyx_t_5);
14808  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14809  }
14810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14811  __pyx_t_1 = PyNumber_Power(__pyx_t_5, __pyx_float_1_5, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
14812  __Pyx_GOTREF(__pyx_t_1);
14813  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14814  __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 865, __pyx_L1_error)
14815  __Pyx_GOTREF(__pyx_t_5);
14816  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14817  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14818  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
14819  __Pyx_GOTREF(__pyx_t_1);
14820  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_v_Z); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
14821  __Pyx_GOTREF(__pyx_t_3);
14822  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14823  __pyx_t_1 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
14824  __Pyx_GOTREF(__pyx_t_1);
14825  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14826  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14827 
14828  /* "WaveTools.py":866
14829  *
14830  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*(
14831  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 + # <<<<<<<<<<<<<<
14832  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
14833  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
14834  */
14835  __pyx_t_3 = PyFloat_FromDouble(((2.0 * pow(__pyx_v_self->depth, 3.0)) - ((7.0 * pow(__pyx_v_self->depth, 2.0)) * __pyx_v_self->H))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
14836  __Pyx_GOTREF(__pyx_t_3);
14837  __pyx_t_5 = PyFloat_FromDouble(((10.0 * __pyx_v_self->depth) * __pyx_v_self->H)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
14838  __Pyx_GOTREF(__pyx_t_5);
14839  __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_v_Z); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
14840  __Pyx_GOTREF(__pyx_t_9);
14841  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14842  __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
14843  __Pyx_GOTREF(__pyx_t_5);
14844  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14845  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14846  __pyx_t_9 = PyFloat_FromDouble((5.0 * __pyx_v_self->H)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
14847  __Pyx_GOTREF(__pyx_t_9);
14848  __pyx_t_3 = PyNumber_Power(__pyx_v_Z, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
14849  __Pyx_GOTREF(__pyx_t_3);
14850  __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 866, __pyx_L1_error)
14851  __Pyx_GOTREF(__pyx_t_6);
14852  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14853  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14854  __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error)
14855  __Pyx_GOTREF(__pyx_t_3);
14856  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14857  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14858 
14859  /* "WaveTools.py":867
14860  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*(
14861  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 +
14862  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)* # <<<<<<<<<<<<<<
14863  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
14864  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
14865  */
14866  __pyx_t_6 = PyFloat_FromDouble(((2.0 * pow(__pyx_v_self->depth, 3.0)) + (pow(__pyx_v_self->depth, 2.0) * __pyx_v_self->H))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L1_error)
14867  __Pyx_GOTREF(__pyx_t_6);
14868  __pyx_t_5 = PyFloat_FromDouble(((2.0 * __pyx_v_self->depth) * __pyx_v_self->H)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error)
14869  __Pyx_GOTREF(__pyx_t_5);
14870  __pyx_t_9 = PyNumber_Multiply(__pyx_t_5, __pyx_v_Z); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L1_error)
14871  __Pyx_GOTREF(__pyx_t_9);
14872  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14873  __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 867, __pyx_L1_error)
14874  __Pyx_GOTREF(__pyx_t_5);
14875  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14876  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14877  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->H); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 867, __pyx_L1_error)
14878  __Pyx_GOTREF(__pyx_t_9);
14879  __pyx_t_6 = PyNumber_Power(__pyx_v_Z, __pyx_float_2_0, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L1_error)
14880  __Pyx_GOTREF(__pyx_t_6);
14881  __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 867, __pyx_L1_error)
14882  __Pyx_GOTREF(__pyx_t_7);
14883  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14884  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14885  __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L1_error)
14886  __Pyx_GOTREF(__pyx_t_6);
14887  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14888  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14889 
14890  /* "WaveTools.py":868
14891  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 +
14892  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
14893  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/( # <<<<<<<<<<<<<<
14894  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
14895  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase ))
14896  */
14897  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error)
14898  __Pyx_GOTREF(__pyx_t_5);
14899  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 868, __pyx_L1_error)
14900  __Pyx_GOTREF(__pyx_t_9);
14901  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14902  __pyx_t_4 = (3.0 * __pyx_v_self->H);
14903  __pyx_t_10 = pow(__pyx_v_self->depth, 3.0);
14904  if (unlikely(__pyx_t_10 == 0)) {
14905  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
14906  __PYX_ERR(0, 868, __pyx_L1_error)
14907  }
14908  __pyx_t_5 = PyFloat_FromDouble((__pyx_t_4 / __pyx_t_10)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 868, __pyx_L1_error)
14909  __Pyx_GOTREF(__pyx_t_5);
14910  __pyx_t_2 = NULL;
14911  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
14912  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
14913  if (likely(__pyx_t_2)) {
14914  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
14915  __Pyx_INCREF(__pyx_t_2);
14916  __Pyx_INCREF(function);
14917  __Pyx_DECREF_SET(__pyx_t_9, function);
14918  }
14919  }
14920  __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5);
14921  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14922  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14923  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 868, __pyx_L1_error)
14924  __Pyx_GOTREF(__pyx_t_7);
14925  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14926  __pyx_t_9 = PyNumber_Multiply(__pyx_t_7, __pyx_v_phase); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 868, __pyx_L1_error)
14927  __Pyx_GOTREF(__pyx_t_9);
14928  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14929  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 868, __pyx_L1_error)
14930  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14931  __pyx_t_9 = PyFloat_FromDouble(cosh(__pyx_t_10)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 868, __pyx_L1_error)
14932  __Pyx_GOTREF(__pyx_t_9);
14933 
14934  /* "WaveTools.py":867
14935  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*(
14936  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 +
14937  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)* # <<<<<<<<<<<<<<
14938  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
14939  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
14940  */
14941  __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 867, __pyx_L1_error)
14942  __Pyx_GOTREF(__pyx_t_7);
14943  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
14944  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14945 
14946  /* "WaveTools.py":866
14947  *
14948  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*(
14949  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 + # <<<<<<<<<<<<<<
14950  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
14951  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
14952  */
14953  __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
14954  __Pyx_GOTREF(__pyx_t_9);
14955  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14956  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14957 
14958  /* "WaveTools.py":865
14959  * (2.0 * self.d3 - self.d2 * self.H - 6.0 * self.depth * self.H * Z - 3.0 * self.H * Z**2 ) * a1)/(a2)**4
14960  *
14961  * Uvert = 1.0 / ( 4.0 * np.sqrt(self.gAbs* self.depth) ) * np.sqrt(3.0) * self.gAbs * (old_div(self.H, self.depth**3.0))** 1.5 * (self.depth + Z)*( # <<<<<<<<<<<<<<
14962  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 +
14963  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
14964  */
14965  __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L1_error)
14966  __Pyx_GOTREF(__pyx_t_7);
14967  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14968  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14969 
14970  /* "WaveTools.py":869
14971  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
14972  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
14973  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))* # <<<<<<<<<<<<<<
14974  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase ))
14975  * """
14976  */
14977  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
14978  __Pyx_GOTREF(__pyx_t_1);
14979  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
14980  __Pyx_GOTREF(__pyx_t_3);
14981  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14982  __pyx_t_10 = (3.0 * __pyx_v_self->H);
14983  __pyx_t_4 = (4.0 * pow(__pyx_v_self->depth, 3.0));
14984  if (unlikely(__pyx_t_4 == 0)) {
14985  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
14986  __PYX_ERR(0, 869, __pyx_L1_error)
14987  }
14988  __pyx_t_1 = PyFloat_FromDouble((__pyx_t_10 / __pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
14989  __Pyx_GOTREF(__pyx_t_1);
14990  __pyx_t_6 = NULL;
14991  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
14992  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
14993  if (likely(__pyx_t_6)) {
14994  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
14995  __Pyx_INCREF(__pyx_t_6);
14996  __Pyx_INCREF(function);
14997  __Pyx_DECREF_SET(__pyx_t_3, function);
14998  }
14999  }
15000  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1);
15001  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15002  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15003  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
15004  __Pyx_GOTREF(__pyx_t_9);
15005  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15006 
15007  /* "WaveTools.py":870
15008  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
15009  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
15010  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase )) # <<<<<<<<<<<<<<
15011  * """
15012  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
15013  */
15014  __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_v_phase); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
15015  __Pyx_GOTREF(__pyx_t_3);
15016  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15017 
15018  /* "WaveTools.py":869
15019  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
15020  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
15021  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))* # <<<<<<<<<<<<<<
15022  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase ))
15023  * """
15024  */
15025  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 869, __pyx_L1_error)
15026  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15027 
15028  /* "WaveTools.py":870
15029  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
15030  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
15031  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase )) # <<<<<<<<<<<<<<
15032  * """
15033  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
15034  */
15035  __pyx_t_3 = PyFloat_FromDouble(pow(cosh(__pyx_t_4), 4.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
15036  __Pyx_GOTREF(__pyx_t_3);
15037 
15038  /* "WaveTools.py":868
15039  * 2.0 * self.depth**3 - 7.0 * self.depth**2.0 * self.H + 10.0 * self.depth * self.H * Z + 5.0 * self.H * Z**2.0 +
15040  * (2.0 * self.depth**3.0 + self.depth**2.0 * self.H - 2.0 * self.depth * self.H * Z - self.H * Z**2.0)*
15041  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/( # <<<<<<<<<<<<<<
15042  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
15043  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase ))
15044  */
15045  __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 868, __pyx_L1_error)
15046  __Pyx_GOTREF(__pyx_t_9);
15047  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15048  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15049 
15050  /* "WaveTools.py":870
15051  * cosh(np.sqrt( 3.0 * self.H / self.depth**3.0) * phase ))/(
15052  * cosh(np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*
15053  * phase ) )** 4.0*( tanh( np.sqrt( 3.0 * self.H / ( 4.0 * self.depth**3.0))*phase )) # <<<<<<<<<<<<<<
15054  * """
15055  * phase = sum( (x[:]-self.trans[:])*self.waveDir[:]) - self.c * t
15056  */
15057  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __pyx_L1_error)
15058  __Pyx_GOTREF(__pyx_t_7);
15059  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
15060  __Pyx_GOTREF(__pyx_t_1);
15061  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15062  __pyx_t_4 = (3.0 * __pyx_v_self->H);
15063  __pyx_t_10 = (4.0 * pow(__pyx_v_self->depth, 3.0));
15064  if (unlikely(__pyx_t_10 == 0)) {
15065  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
15066  __PYX_ERR(0, 870, __pyx_L1_error)
15067  }
15068  __pyx_t_7 = PyFloat_FromDouble((__pyx_t_4 / __pyx_t_10)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __pyx_L1_error)
15069  __Pyx_GOTREF(__pyx_t_7);
15070  __pyx_t_6 = NULL;
15071  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
15072  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
15073  if (likely(__pyx_t_6)) {
15074  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
15075  __Pyx_INCREF(__pyx_t_6);
15076  __Pyx_INCREF(function);
15077  __Pyx_DECREF_SET(__pyx_t_1, function);
15078  }
15079  }
15080  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7);
15081  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
15082  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
15083  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
15084  __Pyx_GOTREF(__pyx_t_3);
15085  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15086  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_phase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
15087  __Pyx_GOTREF(__pyx_t_1);
15088  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15089  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 870, __pyx_L1_error)
15090  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15091  __pyx_t_1 = PyFloat_FromDouble(tanh(__pyx_t_10)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
15092  __Pyx_GOTREF(__pyx_t_1);
15093  __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
15094  __Pyx_GOTREF(__pyx_t_3);
15095  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15096  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15097  __pyx_v_Uvert = __pyx_t_3;
15098  __pyx_t_3 = 0;
15099 
15100  /* "WaveTools.py":882
15101  * Uvert = -np.sqrt( self.gAbs * self.depth) * ( Z / self.depth) * ( 1 - ( self.H / ( 4 * self.depth)) * ( 1 / ( a1**2))) * ( ( 2 * self.H / self.depth) * self.K * ( a2 / ( a1**2)))
15102  * """
15103  * return self.waveDir*Uhorz + self.vDir*Uvert # <<<<<<<<<<<<<<
15104  *
15105  *
15106  */
15107  __Pyx_XDECREF(__pyx_r);
15108  __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_self->waveDir), __pyx_v_Uhorz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error)
15109  __Pyx_GOTREF(__pyx_t_3);
15110  __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_self->vDir), __pyx_v_Uvert); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
15111  __Pyx_GOTREF(__pyx_t_1);
15112  __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error)
15113  __Pyx_GOTREF(__pyx_t_9);
15114  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15115  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15116  __pyx_r = __pyx_t_9;
15117  __pyx_t_9 = 0;
15118  goto __pyx_L0;
15119 
15120  /* "WaveTools.py":840
15121  * a1 = self.K*phase
15122  * return self.H*1.0/ cosh(a1)**2
15123  * def u(self,x,t): # <<<<<<<<<<<<<<
15124  * """Calculates wave velocity vector (SolitaryWave class).
15125  * Parameters
15126  */
15127 
15128  /* function exit code */
15129  __pyx_L1_error:;
15130  __Pyx_XDECREF(__pyx_t_1);
15131  __Pyx_XDECREF(__pyx_t_2);
15132  __Pyx_XDECREF(__pyx_t_3);
15133  __Pyx_XDECREF(__pyx_t_5);
15134  __Pyx_XDECREF(__pyx_t_6);
15135  __Pyx_XDECREF(__pyx_t_7);
15136  __Pyx_XDECREF(__pyx_t_9);
15137  __Pyx_AddTraceback("WaveTools.SolitaryWave.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
15138  __pyx_r = NULL;
15139  __pyx_L0:;
15140  __Pyx_XDECREF(__pyx_v_phase);
15141  __Pyx_XDECREF(__pyx_v_Z);
15142  __Pyx_XDECREF(__pyx_v_Uhorz);
15143  __Pyx_XDECREF(__pyx_v_Uvert);
15144  __Pyx_XGIVEREF(__pyx_r);
15145  __Pyx_RefNannyFinishContext();
15146  return __pyx_r;
15147 }
15148 
15149 /* "WaveTools.pxd":45
15150  * cdef double H,gAbs,K,depth,d2,d3
15151  * cdef public:
15152  * double mwl,c # <<<<<<<<<<<<<<
15153  * cdef np.ndarray g,waveDir,vDir,trans
15154  * cdef bool fast
15155  */
15156 
15157 /* Python wrapper */
15158 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
15159 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_3mwl_1__get__(PyObject *__pyx_v_self) {
15160  PyObject *__pyx_r = 0;
15161  __Pyx_RefNannyDeclarations
15162  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15163  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_3mwl___get__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self));
15164 
15165  /* function exit code */
15166  __Pyx_RefNannyFinishContext();
15167  return __pyx_r;
15168 }
15169 
15170 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_3mwl___get__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self) {
15171  PyObject *__pyx_r = NULL;
15172  __Pyx_RefNannyDeclarations
15173  PyObject *__pyx_t_1 = NULL;
15174  __Pyx_RefNannySetupContext("__get__", 0);
15175  __Pyx_XDECREF(__pyx_r);
15176  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 45, __pyx_L1_error)
15177  __Pyx_GOTREF(__pyx_t_1);
15178  __pyx_r = __pyx_t_1;
15179  __pyx_t_1 = 0;
15180  goto __pyx_L0;
15181 
15182  /* function exit code */
15183  __pyx_L1_error:;
15184  __Pyx_XDECREF(__pyx_t_1);
15185  __Pyx_AddTraceback("WaveTools.SolitaryWave.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15186  __pyx_r = NULL;
15187  __pyx_L0:;
15188  __Pyx_XGIVEREF(__pyx_r);
15189  __Pyx_RefNannyFinishContext();
15190  return __pyx_r;
15191 }
15192 
15193 /* Python wrapper */
15194 static int __pyx_pw_9WaveTools_12SolitaryWave_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
15195 static int __pyx_pw_9WaveTools_12SolitaryWave_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15196  int __pyx_r;
15197  __Pyx_RefNannyDeclarations
15198  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15199  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_3mwl_2__set__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15200 
15201  /* function exit code */
15202  __Pyx_RefNannyFinishContext();
15203  return __pyx_r;
15204 }
15205 
15206 static int __pyx_pf_9WaveTools_12SolitaryWave_3mwl_2__set__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_value) {
15207  int __pyx_r;
15208  __Pyx_RefNannyDeclarations
15209  double __pyx_t_1;
15210  __Pyx_RefNannySetupContext("__set__", 0);
15211  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 45, __pyx_L1_error)
15212  __pyx_v_self->mwl = __pyx_t_1;
15213 
15214  /* function exit code */
15215  __pyx_r = 0;
15216  goto __pyx_L0;
15217  __pyx_L1_error:;
15218  __Pyx_AddTraceback("WaveTools.SolitaryWave.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15219  __pyx_r = -1;
15220  __pyx_L0:;
15221  __Pyx_RefNannyFinishContext();
15222  return __pyx_r;
15223 }
15224 
15225 /* Python wrapper */
15226 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_1c_1__get__(PyObject *__pyx_v_self); /*proto*/
15227 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_1c_1__get__(PyObject *__pyx_v_self) {
15228  PyObject *__pyx_r = 0;
15229  __Pyx_RefNannyDeclarations
15230  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
15231  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_1c___get__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self));
15232 
15233  /* function exit code */
15234  __Pyx_RefNannyFinishContext();
15235  return __pyx_r;
15236 }
15237 
15238 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_1c___get__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self) {
15239  PyObject *__pyx_r = NULL;
15240  __Pyx_RefNannyDeclarations
15241  PyObject *__pyx_t_1 = NULL;
15242  __Pyx_RefNannySetupContext("__get__", 0);
15243  __Pyx_XDECREF(__pyx_r);
15244  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->c); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 45, __pyx_L1_error)
15245  __Pyx_GOTREF(__pyx_t_1);
15246  __pyx_r = __pyx_t_1;
15247  __pyx_t_1 = 0;
15248  goto __pyx_L0;
15249 
15250  /* function exit code */
15251  __pyx_L1_error:;
15252  __Pyx_XDECREF(__pyx_t_1);
15253  __Pyx_AddTraceback("WaveTools.SolitaryWave.c.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15254  __pyx_r = NULL;
15255  __pyx_L0:;
15256  __Pyx_XGIVEREF(__pyx_r);
15257  __Pyx_RefNannyFinishContext();
15258  return __pyx_r;
15259 }
15260 
15261 /* Python wrapper */
15262 static int __pyx_pw_9WaveTools_12SolitaryWave_1c_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
15263 static int __pyx_pw_9WaveTools_12SolitaryWave_1c_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
15264  int __pyx_r;
15265  __Pyx_RefNannyDeclarations
15266  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
15267  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_1c_2__set__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
15268 
15269  /* function exit code */
15270  __Pyx_RefNannyFinishContext();
15271  return __pyx_r;
15272 }
15273 
15274 static int __pyx_pf_9WaveTools_12SolitaryWave_1c_2__set__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v_value) {
15275  int __pyx_r;
15276  __Pyx_RefNannyDeclarations
15277  double __pyx_t_1;
15278  __Pyx_RefNannySetupContext("__set__", 0);
15279  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 45, __pyx_L1_error)
15280  __pyx_v_self->c = __pyx_t_1;
15281 
15282  /* function exit code */
15283  __pyx_r = 0;
15284  goto __pyx_L0;
15285  __pyx_L1_error:;
15286  __Pyx_AddTraceback("WaveTools.SolitaryWave.c.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15287  __pyx_r = -1;
15288  __pyx_L0:;
15289  __Pyx_RefNannyFinishContext();
15290  return __pyx_r;
15291 }
15292 
15293 /* "(tree fragment)":1
15294  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15295  * cdef tuple state
15296  * cdef object _dict
15297  */
15298 
15299 /* Python wrapper */
15300 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
15301 static PyMethodDef __pyx_mdef_9WaveTools_12SolitaryWave_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_12SolitaryWave_7__reduce_cython__, METH_NOARGS, 0};
15302 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
15303  PyObject *__pyx_r = 0;
15304  __Pyx_RefNannyDeclarations
15305  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
15306  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_6__reduce_cython__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self));
15307 
15308  /* function exit code */
15309  __Pyx_RefNannyFinishContext();
15310  return __pyx_r;
15311 }
15312 
15313 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_6__reduce_cython__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self) {
15314  PyObject *__pyx_v_state = 0;
15315  PyObject *__pyx_v__dict = 0;
15316  int __pyx_v_use_setstate;
15317  PyObject *__pyx_r = NULL;
15318  __Pyx_RefNannyDeclarations
15319  PyObject *__pyx_t_1 = NULL;
15320  PyObject *__pyx_t_2 = NULL;
15321  PyObject *__pyx_t_3 = NULL;
15322  PyObject *__pyx_t_4 = NULL;
15323  PyObject *__pyx_t_5 = NULL;
15324  PyObject *__pyx_t_6 = NULL;
15325  PyObject *__pyx_t_7 = NULL;
15326  PyObject *__pyx_t_8 = NULL;
15327  PyObject *__pyx_t_9 = NULL;
15328  PyObject *__pyx_t_10 = NULL;
15329  int __pyx_t_11;
15330  int __pyx_t_12;
15331  int __pyx_t_13;
15332  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
15333 
15334  /* "(tree fragment)":5
15335  * cdef object _dict
15336  * cdef bint use_setstate
15337  * state = (self.H, self.K, self.c, self.d2, self.d3, self.depth, self.fast, self.g, self.gAbs, self.mwl, self.trans, self.vDir, self.waveDir) # <<<<<<<<<<<<<<
15338  * _dict = getattr(self, '__dict__', None)
15339  * if _dict is not None:
15340  */
15341  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->H); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
15342  __Pyx_GOTREF(__pyx_t_1);
15343  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->K); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
15344  __Pyx_GOTREF(__pyx_t_2);
15345  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->c); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
15346  __Pyx_GOTREF(__pyx_t_3);
15347  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->d2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
15348  __Pyx_GOTREF(__pyx_t_4);
15349  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->d3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
15350  __Pyx_GOTREF(__pyx_t_5);
15351  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
15352  __Pyx_GOTREF(__pyx_t_6);
15353  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->fast); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
15354  __Pyx_GOTREF(__pyx_t_7);
15355  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
15356  __Pyx_GOTREF(__pyx_t_8);
15357  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
15358  __Pyx_GOTREF(__pyx_t_9);
15359  __pyx_t_10 = PyTuple_New(13); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error)
15360  __Pyx_GOTREF(__pyx_t_10);
15361  __Pyx_GIVEREF(__pyx_t_1);
15362  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
15363  __Pyx_GIVEREF(__pyx_t_2);
15364  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2);
15365  __Pyx_GIVEREF(__pyx_t_3);
15366  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
15367  __Pyx_GIVEREF(__pyx_t_4);
15368  PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_4);
15369  __Pyx_GIVEREF(__pyx_t_5);
15370  PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_5);
15371  __Pyx_GIVEREF(__pyx_t_6);
15372  PyTuple_SET_ITEM(__pyx_t_10, 5, __pyx_t_6);
15373  __Pyx_GIVEREF(__pyx_t_7);
15374  PyTuple_SET_ITEM(__pyx_t_10, 6, __pyx_t_7);
15375  __Pyx_INCREF(((PyObject *)__pyx_v_self->g));
15376  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->g));
15377  PyTuple_SET_ITEM(__pyx_t_10, 7, ((PyObject *)__pyx_v_self->g));
15378  __Pyx_GIVEREF(__pyx_t_8);
15379  PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_t_8);
15380  __Pyx_GIVEREF(__pyx_t_9);
15381  PyTuple_SET_ITEM(__pyx_t_10, 9, __pyx_t_9);
15382  __Pyx_INCREF(((PyObject *)__pyx_v_self->trans));
15383  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->trans));
15384  PyTuple_SET_ITEM(__pyx_t_10, 10, ((PyObject *)__pyx_v_self->trans));
15385  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
15386  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->vDir));
15387  PyTuple_SET_ITEM(__pyx_t_10, 11, ((PyObject *)__pyx_v_self->vDir));
15388  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
15389  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->waveDir));
15390  PyTuple_SET_ITEM(__pyx_t_10, 12, ((PyObject *)__pyx_v_self->waveDir));
15391  __pyx_t_1 = 0;
15392  __pyx_t_2 = 0;
15393  __pyx_t_3 = 0;
15394  __pyx_t_4 = 0;
15395  __pyx_t_5 = 0;
15396  __pyx_t_6 = 0;
15397  __pyx_t_7 = 0;
15398  __pyx_t_8 = 0;
15399  __pyx_t_9 = 0;
15400  __pyx_v_state = ((PyObject*)__pyx_t_10);
15401  __pyx_t_10 = 0;
15402 
15403  /* "(tree fragment)":6
15404  * cdef bint use_setstate
15405  * state = (self.H, self.K, self.c, self.d2, self.d3, self.depth, self.fast, self.g, self.gAbs, self.mwl, self.trans, self.vDir, self.waveDir)
15406  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
15407  * if _dict is not None:
15408  * state += (_dict,)
15409  */
15410  __pyx_t_10 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 6, __pyx_L1_error)
15411  __Pyx_GOTREF(__pyx_t_10);
15412  __pyx_v__dict = __pyx_t_10;
15413  __pyx_t_10 = 0;
15414 
15415  /* "(tree fragment)":7
15416  * state = (self.H, self.K, self.c, self.d2, self.d3, self.depth, self.fast, self.g, self.gAbs, self.mwl, self.trans, self.vDir, self.waveDir)
15417  * _dict = getattr(self, '__dict__', None)
15418  * if _dict is not None: # <<<<<<<<<<<<<<
15419  * state += (_dict,)
15420  * use_setstate = True
15421  */
15422  __pyx_t_11 = (__pyx_v__dict != Py_None);
15423  __pyx_t_12 = (__pyx_t_11 != 0);
15424  if (__pyx_t_12) {
15425 
15426  /* "(tree fragment)":8
15427  * _dict = getattr(self, '__dict__', None)
15428  * if _dict is not None:
15429  * state += (_dict,) # <<<<<<<<<<<<<<
15430  * use_setstate = True
15431  * else:
15432  */
15433  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 8, __pyx_L1_error)
15434  __Pyx_GOTREF(__pyx_t_10);
15435  __Pyx_INCREF(__pyx_v__dict);
15436  __Pyx_GIVEREF(__pyx_v__dict);
15437  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v__dict);
15438  __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 8, __pyx_L1_error)
15439  __Pyx_GOTREF(__pyx_t_9);
15440  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
15441  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_9));
15442  __pyx_t_9 = 0;
15443 
15444  /* "(tree fragment)":9
15445  * if _dict is not None:
15446  * state += (_dict,)
15447  * use_setstate = True # <<<<<<<<<<<<<<
15448  * else:
15449  * use_setstate = self.g is not None or self.trans is not None or self.vDir is not None or self.waveDir is not None
15450  */
15451  __pyx_v_use_setstate = 1;
15452 
15453  /* "(tree fragment)":7
15454  * state = (self.H, self.K, self.c, self.d2, self.d3, self.depth, self.fast, self.g, self.gAbs, self.mwl, self.trans, self.vDir, self.waveDir)
15455  * _dict = getattr(self, '__dict__', None)
15456  * if _dict is not None: # <<<<<<<<<<<<<<
15457  * state += (_dict,)
15458  * use_setstate = True
15459  */
15460  goto __pyx_L3;
15461  }
15462 
15463  /* "(tree fragment)":11
15464  * use_setstate = True
15465  * else:
15466  * use_setstate = self.g is not None or self.trans is not None or self.vDir is not None or self.waveDir is not None # <<<<<<<<<<<<<<
15467  * if use_setstate:
15468  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, None), state
15469  */
15470  /*else*/ {
15471  __pyx_t_11 = (((PyObject *)__pyx_v_self->g) != Py_None);
15472  __pyx_t_13 = (__pyx_t_11 != 0);
15473  if (!__pyx_t_13) {
15474  } else {
15475  __pyx_t_12 = __pyx_t_13;
15476  goto __pyx_L4_bool_binop_done;
15477  }
15478  __pyx_t_13 = (((PyObject *)__pyx_v_self->trans) != Py_None);
15479  __pyx_t_11 = (__pyx_t_13 != 0);
15480  if (!__pyx_t_11) {
15481  } else {
15482  __pyx_t_12 = __pyx_t_11;
15483  goto __pyx_L4_bool_binop_done;
15484  }
15485  __pyx_t_11 = (((PyObject *)__pyx_v_self->vDir) != Py_None);
15486  __pyx_t_13 = (__pyx_t_11 != 0);
15487  if (!__pyx_t_13) {
15488  } else {
15489  __pyx_t_12 = __pyx_t_13;
15490  goto __pyx_L4_bool_binop_done;
15491  }
15492  __pyx_t_13 = (((PyObject *)__pyx_v_self->waveDir) != Py_None);
15493  __pyx_t_11 = (__pyx_t_13 != 0);
15494  __pyx_t_12 = __pyx_t_11;
15495  __pyx_L4_bool_binop_done:;
15496  __pyx_v_use_setstate = __pyx_t_12;
15497  }
15498  __pyx_L3:;
15499 
15500  /* "(tree fragment)":12
15501  * else:
15502  * use_setstate = self.g is not None or self.trans is not None or self.vDir is not None or self.waveDir is not None
15503  * if use_setstate: # <<<<<<<<<<<<<<
15504  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, None), state
15505  * else:
15506  */
15507  __pyx_t_12 = (__pyx_v_use_setstate != 0);
15508  if (__pyx_t_12) {
15509 
15510  /* "(tree fragment)":13
15511  * use_setstate = self.g is not None or self.trans is not None or self.vDir is not None or self.waveDir is not None
15512  * if use_setstate:
15513  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, None), state # <<<<<<<<<<<<<<
15514  * else:
15515  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state)
15516  */
15517  __Pyx_XDECREF(__pyx_r);
15518  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pyx_unpickle_SolitaryWave); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 13, __pyx_L1_error)
15519  __Pyx_GOTREF(__pyx_t_9);
15520  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error)
15521  __Pyx_GOTREF(__pyx_t_10);
15522  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15523  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15524  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15525  __Pyx_INCREF(__pyx_int_161707632);
15526  __Pyx_GIVEREF(__pyx_int_161707632);
15527  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_161707632);
15528  __Pyx_INCREF(Py_None);
15529  __Pyx_GIVEREF(Py_None);
15530  PyTuple_SET_ITEM(__pyx_t_10, 2, Py_None);
15531  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 13, __pyx_L1_error)
15532  __Pyx_GOTREF(__pyx_t_8);
15533  __Pyx_GIVEREF(__pyx_t_9);
15534  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
15535  __Pyx_GIVEREF(__pyx_t_10);
15536  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
15537  __Pyx_INCREF(__pyx_v_state);
15538  __Pyx_GIVEREF(__pyx_v_state);
15539  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_state);
15540  __pyx_t_9 = 0;
15541  __pyx_t_10 = 0;
15542  __pyx_r = __pyx_t_8;
15543  __pyx_t_8 = 0;
15544  goto __pyx_L0;
15545 
15546  /* "(tree fragment)":12
15547  * else:
15548  * use_setstate = self.g is not None or self.trans is not None or self.vDir is not None or self.waveDir is not None
15549  * if use_setstate: # <<<<<<<<<<<<<<
15550  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, None), state
15551  * else:
15552  */
15553  }
15554 
15555  /* "(tree fragment)":15
15556  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, None), state
15557  * else:
15558  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state) # <<<<<<<<<<<<<<
15559  * def __setstate_cython__(self, __pyx_state):
15560  * __pyx_unpickle_SolitaryWave__set_state(self, __pyx_state)
15561  */
15562  /*else*/ {
15563  __Pyx_XDECREF(__pyx_r);
15564  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pyx_unpickle_SolitaryWave); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 15, __pyx_L1_error)
15565  __Pyx_GOTREF(__pyx_t_8);
15566  __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error)
15567  __Pyx_GOTREF(__pyx_t_10);
15568  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15569  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15570  PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
15571  __Pyx_INCREF(__pyx_int_161707632);
15572  __Pyx_GIVEREF(__pyx_int_161707632);
15573  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_161707632);
15574  __Pyx_INCREF(__pyx_v_state);
15575  __Pyx_GIVEREF(__pyx_v_state);
15576  PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state);
15577  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 15, __pyx_L1_error)
15578  __Pyx_GOTREF(__pyx_t_9);
15579  __Pyx_GIVEREF(__pyx_t_8);
15580  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
15581  __Pyx_GIVEREF(__pyx_t_10);
15582  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
15583  __pyx_t_8 = 0;
15584  __pyx_t_10 = 0;
15585  __pyx_r = __pyx_t_9;
15586  __pyx_t_9 = 0;
15587  goto __pyx_L0;
15588  }
15589 
15590  /* "(tree fragment)":1
15591  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
15592  * cdef tuple state
15593  * cdef object _dict
15594  */
15595 
15596  /* function exit code */
15597  __pyx_L1_error:;
15598  __Pyx_XDECREF(__pyx_t_1);
15599  __Pyx_XDECREF(__pyx_t_2);
15600  __Pyx_XDECREF(__pyx_t_3);
15601  __Pyx_XDECREF(__pyx_t_4);
15602  __Pyx_XDECREF(__pyx_t_5);
15603  __Pyx_XDECREF(__pyx_t_6);
15604  __Pyx_XDECREF(__pyx_t_7);
15605  __Pyx_XDECREF(__pyx_t_8);
15606  __Pyx_XDECREF(__pyx_t_9);
15607  __Pyx_XDECREF(__pyx_t_10);
15608  __Pyx_AddTraceback("WaveTools.SolitaryWave.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15609  __pyx_r = NULL;
15610  __pyx_L0:;
15611  __Pyx_XDECREF(__pyx_v_state);
15612  __Pyx_XDECREF(__pyx_v__dict);
15613  __Pyx_XGIVEREF(__pyx_r);
15614  __Pyx_RefNannyFinishContext();
15615  return __pyx_r;
15616 }
15617 
15618 /* "(tree fragment)":16
15619  * else:
15620  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state)
15621  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15622  * __pyx_unpickle_SolitaryWave__set_state(self, __pyx_state)
15623  */
15624 
15625 /* Python wrapper */
15626 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
15627 static PyMethodDef __pyx_mdef_9WaveTools_12SolitaryWave_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_12SolitaryWave_9__setstate_cython__, METH_O, 0};
15628 static PyObject *__pyx_pw_9WaveTools_12SolitaryWave_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15629  PyObject *__pyx_r = 0;
15630  __Pyx_RefNannyDeclarations
15631  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
15632  __pyx_r = __pyx_pf_9WaveTools_12SolitaryWave_8__setstate_cython__(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
15633 
15634  /* function exit code */
15635  __Pyx_RefNannyFinishContext();
15636  return __pyx_r;
15637 }
15638 
15639 static PyObject *__pyx_pf_9WaveTools_12SolitaryWave_8__setstate_cython__(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
15640  PyObject *__pyx_r = NULL;
15641  __Pyx_RefNannyDeclarations
15642  PyObject *__pyx_t_1 = NULL;
15643  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
15644 
15645  /* "(tree fragment)":17
15646  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state)
15647  * def __setstate_cython__(self, __pyx_state):
15648  * __pyx_unpickle_SolitaryWave__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
15649  */
15650  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
15651  __pyx_t_1 = __pyx_f_9WaveTools___pyx_unpickle_SolitaryWave__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
15652  __Pyx_GOTREF(__pyx_t_1);
15653  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15654 
15655  /* "(tree fragment)":16
15656  * else:
15657  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state)
15658  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
15659  * __pyx_unpickle_SolitaryWave__set_state(self, __pyx_state)
15660  */
15661 
15662  /* function exit code */
15663  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15664  goto __pyx_L0;
15665  __pyx_L1_error:;
15666  __Pyx_XDECREF(__pyx_t_1);
15667  __Pyx_AddTraceback("WaveTools.SolitaryWave.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15668  __pyx_r = NULL;
15669  __pyx_L0:;
15670  __Pyx_XGIVEREF(__pyx_r);
15671  __Pyx_RefNannyFinishContext();
15672  return __pyx_r;
15673 }
15674 
15675 /* "WaveTools.py":940
15676  *
15677  * """
15678  * def __init__(self, # <<<<<<<<<<<<<<
15679  * period,
15680  * waveHeight,
15681  */
15682 
15683 /* Python wrapper */
15684 static int __pyx_pw_9WaveTools_18MonochromaticWaves_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
15685 static int __pyx_pw_9WaveTools_18MonochromaticWaves_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15686  PyObject *__pyx_v_period = 0;
15687  PyObject *__pyx_v_waveHeight = 0;
15688  PyObject *__pyx_v_mwl = 0;
15689  PyObject *__pyx_v_depth = 0;
15690  PyObject *__pyx_v_g = 0;
15691  PyObject *__pyx_v_waveDir = 0;
15692  PyObject *__pyx_v_wavelength = 0;
15693  PyObject *__pyx_v_waveType = 0;
15694  PyObject *__pyx_v_autoFenton = 0;
15695  PyObject *__pyx_v_autoFentonOpts = 0;
15696  PyObject *__pyx_v_Ycoeff = 0;
15697  PyObject *__pyx_v_Bcoeff = 0;
15698  PyObject *__pyx_v_Nf = 0;
15699  PyObject *__pyx_v_meanVelocity = 0;
15700  PyObject *__pyx_v_phi0 = 0;
15701  PyObject *__pyx_v_fast = 0;
15702  int __pyx_r;
15703  __Pyx_RefNannyDeclarations
15704  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
15705  {
15706  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_period,&__pyx_n_s_waveHeight,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_g,&__pyx_n_s_waveDir,&__pyx_n_s_wavelength,&__pyx_n_s_waveType,&__pyx_n_s_autoFenton,&__pyx_n_s_autoFentonOpts,&__pyx_n_s_Ycoeff,&__pyx_n_s_Bcoeff,&__pyx_n_s_Nf,&__pyx_n_s_meanVelocity,&__pyx_n_s_phi0,&__pyx_n_s_fast,0};
15707  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
15708 
15709  /* "WaveTools.py":947
15710  * g,
15711  * waveDir,
15712  * wavelength=None, # <<<<<<<<<<<<<<
15713  * waveType="Linear",
15714  * autoFenton=True,
15715  */
15716  values[6] = ((PyObject *)Py_None);
15717  values[7] = ((PyObject *)__pyx_n_s_Linear);
15718 
15719  /* "WaveTools.py":949
15720  * wavelength=None,
15721  * waveType="Linear",
15722  * autoFenton=True, # <<<<<<<<<<<<<<
15723  * autoFentonOpts=None,
15724  * Ycoeff = np.zeros(1000,),
15725  */
15726  values[8] = ((PyObject *)Py_True);
15727 
15728  /* "WaveTools.py":950
15729  * waveType="Linear",
15730  * autoFenton=True,
15731  * autoFentonOpts=None, # <<<<<<<<<<<<<<
15732  * Ycoeff = np.zeros(1000,),
15733  * Bcoeff =np.zeros(1000,),
15734  */
15735  values[9] = ((PyObject *)Py_None);
15736  values[10] = __pyx_k__13;
15737  values[11] = __pyx_k__14;
15738  values[12] = ((PyObject *)__pyx_int_1000);
15739  values[13] = __pyx_k__15;
15740  values[14] = ((PyObject *)__pyx_float_0_);
15741 
15742  /* "WaveTools.py":956
15743  * meanVelocity = np.array([0.,0,0.]),
15744  * phi0 = 0.,
15745  * fast = True): # <<<<<<<<<<<<<<
15746  *
15747  * self.fast = fast
15748  */
15749  values[15] = ((PyObject *)Py_True);
15750  if (unlikely(__pyx_kwds)) {
15751  Py_ssize_t kw_args;
15752  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15753  switch (pos_args) {
15754  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
15755  CYTHON_FALLTHROUGH;
15756  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
15757  CYTHON_FALLTHROUGH;
15758  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
15759  CYTHON_FALLTHROUGH;
15760  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
15761  CYTHON_FALLTHROUGH;
15762  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
15763  CYTHON_FALLTHROUGH;
15764  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
15765  CYTHON_FALLTHROUGH;
15766  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
15767  CYTHON_FALLTHROUGH;
15768  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
15769  CYTHON_FALLTHROUGH;
15770  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
15771  CYTHON_FALLTHROUGH;
15772  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
15773  CYTHON_FALLTHROUGH;
15774  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
15775  CYTHON_FALLTHROUGH;
15776  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15777  CYTHON_FALLTHROUGH;
15778  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15779  CYTHON_FALLTHROUGH;
15780  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15781  CYTHON_FALLTHROUGH;
15782  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15783  CYTHON_FALLTHROUGH;
15784  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15785  CYTHON_FALLTHROUGH;
15786  case 0: break;
15787  default: goto __pyx_L5_argtuple_error;
15788  }
15789  kw_args = PyDict_Size(__pyx_kwds);
15790  switch (pos_args) {
15791  case 0:
15792  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_period)) != 0)) kw_args--;
15793  else goto __pyx_L5_argtuple_error;
15794  CYTHON_FALLTHROUGH;
15795  case 1:
15796  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveHeight)) != 0)) kw_args--;
15797  else {
15798  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 16, 1); __PYX_ERR(0, 940, __pyx_L3_error)
15799  }
15800  CYTHON_FALLTHROUGH;
15801  case 2:
15802  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
15803  else {
15804  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 16, 2); __PYX_ERR(0, 940, __pyx_L3_error)
15805  }
15806  CYTHON_FALLTHROUGH;
15807  case 3:
15808  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
15809  else {
15810  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 16, 3); __PYX_ERR(0, 940, __pyx_L3_error)
15811  }
15812  CYTHON_FALLTHROUGH;
15813  case 4:
15814  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
15815  else {
15816  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 16, 4); __PYX_ERR(0, 940, __pyx_L3_error)
15817  }
15818  CYTHON_FALLTHROUGH;
15819  case 5:
15820  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
15821  else {
15822  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 16, 5); __PYX_ERR(0, 940, __pyx_L3_error)
15823  }
15824  CYTHON_FALLTHROUGH;
15825  case 6:
15826  if (kw_args > 0) {
15827  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wavelength);
15828  if (value) { values[6] = value; kw_args--; }
15829  }
15830  CYTHON_FALLTHROUGH;
15831  case 7:
15832  if (kw_args > 0) {
15833  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveType);
15834  if (value) { values[7] = value; kw_args--; }
15835  }
15836  CYTHON_FALLTHROUGH;
15837  case 8:
15838  if (kw_args > 0) {
15839  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_autoFenton);
15840  if (value) { values[8] = value; kw_args--; }
15841  }
15842  CYTHON_FALLTHROUGH;
15843  case 9:
15844  if (kw_args > 0) {
15845  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_autoFentonOpts);
15846  if (value) { values[9] = value; kw_args--; }
15847  }
15848  CYTHON_FALLTHROUGH;
15849  case 10:
15850  if (kw_args > 0) {
15851  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Ycoeff);
15852  if (value) { values[10] = value; kw_args--; }
15853  }
15854  CYTHON_FALLTHROUGH;
15855  case 11:
15856  if (kw_args > 0) {
15857  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Bcoeff);
15858  if (value) { values[11] = value; kw_args--; }
15859  }
15860  CYTHON_FALLTHROUGH;
15861  case 12:
15862  if (kw_args > 0) {
15863  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nf);
15864  if (value) { values[12] = value; kw_args--; }
15865  }
15866  CYTHON_FALLTHROUGH;
15867  case 13:
15868  if (kw_args > 0) {
15869  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meanVelocity);
15870  if (value) { values[13] = value; kw_args--; }
15871  }
15872  CYTHON_FALLTHROUGH;
15873  case 14:
15874  if (kw_args > 0) {
15875  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi0);
15876  if (value) { values[14] = value; kw_args--; }
15877  }
15878  CYTHON_FALLTHROUGH;
15879  case 15:
15880  if (kw_args > 0) {
15881  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
15882  if (value) { values[15] = value; kw_args--; }
15883  }
15884  }
15885  if (unlikely(kw_args > 0)) {
15886  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 940, __pyx_L3_error)
15887  }
15888  } else {
15889  switch (PyTuple_GET_SIZE(__pyx_args)) {
15890  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
15891  CYTHON_FALLTHROUGH;
15892  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
15893  CYTHON_FALLTHROUGH;
15894  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
15895  CYTHON_FALLTHROUGH;
15896  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
15897  CYTHON_FALLTHROUGH;
15898  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
15899  CYTHON_FALLTHROUGH;
15900  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
15901  CYTHON_FALLTHROUGH;
15902  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
15903  CYTHON_FALLTHROUGH;
15904  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
15905  CYTHON_FALLTHROUGH;
15906  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
15907  CYTHON_FALLTHROUGH;
15908  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
15909  CYTHON_FALLTHROUGH;
15910  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
15911  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15912  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15913  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15914  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15915  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15916  break;
15917  default: goto __pyx_L5_argtuple_error;
15918  }
15919  }
15920  __pyx_v_period = values[0];
15921  __pyx_v_waveHeight = values[1];
15922  __pyx_v_mwl = values[2];
15923  __pyx_v_depth = values[3];
15924  __pyx_v_g = values[4];
15925  __pyx_v_waveDir = values[5];
15926  __pyx_v_wavelength = values[6];
15927  __pyx_v_waveType = values[7];
15928  __pyx_v_autoFenton = values[8];
15929  __pyx_v_autoFentonOpts = values[9];
15930  __pyx_v_Ycoeff = values[10];
15931  __pyx_v_Bcoeff = values[11];
15932  __pyx_v_Nf = values[12];
15933  __pyx_v_meanVelocity = values[13];
15934  __pyx_v_phi0 = values[14];
15935  __pyx_v_fast = values[15];
15936  }
15937  goto __pyx_L4_argument_unpacking_done;
15938  __pyx_L5_argtuple_error:;
15939  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 940, __pyx_L3_error)
15940  __pyx_L3_error:;
15941  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
15942  __Pyx_RefNannyFinishContext();
15943  return -1;
15944  __pyx_L4_argument_unpacking_done:;
15945  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves___init__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self), __pyx_v_period, __pyx_v_waveHeight, __pyx_v_mwl, __pyx_v_depth, __pyx_v_g, __pyx_v_waveDir, __pyx_v_wavelength, __pyx_v_waveType, __pyx_v_autoFenton, __pyx_v_autoFentonOpts, __pyx_v_Ycoeff, __pyx_v_Bcoeff, __pyx_v_Nf, __pyx_v_meanVelocity, __pyx_v_phi0, __pyx_v_fast);
15946 
15947  /* "WaveTools.py":940
15948  *
15949  * """
15950  * def __init__(self, # <<<<<<<<<<<<<<
15951  * period,
15952  * waveHeight,
15953  */
15954 
15955  /* function exit code */
15956  __Pyx_RefNannyFinishContext();
15957  return __pyx_r;
15958 }
15959 
15960 static int __pyx_pf_9WaveTools_18MonochromaticWaves___init__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_period, PyObject *__pyx_v_waveHeight, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_g, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_wavelength, PyObject *__pyx_v_waveType, PyObject *__pyx_v_autoFenton, PyObject *__pyx_v_autoFentonOpts, PyObject *__pyx_v_Ycoeff, PyObject *__pyx_v_Bcoeff, PyObject *__pyx_v_Nf, PyObject *__pyx_v_meanVelocity, PyObject *__pyx_v_phi0, PyObject *__pyx_v_fast) {
15961  PyObject *__pyx_v_knownWaveTypes = NULL;
15962  PyObject *__pyx_v_ii = NULL;
15963  PyObject *__pyx_v_kk = NULL;
15964  PyObject *__pyx_v_Fenton = NULL;
15965  PyObject *__pyx_v_comm = NULL;
15966  PyObject *__pyx_v_ij = NULL;
15967  int __pyx_r;
15968  __Pyx_RefNannyDeclarations
15969  bool __pyx_t_1;
15970  PyObject *__pyx_t_2 = NULL;
15971  int __pyx_t_3;
15972  int __pyx_t_4;
15973  PyObject *__pyx_t_5 = NULL;
15974  PyObject *__pyx_t_6 = NULL;
15975  PyObject *__pyx_t_7 = NULL;
15976  PyObject *__pyx_t_8 = NULL;
15977  double __pyx_t_9;
15978  int __pyx_t_10;
15979  PyObject *__pyx_t_11 = NULL;
15980  PyObject *__pyx_t_12 = NULL;
15981  PyObject *__pyx_t_13 = NULL;
15982  PyObject *__pyx_t_14 = NULL;
15983  Py_ssize_t __pyx_t_15;
15984  PyObject *(*__pyx_t_16)(PyObject *);
15985  PyObject *(*__pyx_t_17)(PyObject *);
15986  Py_ssize_t __pyx_t_18;
15987  double *__pyx_t_19;
15988  double (*__pyx_t_20)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double);
15989  void (*__pyx_t_21)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double);
15990  double (*__pyx_t_22)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double);
15991  void (*__pyx_t_23)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double);
15992  __Pyx_RefNannySetupContext("__init__", 0);
15993  __Pyx_INCREF(__pyx_v_autoFentonOpts);
15994 
15995  /* "WaveTools.py":958
15996  * fast = True):
15997  *
15998  * self.fast = fast # <<<<<<<<<<<<<<
15999  * knownWaveTypes = ["Linear","Fenton"]
16000  * self.waveType = waveType
16001  */
16002  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 958, __pyx_L1_error)
16003  __pyx_v_self->fast = __pyx_t_1;
16004 
16005  /* "WaveTools.py":959
16006  *
16007  * self.fast = fast
16008  * knownWaveTypes = ["Linear","Fenton"] # <<<<<<<<<<<<<<
16009  * self.waveType = waveType
16010  * if waveType not in knownWaveTypes:
16011  */
16012  __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
16013  __Pyx_GOTREF(__pyx_t_2);
16014  __Pyx_INCREF(__pyx_n_s_Linear);
16015  __Pyx_GIVEREF(__pyx_n_s_Linear);
16016  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Linear);
16017  __Pyx_INCREF(__pyx_n_s_Fenton);
16018  __Pyx_GIVEREF(__pyx_n_s_Fenton);
16019  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Fenton);
16020  __pyx_v_knownWaveTypes = ((PyObject*)__pyx_t_2);
16021  __pyx_t_2 = 0;
16022 
16023  /* "WaveTools.py":960
16024  * self.fast = fast
16025  * knownWaveTypes = ["Linear","Fenton"]
16026  * self.waveType = waveType # <<<<<<<<<<<<<<
16027  * if waveType not in knownWaveTypes:
16028  * logEvent("ERROR!!: Wrong wavetype given: Valid wavetypes are %s" %(knownWaveTypes), level=0)
16029  */
16030  __Pyx_INCREF(__pyx_v_waveType);
16031  __Pyx_GIVEREF(__pyx_v_waveType);
16032  __Pyx_GOTREF(__pyx_v_self->waveType);
16033  __Pyx_DECREF(__pyx_v_self->waveType);
16034  __pyx_v_self->waveType = __pyx_v_waveType;
16035 
16036  /* "WaveTools.py":961
16037  * knownWaveTypes = ["Linear","Fenton"]
16038  * self.waveType = waveType
16039  * if waveType not in knownWaveTypes: # <<<<<<<<<<<<<<
16040  * logEvent("ERROR!!: Wrong wavetype given: Valid wavetypes are %s" %(knownWaveTypes), level=0)
16041  * sys.exit(1)
16042  */
16043  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_waveType, __pyx_v_knownWaveTypes, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 961, __pyx_L1_error)
16044  __pyx_t_4 = (__pyx_t_3 != 0);
16045  if (__pyx_t_4) {
16046 
16047  /* "WaveTools.py":962
16048  * self.waveType = waveType
16049  * if waveType not in knownWaveTypes:
16050  * logEvent("ERROR!!: Wrong wavetype given: Valid wavetypes are %s" %(knownWaveTypes), level=0) # <<<<<<<<<<<<<<
16051  * sys.exit(1)
16052  * self.g = np.array(g)
16053  */
16054  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error)
16055  __Pyx_GOTREF(__pyx_t_2);
16056  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_ERROR_Wrong_wavetype_given_Valid, __pyx_v_knownWaveTypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error)
16057  __Pyx_GOTREF(__pyx_t_5);
16058  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L1_error)
16059  __Pyx_GOTREF(__pyx_t_6);
16060  __Pyx_GIVEREF(__pyx_t_5);
16061  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
16062  __pyx_t_5 = 0;
16063  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 962, __pyx_L1_error)
16064  __Pyx_GOTREF(__pyx_t_5);
16065  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 962, __pyx_L1_error)
16066  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 962, __pyx_L1_error)
16067  __Pyx_GOTREF(__pyx_t_7);
16068  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16069  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16070  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16071  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16072 
16073  /* "WaveTools.py":963
16074  * if waveType not in knownWaveTypes:
16075  * logEvent("ERROR!!: Wrong wavetype given: Valid wavetypes are %s" %(knownWaveTypes), level=0)
16076  * sys.exit(1) # <<<<<<<<<<<<<<
16077  * self.g = np.array(g)
16078  * self.waveDir = setDirVector(np.array(waveDir))
16079  */
16080  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 963, __pyx_L1_error)
16081  __Pyx_GOTREF(__pyx_t_5);
16082  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L1_error)
16083  __Pyx_GOTREF(__pyx_t_6);
16084  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16085  __pyx_t_5 = NULL;
16086  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16087  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
16088  if (likely(__pyx_t_5)) {
16089  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
16090  __Pyx_INCREF(__pyx_t_5);
16091  __Pyx_INCREF(function);
16092  __Pyx_DECREF_SET(__pyx_t_6, function);
16093  }
16094  }
16095  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
16096  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16097  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 963, __pyx_L1_error)
16098  __Pyx_GOTREF(__pyx_t_7);
16099  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16100  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16101 
16102  /* "WaveTools.py":961
16103  * knownWaveTypes = ["Linear","Fenton"]
16104  * self.waveType = waveType
16105  * if waveType not in knownWaveTypes: # <<<<<<<<<<<<<<
16106  * logEvent("ERROR!!: Wrong wavetype given: Valid wavetypes are %s" %(knownWaveTypes), level=0)
16107  * sys.exit(1)
16108  */
16109  }
16110 
16111  /* "WaveTools.py":964
16112  * logEvent("ERROR!!: Wrong wavetype given: Valid wavetypes are %s" %(knownWaveTypes), level=0)
16113  * sys.exit(1)
16114  * self.g = np.array(g) # <<<<<<<<<<<<<<
16115  * self.waveDir = setDirVector(np.array(waveDir))
16116  * self.vDir = setVertDir(g)
16117  */
16118  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error)
16119  __Pyx_GOTREF(__pyx_t_6);
16120  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 964, __pyx_L1_error)
16121  __Pyx_GOTREF(__pyx_t_5);
16122  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16123  __pyx_t_6 = NULL;
16124  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16125  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
16126  if (likely(__pyx_t_6)) {
16127  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16128  __Pyx_INCREF(__pyx_t_6);
16129  __Pyx_INCREF(function);
16130  __Pyx_DECREF_SET(__pyx_t_5, function);
16131  }
16132  }
16133  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_g);
16134  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16135  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 964, __pyx_L1_error)
16136  __Pyx_GOTREF(__pyx_t_7);
16137  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16138  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 964, __pyx_L1_error)
16139  __Pyx_GIVEREF(__pyx_t_7);
16140  __Pyx_GOTREF(__pyx_v_self->g);
16141  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
16142  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_7);
16143  __pyx_t_7 = 0;
16144 
16145  /* "WaveTools.py":965
16146  * sys.exit(1)
16147  * self.g = np.array(g)
16148  * self.waveDir = setDirVector(np.array(waveDir)) # <<<<<<<<<<<<<<
16149  * self.vDir = setVertDir(g)
16150  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
16151  */
16152  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error)
16153  __Pyx_GOTREF(__pyx_t_5);
16154  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
16155  __Pyx_GOTREF(__pyx_t_2);
16156  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 965, __pyx_L1_error)
16157  __Pyx_GOTREF(__pyx_t_8);
16158  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16159  __pyx_t_2 = NULL;
16160  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
16161  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
16162  if (likely(__pyx_t_2)) {
16163  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
16164  __Pyx_INCREF(__pyx_t_2);
16165  __Pyx_INCREF(function);
16166  __Pyx_DECREF_SET(__pyx_t_8, function);
16167  }
16168  }
16169  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_2, __pyx_v_waveDir) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_waveDir);
16170  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16171  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 965, __pyx_L1_error)
16172  __Pyx_GOTREF(__pyx_t_6);
16173  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16174  __pyx_t_8 = NULL;
16175  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16176  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
16177  if (likely(__pyx_t_8)) {
16178  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16179  __Pyx_INCREF(__pyx_t_8);
16180  __Pyx_INCREF(function);
16181  __Pyx_DECREF_SET(__pyx_t_5, function);
16182  }
16183  }
16184  __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
16185  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16186  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16187  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L1_error)
16188  __Pyx_GOTREF(__pyx_t_7);
16189  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16190  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 965, __pyx_L1_error)
16191  __Pyx_GIVEREF(__pyx_t_7);
16192  __Pyx_GOTREF(__pyx_v_self->waveDir);
16193  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
16194  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_7);
16195  __pyx_t_7 = 0;
16196 
16197  /* "WaveTools.py":966
16198  * self.g = np.array(g)
16199  * self.waveDir = setDirVector(np.array(waveDir))
16200  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
16201  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
16202  *
16203  */
16204  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 966, __pyx_L1_error)
16205  __Pyx_GOTREF(__pyx_t_5);
16206  __pyx_t_6 = NULL;
16207  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16208  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
16209  if (likely(__pyx_t_6)) {
16210  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16211  __Pyx_INCREF(__pyx_t_6);
16212  __Pyx_INCREF(function);
16213  __Pyx_DECREF_SET(__pyx_t_5, function);
16214  }
16215  }
16216  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_g);
16217  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16218  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 966, __pyx_L1_error)
16219  __Pyx_GOTREF(__pyx_t_7);
16220  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16221  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 966, __pyx_L1_error)
16222  __Pyx_GIVEREF(__pyx_t_7);
16223  __Pyx_GOTREF(__pyx_v_self->vDir);
16224  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
16225  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_7);
16226  __pyx_t_7 = 0;
16227 
16228  /* "WaveTools.py":967
16229  * self.waveDir = setDirVector(np.array(waveDir))
16230  * self.vDir = setVertDir(g)
16231  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2]) # <<<<<<<<<<<<<<
16232  *
16233  * #Checking if g and waveDir are perpendicular
16234  */
16235  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error)
16236  __Pyx_GOTREF(__pyx_t_7);
16237  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error)
16238  __Pyx_GOTREF(__pyx_t_5);
16239  __pyx_t_6 = PyNumber_Multiply(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
16240  __Pyx_GOTREF(__pyx_t_6);
16241  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16242  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16243  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error)
16244  __Pyx_GOTREF(__pyx_t_5);
16245  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error)
16246  __Pyx_GOTREF(__pyx_t_7);
16247  __pyx_t_8 = PyNumber_Multiply(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error)
16248  __Pyx_GOTREF(__pyx_t_8);
16249  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16250  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16251  __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error)
16252  __Pyx_GOTREF(__pyx_t_7);
16253  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16254  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16255  __pyx_t_8 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error)
16256  __Pyx_GOTREF(__pyx_t_8);
16257  __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
16258  __Pyx_GOTREF(__pyx_t_6);
16259  __pyx_t_5 = PyNumber_Multiply(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 967, __pyx_L1_error)
16260  __Pyx_GOTREF(__pyx_t_5);
16261  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16262  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16263  __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
16264  __Pyx_GOTREF(__pyx_t_6);
16265  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16266  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16267  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 967, __pyx_L1_error)
16268  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16269  __pyx_v_self->gAbs = sqrt(__pyx_t_9);
16270 
16271  /* "WaveTools.py":970
16272  *
16273  * #Checking if g and waveDir are perpendicular
16274  * dirCheck(self.waveDir,self.vDir) # <<<<<<<<<<<<<<
16275  * self.phi0=phi0
16276  * self.mwl = mwl
16277  */
16278  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_dirCheck); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 970, __pyx_L1_error)
16279  __Pyx_GOTREF(__pyx_t_5);
16280  __pyx_t_7 = NULL;
16281  __pyx_t_10 = 0;
16282  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16283  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
16284  if (likely(__pyx_t_7)) {
16285  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16286  __Pyx_INCREF(__pyx_t_7);
16287  __Pyx_INCREF(function);
16288  __Pyx_DECREF_SET(__pyx_t_5, function);
16289  __pyx_t_10 = 1;
16290  }
16291  }
16292  #if CYTHON_FAST_PYCALL
16293  if (PyFunction_Check(__pyx_t_5)) {
16294  PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
16295  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L1_error)
16296  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16297  __Pyx_GOTREF(__pyx_t_6);
16298  } else
16299  #endif
16300  #if CYTHON_FAST_PYCCALL
16301  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
16302  PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
16303  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L1_error)
16304  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16305  __Pyx_GOTREF(__pyx_t_6);
16306  } else
16307  #endif
16308  {
16309  __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 970, __pyx_L1_error)
16310  __Pyx_GOTREF(__pyx_t_8);
16311  if (__pyx_t_7) {
16312  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
16313  }
16314  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
16315  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->waveDir));
16316  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_10, ((PyObject *)__pyx_v_self->waveDir));
16317  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
16318  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->vDir));
16319  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, ((PyObject *)__pyx_v_self->vDir));
16320  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 970, __pyx_L1_error)
16321  __Pyx_GOTREF(__pyx_t_6);
16322  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16323  }
16324  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16325  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16326 
16327  /* "WaveTools.py":971
16328  * #Checking if g and waveDir are perpendicular
16329  * dirCheck(self.waveDir,self.vDir)
16330  * self.phi0=phi0 # <<<<<<<<<<<<<<
16331  * self.mwl = mwl
16332  * self.depth = depth
16333  */
16334  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_phi0); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 971, __pyx_L1_error)
16335  __pyx_v_self->phi0 = __pyx_t_9;
16336 
16337  /* "WaveTools.py":972
16338  * dirCheck(self.waveDir,self.vDir)
16339  * self.phi0=phi0
16340  * self.mwl = mwl # <<<<<<<<<<<<<<
16341  * self.depth = depth
16342  * self.omega = 2.0*M_PI/period
16343  */
16344  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 972, __pyx_L1_error)
16345  __pyx_v_self->mwl = __pyx_t_9;
16346 
16347  /* "WaveTools.py":973
16348  * self.phi0=phi0
16349  * self.mwl = mwl
16350  * self.depth = depth # <<<<<<<<<<<<<<
16351  * self.omega = 2.0*M_PI/period
16352  *
16353  */
16354  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error)
16355  __pyx_v_self->depth = __pyx_t_9;
16356 
16357  /* "WaveTools.py":974
16358  * self.mwl = mwl
16359  * self.depth = depth
16360  * self.omega = 2.0*M_PI/period # <<<<<<<<<<<<<<
16361  *
16362  * self.Nf = Nf
16363  */
16364  __pyx_t_6 = PyFloat_FromDouble((2.0 * M_PI)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 974, __pyx_L1_error)
16365  __Pyx_GOTREF(__pyx_t_6);
16366  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_v_period); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 974, __pyx_L1_error)
16367  __Pyx_GOTREF(__pyx_t_5);
16368  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16369  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 974, __pyx_L1_error)
16370  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16371  __pyx_v_self->omega = __pyx_t_9;
16372 
16373  /* "WaveTools.py":976
16374  * self.omega = 2.0*M_PI/period
16375  *
16376  * self.Nf = Nf # <<<<<<<<<<<<<<
16377  * self.Ycoeff = Ycoeff
16378  * self.Bcoeff = Bcoeff
16379  */
16380  __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_v_Nf); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 976, __pyx_L1_error)
16381  __pyx_v_self->Nf = __pyx_t_10;
16382 
16383  /* "WaveTools.py":977
16384  *
16385  * self.Nf = Nf
16386  * self.Ycoeff = Ycoeff # <<<<<<<<<<<<<<
16387  * self.Bcoeff = Bcoeff
16388  * self.tanhF = np.zeros(Nf,"d")
16389  */
16390  if (!(likely(((__pyx_v_Ycoeff) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_Ycoeff, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 977, __pyx_L1_error)
16391  __pyx_t_5 = __pyx_v_Ycoeff;
16392  __Pyx_INCREF(__pyx_t_5);
16393  __Pyx_GIVEREF(__pyx_t_5);
16394  __Pyx_GOTREF(__pyx_v_self->Ycoeff);
16395  __Pyx_DECREF(((PyObject *)__pyx_v_self->Ycoeff));
16396  __pyx_v_self->Ycoeff = ((PyArrayObject *)__pyx_t_5);
16397  __pyx_t_5 = 0;
16398 
16399  /* "WaveTools.py":978
16400  * self.Nf = Nf
16401  * self.Ycoeff = Ycoeff
16402  * self.Bcoeff = Bcoeff # <<<<<<<<<<<<<<
16403  * self.tanhF = np.zeros(Nf,"d")
16404  * #Calculating / checking wavelength data
16405  */
16406  if (!(likely(((__pyx_v_Bcoeff) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_Bcoeff, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 978, __pyx_L1_error)
16407  __pyx_t_5 = __pyx_v_Bcoeff;
16408  __Pyx_INCREF(__pyx_t_5);
16409  __Pyx_GIVEREF(__pyx_t_5);
16410  __Pyx_GOTREF(__pyx_v_self->Bcoeff);
16411  __Pyx_DECREF(((PyObject *)__pyx_v_self->Bcoeff));
16412  __pyx_v_self->Bcoeff = ((PyArrayObject *)__pyx_t_5);
16413  __pyx_t_5 = 0;
16414 
16415  /* "WaveTools.py":979
16416  * self.Ycoeff = Ycoeff
16417  * self.Bcoeff = Bcoeff
16418  * self.tanhF = np.zeros(Nf,"d") # <<<<<<<<<<<<<<
16419  * #Calculating / checking wavelength data
16420  * if waveType== "Linear":
16421  */
16422  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 979, __pyx_L1_error)
16423  __Pyx_GOTREF(__pyx_t_6);
16424  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 979, __pyx_L1_error)
16425  __Pyx_GOTREF(__pyx_t_8);
16426  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16427  __pyx_t_6 = NULL;
16428  __pyx_t_10 = 0;
16429  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
16430  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
16431  if (likely(__pyx_t_6)) {
16432  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
16433  __Pyx_INCREF(__pyx_t_6);
16434  __Pyx_INCREF(function);
16435  __Pyx_DECREF_SET(__pyx_t_8, function);
16436  __pyx_t_10 = 1;
16437  }
16438  }
16439  #if CYTHON_FAST_PYCALL
16440  if (PyFunction_Check(__pyx_t_8)) {
16441  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_Nf, __pyx_n_s_d};
16442  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
16443  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16444  __Pyx_GOTREF(__pyx_t_5);
16445  } else
16446  #endif
16447  #if CYTHON_FAST_PYCCALL
16448  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
16449  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_Nf, __pyx_n_s_d};
16450  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
16451  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16452  __Pyx_GOTREF(__pyx_t_5);
16453  } else
16454  #endif
16455  {
16456  __pyx_t_7 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 979, __pyx_L1_error)
16457  __Pyx_GOTREF(__pyx_t_7);
16458  if (__pyx_t_6) {
16459  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
16460  }
16461  __Pyx_INCREF(__pyx_v_Nf);
16462  __Pyx_GIVEREF(__pyx_v_Nf);
16463  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_10, __pyx_v_Nf);
16464  __Pyx_INCREF(__pyx_n_s_d);
16465  __Pyx_GIVEREF(__pyx_n_s_d);
16466  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_10, __pyx_n_s_d);
16467  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 979, __pyx_L1_error)
16468  __Pyx_GOTREF(__pyx_t_5);
16469  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16470  }
16471  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16472  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 979, __pyx_L1_error)
16473  __Pyx_GIVEREF(__pyx_t_5);
16474  __Pyx_GOTREF(__pyx_v_self->tanhF);
16475  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
16476  __pyx_v_self->tanhF = ((PyArrayObject *)__pyx_t_5);
16477  __pyx_t_5 = 0;
16478 
16479  /* "WaveTools.py":981
16480  * self.tanhF = np.zeros(Nf,"d")
16481  * #Calculating / checking wavelength data
16482  * if waveType== "Linear": # <<<<<<<<<<<<<<
16483  * self.k = dispersion(w=self.omega,d=self.depth,g=self.gAbs)
16484  * self.wavelength = 2.0*M_PI/self.k
16485  */
16486  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_waveType, __pyx_n_s_Linear, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
16487  if (__pyx_t_4) {
16488 
16489  /* "WaveTools.py":982
16490  * #Calculating / checking wavelength data
16491  * if waveType== "Linear":
16492  * self.k = dispersion(w=self.omega,d=self.depth,g=self.gAbs) # <<<<<<<<<<<<<<
16493  * self.wavelength = 2.0*M_PI/self.k
16494  * elif waveType == "Fenton":
16495  */
16496  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
16497  __Pyx_GOTREF(__pyx_t_5);
16498  __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 982, __pyx_L1_error)
16499  __Pyx_GOTREF(__pyx_t_8);
16500  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->omega); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 982, __pyx_L1_error)
16501  __Pyx_GOTREF(__pyx_t_7);
16502  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_w, __pyx_t_7) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
16503  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16504  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 982, __pyx_L1_error)
16505  __Pyx_GOTREF(__pyx_t_7);
16506  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_d, __pyx_t_7) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
16507  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16508  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 982, __pyx_L1_error)
16509  __Pyx_GOTREF(__pyx_t_7);
16510  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_g, __pyx_t_7) < 0) __PYX_ERR(0, 982, __pyx_L1_error)
16511  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16512  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 982, __pyx_L1_error)
16513  __Pyx_GOTREF(__pyx_t_7);
16514  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16515  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16516  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 982, __pyx_L1_error)
16517  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16518  __pyx_v_self->k = __pyx_t_9;
16519 
16520  /* "WaveTools.py":983
16521  * if waveType== "Linear":
16522  * self.k = dispersion(w=self.omega,d=self.depth,g=self.gAbs)
16523  * self.wavelength = 2.0*M_PI/self.k # <<<<<<<<<<<<<<
16524  * elif waveType == "Fenton":
16525  * if autoFenton is False:
16526  */
16527  __pyx_t_9 = (2.0 * M_PI);
16528  if (unlikely(__pyx_v_self->k == 0)) {
16529  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
16530  __PYX_ERR(0, 983, __pyx_L1_error)
16531  }
16532  __pyx_v_self->wavelength = (__pyx_t_9 / __pyx_v_self->k);
16533 
16534  /* "WaveTools.py":981
16535  * self.tanhF = np.zeros(Nf,"d")
16536  * #Calculating / checking wavelength data
16537  * if waveType== "Linear": # <<<<<<<<<<<<<<
16538  * self.k = dispersion(w=self.omega,d=self.depth,g=self.gAbs)
16539  * self.wavelength = 2.0*M_PI/self.k
16540  */
16541  goto __pyx_L4;
16542  }
16543 
16544  /* "WaveTools.py":984
16545  * self.k = dispersion(w=self.omega,d=self.depth,g=self.gAbs)
16546  * self.wavelength = 2.0*M_PI/self.k
16547  * elif waveType == "Fenton": # <<<<<<<<<<<<<<
16548  * if autoFenton is False:
16549  * try:
16550  */
16551  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_waveType, __pyx_n_s_Fenton, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
16552  if (__pyx_t_4) {
16553 
16554  /* "WaveTools.py":985
16555  * self.wavelength = 2.0*M_PI/self.k
16556  * elif waveType == "Fenton":
16557  * if autoFenton is False: # <<<<<<<<<<<<<<
16558  * try:
16559  * self.k = 2.0*M_PI/wavelength
16560  */
16561  __pyx_t_4 = (__pyx_v_autoFenton == Py_False);
16562  __pyx_t_3 = (__pyx_t_4 != 0);
16563  if (__pyx_t_3) {
16564 
16565  /* "WaveTools.py":986
16566  * elif waveType == "Fenton":
16567  * if autoFenton is False:
16568  * try: # <<<<<<<<<<<<<<
16569  * self.k = 2.0*M_PI/wavelength
16570  * self.wavelength=wavelength
16571  */
16572  {
16573  __Pyx_PyThreadState_declare
16574  __Pyx_PyThreadState_assign
16575  __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
16576  __Pyx_XGOTREF(__pyx_t_11);
16577  __Pyx_XGOTREF(__pyx_t_12);
16578  __Pyx_XGOTREF(__pyx_t_13);
16579  /*try:*/ {
16580 
16581  /* "WaveTools.py":987
16582  * if autoFenton is False:
16583  * try:
16584  * self.k = 2.0*M_PI/wavelength # <<<<<<<<<<<<<<
16585  * self.wavelength=wavelength
16586  * except:
16587  */
16588  __pyx_t_7 = PyFloat_FromDouble((2.0 * M_PI)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 987, __pyx_L6_error)
16589  __Pyx_GOTREF(__pyx_t_7);
16590  __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_v_wavelength); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 987, __pyx_L6_error)
16591  __Pyx_GOTREF(__pyx_t_8);
16592  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16593  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L6_error)
16594  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16595  __pyx_v_self->k = __pyx_t_9;
16596 
16597  /* "WaveTools.py":988
16598  * try:
16599  * self.k = 2.0*M_PI/wavelength
16600  * self.wavelength=wavelength # <<<<<<<<<<<<<<
16601  * except:
16602  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0)
16603  */
16604  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_wavelength); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L6_error)
16605  __pyx_v_self->wavelength = __pyx_t_9;
16606 
16607  /* "WaveTools.py":986
16608  * elif waveType == "Fenton":
16609  * if autoFenton is False:
16610  * try: # <<<<<<<<<<<<<<
16611  * self.k = 2.0*M_PI/wavelength
16612  * self.wavelength=wavelength
16613  */
16614  }
16615  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
16616  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
16617  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
16618  goto __pyx_L11_try_end;
16619  __pyx_L6_error:;
16620  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16621  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16622  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16623  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16624  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16625 
16626  /* "WaveTools.py":989
16627  * self.k = 2.0*M_PI/wavelength
16628  * self.wavelength=wavelength
16629  * except: # <<<<<<<<<<<<<<
16630  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0)
16631  * sys.exit(1)
16632  */
16633  /*except:*/ {
16634  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16635  if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 989, __pyx_L8_except_error)
16636  __Pyx_GOTREF(__pyx_t_8);
16637  __Pyx_GOTREF(__pyx_t_7);
16638  __Pyx_GOTREF(__pyx_t_5);
16639 
16640  /* "WaveTools.py":990
16641  * self.wavelength=wavelength
16642  * except:
16643  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0) # <<<<<<<<<<<<<<
16644  * sys.exit(1)
16645  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ):
16646  */
16647  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 990, __pyx_L8_except_error)
16648  __Pyx_GOTREF(__pyx_t_6);
16649  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L8_except_error)
16650  __Pyx_GOTREF(__pyx_t_2);
16651  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 990, __pyx_L8_except_error)
16652  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__16, __pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 990, __pyx_L8_except_error)
16653  __Pyx_GOTREF(__pyx_t_14);
16654  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16655  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16656  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
16657 
16658  /* "WaveTools.py":991
16659  * except:
16660  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0)
16661  * sys.exit(1) # <<<<<<<<<<<<<<
16662  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ):
16663  * logEvent("ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero",level=0)
16664  */
16665  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L8_except_error)
16666  __Pyx_GOTREF(__pyx_t_2);
16667  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 991, __pyx_L8_except_error)
16668  __Pyx_GOTREF(__pyx_t_6);
16669  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16670  __pyx_t_2 = NULL;
16671  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
16672  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
16673  if (likely(__pyx_t_2)) {
16674  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
16675  __Pyx_INCREF(__pyx_t_2);
16676  __Pyx_INCREF(function);
16677  __Pyx_DECREF_SET(__pyx_t_6, function);
16678  }
16679  }
16680  __pyx_t_14 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
16681  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16682  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 991, __pyx_L8_except_error)
16683  __Pyx_GOTREF(__pyx_t_14);
16684  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16685  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
16686  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
16687  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16688  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
16689  goto __pyx_L7_exception_handled;
16690  }
16691  __pyx_L8_except_error:;
16692 
16693  /* "WaveTools.py":986
16694  * elif waveType == "Fenton":
16695  * if autoFenton is False:
16696  * try: # <<<<<<<<<<<<<<
16697  * self.k = 2.0*M_PI/wavelength
16698  * self.wavelength=wavelength
16699  */
16700  __Pyx_XGIVEREF(__pyx_t_11);
16701  __Pyx_XGIVEREF(__pyx_t_12);
16702  __Pyx_XGIVEREF(__pyx_t_13);
16703  __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
16704  goto __pyx_L1_error;
16705  __pyx_L7_exception_handled:;
16706  __Pyx_XGIVEREF(__pyx_t_11);
16707  __Pyx_XGIVEREF(__pyx_t_12);
16708  __Pyx_XGIVEREF(__pyx_t_13);
16709  __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
16710  __pyx_L11_try_end:;
16711  }
16712 
16713  /* "WaveTools.py":992
16714  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0)
16715  * sys.exit(1)
16716  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ): # <<<<<<<<<<<<<<
16717  * logEvent("ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero",level=0)
16718  * sys.exit(1)
16719  */
16720  __pyx_t_5 = ((PyObject *)__pyx_v_self->Ycoeff);
16721  __Pyx_INCREF(__pyx_t_5);
16722  __pyx_t_15 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 992, __pyx_L1_error)
16723  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16724  __pyx_t_4 = ((__pyx_t_15 != __pyx_v_self->Nf) != 0);
16725  if (!__pyx_t_4) {
16726  } else {
16727  __pyx_t_3 = __pyx_t_4;
16728  goto __pyx_L15_bool_binop_done;
16729  }
16730  __pyx_t_5 = ((PyObject *)__pyx_v_self->Bcoeff);
16731  __Pyx_INCREF(__pyx_t_5);
16732  __pyx_t_15 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 992, __pyx_L1_error)
16733  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16734  __pyx_t_4 = ((__pyx_t_15 != __pyx_v_self->Nf) != 0);
16735  if (!__pyx_t_4) {
16736  } else {
16737  __pyx_t_3 = __pyx_t_4;
16738  goto __pyx_L15_bool_binop_done;
16739  }
16740  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_Ycoeff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L1_error)
16741  __Pyx_GOTREF(__pyx_t_5);
16742  __pyx_t_7 = __Pyx_PyFloat_EqObjC(__pyx_t_5, __pyx_float_0_, 0., 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 992, __pyx_L1_error)
16743  __Pyx_GOTREF(__pyx_t_7);
16744  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16745  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
16746  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16747  if (!__pyx_t_4) {
16748  } else {
16749  __pyx_t_3 = __pyx_t_4;
16750  goto __pyx_L15_bool_binop_done;
16751  }
16752  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_Bcoeff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 992, __pyx_L1_error)
16753  __Pyx_GOTREF(__pyx_t_7);
16754  __pyx_t_5 = __Pyx_PyFloat_EqObjC(__pyx_t_7, __pyx_float_0_, 0., 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 992, __pyx_L1_error)
16755  __Pyx_GOTREF(__pyx_t_5);
16756  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16757  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 992, __pyx_L1_error)
16758  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16759  __pyx_t_3 = __pyx_t_4;
16760  __pyx_L15_bool_binop_done:;
16761  if (__pyx_t_3) {
16762 
16763  /* "WaveTools.py":993
16764  * sys.exit(1)
16765  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ):
16766  * logEvent("ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero",level=0) # <<<<<<<<<<<<<<
16767  * sys.exit(1)
16768  * else:
16769  */
16770  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 993, __pyx_L1_error)
16771  __Pyx_GOTREF(__pyx_t_5);
16772  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 993, __pyx_L1_error)
16773  __Pyx_GOTREF(__pyx_t_7);
16774  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 993, __pyx_L1_error)
16775  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__17, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 993, __pyx_L1_error)
16776  __Pyx_GOTREF(__pyx_t_8);
16777  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16778  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16779  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16780 
16781  /* "WaveTools.py":994
16782  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ):
16783  * logEvent("ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero",level=0)
16784  * sys.exit(1) # <<<<<<<<<<<<<<
16785  * else:
16786  * for ii in range(len(self.tanhF)):
16787  */
16788  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 994, __pyx_L1_error)
16789  __Pyx_GOTREF(__pyx_t_7);
16790  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 994, __pyx_L1_error)
16791  __Pyx_GOTREF(__pyx_t_5);
16792  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16793  __pyx_t_7 = NULL;
16794  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16795  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
16796  if (likely(__pyx_t_7)) {
16797  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16798  __Pyx_INCREF(__pyx_t_7);
16799  __Pyx_INCREF(function);
16800  __Pyx_DECREF_SET(__pyx_t_5, function);
16801  }
16802  }
16803  __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_1);
16804  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16805  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 994, __pyx_L1_error)
16806  __Pyx_GOTREF(__pyx_t_8);
16807  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16808  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16809 
16810  /* "WaveTools.py":992
16811  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0)
16812  * sys.exit(1)
16813  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ): # <<<<<<<<<<<<<<
16814  * logEvent("ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero",level=0)
16815  * sys.exit(1)
16816  */
16817  goto __pyx_L14;
16818  }
16819 
16820  /* "WaveTools.py":996
16821  * sys.exit(1)
16822  * else:
16823  * for ii in range(len(self.tanhF)): # <<<<<<<<<<<<<<
16824  * kk = (ii+1)*self.k
16825  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
16826  */
16827  /*else*/ {
16828  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 996, __pyx_L1_error)
16829  __Pyx_GOTREF(__pyx_t_5);
16830  __pyx_t_7 = ((PyObject *)__pyx_v_self->tanhF);
16831  __Pyx_INCREF(__pyx_t_7);
16832  __pyx_t_15 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 996, __pyx_L1_error)
16833  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16834  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 996, __pyx_L1_error)
16835  __Pyx_GOTREF(__pyx_t_7);
16836  __pyx_t_14 = NULL;
16837  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16838  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
16839  if (likely(__pyx_t_14)) {
16840  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16841  __Pyx_INCREF(__pyx_t_14);
16842  __Pyx_INCREF(function);
16843  __Pyx_DECREF_SET(__pyx_t_5, function);
16844  }
16845  }
16846  __pyx_t_8 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7);
16847  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
16848  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16849  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error)
16850  __Pyx_GOTREF(__pyx_t_8);
16851  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16852  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
16853  __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
16854  __pyx_t_16 = NULL;
16855  } else {
16856  __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 996, __pyx_L1_error)
16857  __Pyx_GOTREF(__pyx_t_5);
16858  __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 996, __pyx_L1_error)
16859  }
16860  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16861  for (;;) {
16862  if (likely(!__pyx_t_16)) {
16863  if (likely(PyList_CheckExact(__pyx_t_5))) {
16864  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
16865  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16866  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 996, __pyx_L1_error)
16867  #else
16868  __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error)
16869  __Pyx_GOTREF(__pyx_t_8);
16870  #endif
16871  } else {
16872  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
16873  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16874  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 996, __pyx_L1_error)
16875  #else
16876  __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 996, __pyx_L1_error)
16877  __Pyx_GOTREF(__pyx_t_8);
16878  #endif
16879  }
16880  } else {
16881  __pyx_t_8 = __pyx_t_16(__pyx_t_5);
16882  if (unlikely(!__pyx_t_8)) {
16883  PyObject* exc_type = PyErr_Occurred();
16884  if (exc_type) {
16885  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
16886  else __PYX_ERR(0, 996, __pyx_L1_error)
16887  }
16888  break;
16889  }
16890  __Pyx_GOTREF(__pyx_t_8);
16891  }
16892  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_8);
16893  __pyx_t_8 = 0;
16894 
16895  /* "WaveTools.py":997
16896  * else:
16897  * for ii in range(len(self.tanhF)):
16898  * kk = (ii+1)*self.k # <<<<<<<<<<<<<<
16899  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
16900  * elif autoFenton is True:
16901  */
16902  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_ii, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 997, __pyx_L1_error)
16903  __Pyx_GOTREF(__pyx_t_8);
16904  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->k); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 997, __pyx_L1_error)
16905  __Pyx_GOTREF(__pyx_t_7);
16906  __pyx_t_14 = PyNumber_Multiply(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 997, __pyx_L1_error)
16907  __Pyx_GOTREF(__pyx_t_14);
16908  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16909  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16910  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_14);
16911  __pyx_t_14 = 0;
16912 
16913  /* "WaveTools.py":998
16914  * for ii in range(len(self.tanhF)):
16915  * kk = (ii+1)*self.k
16916  * self.tanhF[ii] = float(np.tanh(kk*self.depth) ) # <<<<<<<<<<<<<<
16917  * elif autoFenton is True:
16918  * from proteus.fenton import Fenton
16919  */
16920  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 998, __pyx_L1_error)
16921  __Pyx_GOTREF(__pyx_t_7);
16922  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_tanh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 998, __pyx_L1_error)
16923  __Pyx_GOTREF(__pyx_t_8);
16924  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16925  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 998, __pyx_L1_error)
16926  __Pyx_GOTREF(__pyx_t_7);
16927  __pyx_t_6 = PyNumber_Multiply(__pyx_v_kk, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 998, __pyx_L1_error)
16928  __Pyx_GOTREF(__pyx_t_6);
16929  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
16930  __pyx_t_7 = NULL;
16931  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
16932  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
16933  if (likely(__pyx_t_7)) {
16934  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
16935  __Pyx_INCREF(__pyx_t_7);
16936  __Pyx_INCREF(function);
16937  __Pyx_DECREF_SET(__pyx_t_8, function);
16938  }
16939  }
16940  __pyx_t_14 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6);
16941  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
16942  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
16943  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 998, __pyx_L1_error)
16944  __Pyx_GOTREF(__pyx_t_14);
16945  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16946  __pyx_t_8 = __Pyx_PyNumber_Float(__pyx_t_14); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 998, __pyx_L1_error)
16947  __Pyx_GOTREF(__pyx_t_8);
16948  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
16949  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->tanhF), __pyx_v_ii, __pyx_t_8) < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
16950  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16951 
16952  /* "WaveTools.py":996
16953  * sys.exit(1)
16954  * else:
16955  * for ii in range(len(self.tanhF)): # <<<<<<<<<<<<<<
16956  * kk = (ii+1)*self.k
16957  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
16958  */
16959  }
16960  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16961  }
16962  __pyx_L14:;
16963 
16964  /* "WaveTools.py":985
16965  * self.wavelength = 2.0*M_PI/self.k
16966  * elif waveType == "Fenton":
16967  * if autoFenton is False: # <<<<<<<<<<<<<<
16968  * try:
16969  * self.k = 2.0*M_PI/wavelength
16970  */
16971  goto __pyx_L5;
16972  }
16973 
16974  /* "WaveTools.py":999
16975  * kk = (ii+1)*self.k
16976  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
16977  * elif autoFenton is True: # <<<<<<<<<<<<<<
16978  * from proteus.fenton import Fenton
16979  * comm = Comm.get()
16980  */
16981  __pyx_t_3 = (__pyx_v_autoFenton == Py_True);
16982  __pyx_t_4 = (__pyx_t_3 != 0);
16983  if (__pyx_t_4) {
16984 
16985  /* "WaveTools.py":1000
16986  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
16987  * elif autoFenton is True:
16988  * from proteus.fenton import Fenton # <<<<<<<<<<<<<<
16989  * comm = Comm.get()
16990  * if comm.isMaster():
16991  */
16992  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1000, __pyx_L1_error)
16993  __Pyx_GOTREF(__pyx_t_5);
16994  __Pyx_INCREF(__pyx_n_s_Fenton);
16995  __Pyx_GIVEREF(__pyx_n_s_Fenton);
16996  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_Fenton);
16997  __pyx_t_8 = __Pyx_Import(__pyx_n_s_proteus_fenton, __pyx_t_5, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1000, __pyx_L1_error)
16998  __Pyx_GOTREF(__pyx_t_8);
16999  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17000  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_8, __pyx_n_s_Fenton); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1000, __pyx_L1_error)
17001  __Pyx_GOTREF(__pyx_t_5);
17002  __Pyx_INCREF(__pyx_t_5);
17003  __pyx_v_Fenton = __pyx_t_5;
17004  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17005  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17006 
17007  /* "WaveTools.py":1001
17008  * elif autoFenton is True:
17009  * from proteus.fenton import Fenton
17010  * comm = Comm.get() # <<<<<<<<<<<<<<
17011  * if comm.isMaster():
17012  * if autoFentonOpts is None:
17013  */
17014  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Comm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error)
17015  __Pyx_GOTREF(__pyx_t_5);
17016  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1001, __pyx_L1_error)
17017  __Pyx_GOTREF(__pyx_t_14);
17018  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17019  __pyx_t_5 = NULL;
17020  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
17021  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_14);
17022  if (likely(__pyx_t_5)) {
17023  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
17024  __Pyx_INCREF(__pyx_t_5);
17025  __Pyx_INCREF(function);
17026  __Pyx_DECREF_SET(__pyx_t_14, function);
17027  }
17028  }
17029  __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
17030  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17031  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1001, __pyx_L1_error)
17032  __Pyx_GOTREF(__pyx_t_8);
17033  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17034  __pyx_v_comm = __pyx_t_8;
17035  __pyx_t_8 = 0;
17036 
17037  /* "WaveTools.py":1002
17038  * from proteus.fenton import Fenton
17039  * comm = Comm.get()
17040  * if comm.isMaster(): # <<<<<<<<<<<<<<
17041  * if autoFentonOpts is None:
17042  * autoFentonOpts = {'mode': 'Period',
17043  */
17044  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_isMaster); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1002, __pyx_L1_error)
17045  __Pyx_GOTREF(__pyx_t_14);
17046  __pyx_t_5 = NULL;
17047  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
17048  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_14);
17049  if (likely(__pyx_t_5)) {
17050  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
17051  __Pyx_INCREF(__pyx_t_5);
17052  __Pyx_INCREF(function);
17053  __Pyx_DECREF_SET(__pyx_t_14, function);
17054  }
17055  }
17056  __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
17057  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17058  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1002, __pyx_L1_error)
17059  __Pyx_GOTREF(__pyx_t_8);
17060  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17061  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1002, __pyx_L1_error)
17062  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17063  if (__pyx_t_4) {
17064 
17065  /* "WaveTools.py":1003
17066  * comm = Comm.get()
17067  * if comm.isMaster():
17068  * if autoFentonOpts is None: # <<<<<<<<<<<<<<
17069  * autoFentonOpts = {'mode': 'Period',
17070  * 'current_criterion': 1,
17071  */
17072  __pyx_t_4 = (__pyx_v_autoFentonOpts == Py_None);
17073  __pyx_t_3 = (__pyx_t_4 != 0);
17074  if (__pyx_t_3) {
17075 
17076  /* "WaveTools.py":1004
17077  * if comm.isMaster():
17078  * if autoFentonOpts is None:
17079  * autoFentonOpts = {'mode': 'Period', # <<<<<<<<<<<<<<
17080  * 'current_criterion': 1,
17081  * 'height_steps': 1,
17082  */
17083  __pyx_t_8 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1004, __pyx_L1_error)
17084  __Pyx_GOTREF(__pyx_t_8);
17085  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_mode, __pyx_n_s_Period) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17086  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_current_criterion, __pyx_int_1) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17087  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_height_steps, __pyx_int_1) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17088  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_niter, __pyx_int_40) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17089  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_conv_crit, __pyx_float_1eneg_05) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17090  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_points_freesurface, __pyx_int_50) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17091  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_points_velocity, __pyx_int_16) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17092  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_points_vertical, __pyx_int_20) < 0) __PYX_ERR(0, 1004, __pyx_L1_error)
17093  __Pyx_DECREF_SET(__pyx_v_autoFentonOpts, __pyx_t_8);
17094  __pyx_t_8 = 0;
17095 
17096  /* "WaveTools.py":1003
17097  * comm = Comm.get()
17098  * if comm.isMaster():
17099  * if autoFentonOpts is None: # <<<<<<<<<<<<<<
17100  * autoFentonOpts = {'mode': 'Period',
17101  * 'current_criterion': 1,
17102  */
17103  }
17104 
17105  /* "WaveTools.py":1012
17106  * 'points_velocity': 16,
17107  * 'points_vertical': 20}
17108  * Fenton.writeInput(waveheight=waveHeight, # <<<<<<<<<<<<<<
17109  * depth=depth,
17110  * period=period,
17111  */
17112  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_Fenton, __pyx_n_s_writeInput); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1012, __pyx_L1_error)
17113  __Pyx_GOTREF(__pyx_t_8);
17114  __pyx_t_14 = __Pyx_PyDict_NewPresized(14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1012, __pyx_L1_error)
17115  __Pyx_GOTREF(__pyx_t_14);
17116  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_waveheight, __pyx_v_waveHeight) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17117 
17118  /* "WaveTools.py":1013
17119  * 'points_vertical': 20}
17120  * Fenton.writeInput(waveheight=waveHeight,
17121  * depth=depth, # <<<<<<<<<<<<<<
17122  * period=period,
17123  * mode=autoFentonOpts['mode'],
17124  */
17125  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_depth, __pyx_v_depth) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17126 
17127  /* "WaveTools.py":1014
17128  * Fenton.writeInput(waveheight=waveHeight,
17129  * depth=depth,
17130  * period=period, # <<<<<<<<<<<<<<
17131  * mode=autoFentonOpts['mode'],
17132  * current_criterion=autoFentonOpts['current_criterion'],
17133  */
17134  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_period, __pyx_v_period) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17135 
17136  /* "WaveTools.py":1015
17137  * depth=depth,
17138  * period=period,
17139  * mode=autoFentonOpts['mode'], # <<<<<<<<<<<<<<
17140  * current_criterion=autoFentonOpts['current_criterion'],
17141  * current_magnitude=0,
17142  */
17143  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1015, __pyx_L1_error)
17144  __Pyx_GOTREF(__pyx_t_5);
17145  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_mode, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17146  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17147 
17148  /* "WaveTools.py":1016
17149  * period=period,
17150  * mode=autoFentonOpts['mode'],
17151  * current_criterion=autoFentonOpts['current_criterion'], # <<<<<<<<<<<<<<
17152  * current_magnitude=0,
17153  * ncoeffs=Nf,
17154  */
17155  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_current_criterion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1016, __pyx_L1_error)
17156  __Pyx_GOTREF(__pyx_t_5);
17157  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_current_criterion, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17158  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17159  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_current_magnitude, __pyx_int_0) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17160 
17161  /* "WaveTools.py":1018
17162  * current_criterion=autoFentonOpts['current_criterion'],
17163  * current_magnitude=0,
17164  * ncoeffs=Nf, # <<<<<<<<<<<<<<
17165  * height_steps=autoFentonOpts['height_steps'],
17166  * g=np.linalg.norm(g),
17167  */
17168  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_ncoeffs, __pyx_v_Nf) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17169 
17170  /* "WaveTools.py":1019
17171  * current_magnitude=0,
17172  * ncoeffs=Nf,
17173  * height_steps=autoFentonOpts['height_steps'], # <<<<<<<<<<<<<<
17174  * g=np.linalg.norm(g),
17175  * niter=autoFentonOpts['niter'],
17176  */
17177  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_height_steps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1019, __pyx_L1_error)
17178  __Pyx_GOTREF(__pyx_t_5);
17179  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_height_steps, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17180  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17181 
17182  /* "WaveTools.py":1020
17183  * ncoeffs=Nf,
17184  * height_steps=autoFentonOpts['height_steps'],
17185  * g=np.linalg.norm(g), # <<<<<<<<<<<<<<
17186  * niter=autoFentonOpts['niter'],
17187  * conv_crit=autoFentonOpts['conv_crit'],
17188  */
17189  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error)
17190  __Pyx_GOTREF(__pyx_t_6);
17191  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_linalg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1020, __pyx_L1_error)
17192  __Pyx_GOTREF(__pyx_t_7);
17193  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17194  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_norm); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1020, __pyx_L1_error)
17195  __Pyx_GOTREF(__pyx_t_6);
17196  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17197  __pyx_t_7 = NULL;
17198  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
17199  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
17200  if (likely(__pyx_t_7)) {
17201  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
17202  __Pyx_INCREF(__pyx_t_7);
17203  __Pyx_INCREF(function);
17204  __Pyx_DECREF_SET(__pyx_t_6, function);
17205  }
17206  }
17207  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_g);
17208  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17209  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1020, __pyx_L1_error)
17210  __Pyx_GOTREF(__pyx_t_5);
17211  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17212  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_g, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17213  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17214 
17215  /* "WaveTools.py":1021
17216  * height_steps=autoFentonOpts['height_steps'],
17217  * g=np.linalg.norm(g),
17218  * niter=autoFentonOpts['niter'], # <<<<<<<<<<<<<<
17219  * conv_crit=autoFentonOpts['conv_crit'],
17220  * points_freesurface=autoFentonOpts['points_freesurface'],
17221  */
17222  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_niter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1021, __pyx_L1_error)
17223  __Pyx_GOTREF(__pyx_t_5);
17224  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_niter, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17225  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17226 
17227  /* "WaveTools.py":1022
17228  * g=np.linalg.norm(g),
17229  * niter=autoFentonOpts['niter'],
17230  * conv_crit=autoFentonOpts['conv_crit'], # <<<<<<<<<<<<<<
17231  * points_freesurface=autoFentonOpts['points_freesurface'],
17232  * points_velocity=autoFentonOpts['points_velocity'],
17233  */
17234  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_conv_crit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1022, __pyx_L1_error)
17235  __Pyx_GOTREF(__pyx_t_5);
17236  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_conv_crit, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17237  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17238 
17239  /* "WaveTools.py":1023
17240  * niter=autoFentonOpts['niter'],
17241  * conv_crit=autoFentonOpts['conv_crit'],
17242  * points_freesurface=autoFentonOpts['points_freesurface'], # <<<<<<<<<<<<<<
17243  * points_velocity=autoFentonOpts['points_velocity'],
17244  * points_vertical=autoFentonOpts['points_vertical'])
17245  */
17246  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_points_freesurface); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1023, __pyx_L1_error)
17247  __Pyx_GOTREF(__pyx_t_5);
17248  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_points_freesurface, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17249  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17250 
17251  /* "WaveTools.py":1024
17252  * conv_crit=autoFentonOpts['conv_crit'],
17253  * points_freesurface=autoFentonOpts['points_freesurface'],
17254  * points_velocity=autoFentonOpts['points_velocity'], # <<<<<<<<<<<<<<
17255  * points_vertical=autoFentonOpts['points_vertical'])
17256  * Fenton.runFourier()
17257  */
17258  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_points_velocity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1024, __pyx_L1_error)
17259  __Pyx_GOTREF(__pyx_t_5);
17260  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_points_velocity, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17261  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17262 
17263  /* "WaveTools.py":1025
17264  * points_freesurface=autoFentonOpts['points_freesurface'],
17265  * points_velocity=autoFentonOpts['points_velocity'],
17266  * points_vertical=autoFentonOpts['points_vertical']) # <<<<<<<<<<<<<<
17267  * Fenton.runFourier()
17268  * Fenton.copyFiles()
17269  */
17270  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_autoFentonOpts, __pyx_n_s_points_vertical); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1025, __pyx_L1_error)
17271  __Pyx_GOTREF(__pyx_t_5);
17272  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_points_vertical, __pyx_t_5) < 0) __PYX_ERR(0, 1012, __pyx_L1_error)
17273  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17274 
17275  /* "WaveTools.py":1012
17276  * 'points_velocity': 16,
17277  * 'points_vertical': 20}
17278  * Fenton.writeInput(waveheight=waveHeight, # <<<<<<<<<<<<<<
17279  * depth=depth,
17280  * period=period,
17281  */
17282  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1012, __pyx_L1_error)
17283  __Pyx_GOTREF(__pyx_t_5);
17284  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17285  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17286  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17287 
17288  /* "WaveTools.py":1026
17289  * points_velocity=autoFentonOpts['points_velocity'],
17290  * points_vertical=autoFentonOpts['points_vertical'])
17291  * Fenton.runFourier() # <<<<<<<<<<<<<<
17292  * Fenton.copyFiles()
17293  * comm.barrier()
17294  */
17295  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_Fenton, __pyx_n_s_runFourier); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1026, __pyx_L1_error)
17296  __Pyx_GOTREF(__pyx_t_14);
17297  __pyx_t_8 = NULL;
17298  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
17299  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
17300  if (likely(__pyx_t_8)) {
17301  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
17302  __Pyx_INCREF(__pyx_t_8);
17303  __Pyx_INCREF(function);
17304  __Pyx_DECREF_SET(__pyx_t_14, function);
17305  }
17306  }
17307  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
17308  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17309  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1026, __pyx_L1_error)
17310  __Pyx_GOTREF(__pyx_t_5);
17311  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17312  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17313 
17314  /* "WaveTools.py":1027
17315  * points_vertical=autoFentonOpts['points_vertical'])
17316  * Fenton.runFourier()
17317  * Fenton.copyFiles() # <<<<<<<<<<<<<<
17318  * comm.barrier()
17319  * self.Bcoeff, self.Ycoeff = Fenton.getBYCoeffs()
17320  */
17321  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_Fenton, __pyx_n_s_copyFiles); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1027, __pyx_L1_error)
17322  __Pyx_GOTREF(__pyx_t_14);
17323  __pyx_t_8 = NULL;
17324  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
17325  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
17326  if (likely(__pyx_t_8)) {
17327  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
17328  __Pyx_INCREF(__pyx_t_8);
17329  __Pyx_INCREF(function);
17330  __Pyx_DECREF_SET(__pyx_t_14, function);
17331  }
17332  }
17333  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
17334  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17335  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1027, __pyx_L1_error)
17336  __Pyx_GOTREF(__pyx_t_5);
17337  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17338  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17339 
17340  /* "WaveTools.py":1002
17341  * from proteus.fenton import Fenton
17342  * comm = Comm.get()
17343  * if comm.isMaster(): # <<<<<<<<<<<<<<
17344  * if autoFentonOpts is None:
17345  * autoFentonOpts = {'mode': 'Period',
17346  */
17347  }
17348 
17349  /* "WaveTools.py":1028
17350  * Fenton.runFourier()
17351  * Fenton.copyFiles()
17352  * comm.barrier() # <<<<<<<<<<<<<<
17353  * self.Bcoeff, self.Ycoeff = Fenton.getBYCoeffs()
17354  * self.wavelength = Fenton.getWavelength()*depth
17355  */
17356  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_comm, __pyx_n_s_barrier); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1028, __pyx_L1_error)
17357  __Pyx_GOTREF(__pyx_t_14);
17358  __pyx_t_8 = NULL;
17359  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
17360  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
17361  if (likely(__pyx_t_8)) {
17362  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
17363  __Pyx_INCREF(__pyx_t_8);
17364  __Pyx_INCREF(function);
17365  __Pyx_DECREF_SET(__pyx_t_14, function);
17366  }
17367  }
17368  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
17369  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17370  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1028, __pyx_L1_error)
17371  __Pyx_GOTREF(__pyx_t_5);
17372  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17373  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17374 
17375  /* "WaveTools.py":1029
17376  * Fenton.copyFiles()
17377  * comm.barrier()
17378  * self.Bcoeff, self.Ycoeff = Fenton.getBYCoeffs() # <<<<<<<<<<<<<<
17379  * self.wavelength = Fenton.getWavelength()*depth
17380  * self.k = 2.0*M_PI/self.wavelength
17381  */
17382  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_Fenton, __pyx_n_s_getBYCoeffs); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1029, __pyx_L1_error)
17383  __Pyx_GOTREF(__pyx_t_14);
17384  __pyx_t_8 = NULL;
17385  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
17386  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_14);
17387  if (likely(__pyx_t_8)) {
17388  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
17389  __Pyx_INCREF(__pyx_t_8);
17390  __Pyx_INCREF(function);
17391  __Pyx_DECREF_SET(__pyx_t_14, function);
17392  }
17393  }
17394  __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_14);
17395  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17396  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1029, __pyx_L1_error)
17397  __Pyx_GOTREF(__pyx_t_5);
17398  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17399  if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
17400  PyObject* sequence = __pyx_t_5;
17401  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17402  if (unlikely(size != 2)) {
17403  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
17404  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17405  __PYX_ERR(0, 1029, __pyx_L1_error)
17406  }
17407  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17408  if (likely(PyTuple_CheckExact(sequence))) {
17409  __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0);
17410  __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
17411  } else {
17412  __pyx_t_14 = PyList_GET_ITEM(sequence, 0);
17413  __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
17414  }
17415  __Pyx_INCREF(__pyx_t_14);
17416  __Pyx_INCREF(__pyx_t_8);
17417  #else
17418  __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1029, __pyx_L1_error)
17419  __Pyx_GOTREF(__pyx_t_14);
17420  __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1029, __pyx_L1_error)
17421  __Pyx_GOTREF(__pyx_t_8);
17422  #endif
17423  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17424  } else {
17425  Py_ssize_t index = -1;
17426  __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1029, __pyx_L1_error)
17427  __Pyx_GOTREF(__pyx_t_6);
17428  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17429  __pyx_t_17 = Py_TYPE(__pyx_t_6)->tp_iternext;
17430  index = 0; __pyx_t_14 = __pyx_t_17(__pyx_t_6); if (unlikely(!__pyx_t_14)) goto __pyx_L23_unpacking_failed;
17431  __Pyx_GOTREF(__pyx_t_14);
17432  index = 1; __pyx_t_8 = __pyx_t_17(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L23_unpacking_failed;
17433  __Pyx_GOTREF(__pyx_t_8);
17434  if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1029, __pyx_L1_error)
17435  __pyx_t_17 = NULL;
17436  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17437  goto __pyx_L24_unpacking_done;
17438  __pyx_L23_unpacking_failed:;
17439  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17440  __pyx_t_17 = NULL;
17441  if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17442  __PYX_ERR(0, 1029, __pyx_L1_error)
17443  __pyx_L24_unpacking_done:;
17444  }
17445  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1029, __pyx_L1_error)
17446  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1029, __pyx_L1_error)
17447  __Pyx_GIVEREF(__pyx_t_14);
17448  __Pyx_GOTREF(__pyx_v_self->Bcoeff);
17449  __Pyx_DECREF(((PyObject *)__pyx_v_self->Bcoeff));
17450  __pyx_v_self->Bcoeff = ((PyArrayObject *)__pyx_t_14);
17451  __pyx_t_14 = 0;
17452  __Pyx_GIVEREF(__pyx_t_8);
17453  __Pyx_GOTREF(__pyx_v_self->Ycoeff);
17454  __Pyx_DECREF(((PyObject *)__pyx_v_self->Ycoeff));
17455  __pyx_v_self->Ycoeff = ((PyArrayObject *)__pyx_t_8);
17456  __pyx_t_8 = 0;
17457 
17458  /* "WaveTools.py":1030
17459  * comm.barrier()
17460  * self.Bcoeff, self.Ycoeff = Fenton.getBYCoeffs()
17461  * self.wavelength = Fenton.getWavelength()*depth # <<<<<<<<<<<<<<
17462  * self.k = 2.0*M_PI/self.wavelength
17463  * for ii in range(len(self.tanhF)):
17464  */
17465  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_Fenton, __pyx_n_s_getWavelength); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1030, __pyx_L1_error)
17466  __Pyx_GOTREF(__pyx_t_8);
17467  __pyx_t_14 = NULL;
17468  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
17469  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8);
17470  if (likely(__pyx_t_14)) {
17471  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
17472  __Pyx_INCREF(__pyx_t_14);
17473  __Pyx_INCREF(function);
17474  __Pyx_DECREF_SET(__pyx_t_8, function);
17475  }
17476  }
17477  __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
17478  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
17479  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1030, __pyx_L1_error)
17480  __Pyx_GOTREF(__pyx_t_5);
17481  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17482  __pyx_t_8 = PyNumber_Multiply(__pyx_t_5, __pyx_v_depth); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1030, __pyx_L1_error)
17483  __Pyx_GOTREF(__pyx_t_8);
17484  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17485  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1030, __pyx_L1_error)
17486  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17487  __pyx_v_self->wavelength = __pyx_t_9;
17488 
17489  /* "WaveTools.py":1031
17490  * self.Bcoeff, self.Ycoeff = Fenton.getBYCoeffs()
17491  * self.wavelength = Fenton.getWavelength()*depth
17492  * self.k = 2.0*M_PI/self.wavelength # <<<<<<<<<<<<<<
17493  * for ii in range(len(self.tanhF)):
17494  * kk = (ii+1)*self.k
17495  */
17496  __pyx_t_9 = (2.0 * M_PI);
17497  if (unlikely(__pyx_v_self->wavelength == 0)) {
17498  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
17499  __PYX_ERR(0, 1031, __pyx_L1_error)
17500  }
17501  __pyx_v_self->k = (__pyx_t_9 / __pyx_v_self->wavelength);
17502 
17503  /* "WaveTools.py":1032
17504  * self.wavelength = Fenton.getWavelength()*depth
17505  * self.k = 2.0*M_PI/self.wavelength
17506  * for ii in range(len(self.tanhF)): # <<<<<<<<<<<<<<
17507  * kk = (ii+1)*self.k
17508  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
17509  */
17510  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
17511  __Pyx_GOTREF(__pyx_t_5);
17512  __pyx_t_14 = ((PyObject *)__pyx_v_self->tanhF);
17513  __Pyx_INCREF(__pyx_t_14);
17514  __pyx_t_15 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1032, __pyx_L1_error)
17515  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17516  __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1032, __pyx_L1_error)
17517  __Pyx_GOTREF(__pyx_t_14);
17518  __pyx_t_6 = NULL;
17519  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
17520  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
17521  if (likely(__pyx_t_6)) {
17522  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
17523  __Pyx_INCREF(__pyx_t_6);
17524  __Pyx_INCREF(function);
17525  __Pyx_DECREF_SET(__pyx_t_5, function);
17526  }
17527  }
17528  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_t_14) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_14);
17529  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17530  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17531  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1032, __pyx_L1_error)
17532  __Pyx_GOTREF(__pyx_t_8);
17533  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17534  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
17535  __pyx_t_5 = __pyx_t_8; __Pyx_INCREF(__pyx_t_5); __pyx_t_15 = 0;
17536  __pyx_t_16 = NULL;
17537  } else {
17538  __pyx_t_15 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1032, __pyx_L1_error)
17539  __Pyx_GOTREF(__pyx_t_5);
17540  __pyx_t_16 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1032, __pyx_L1_error)
17541  }
17542  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17543  for (;;) {
17544  if (likely(!__pyx_t_16)) {
17545  if (likely(PyList_CheckExact(__pyx_t_5))) {
17546  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_5)) break;
17547  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17548  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
17549  #else
17550  __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1032, __pyx_L1_error)
17551  __Pyx_GOTREF(__pyx_t_8);
17552  #endif
17553  } else {
17554  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
17555  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17556  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1032, __pyx_L1_error)
17557  #else
17558  __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1032, __pyx_L1_error)
17559  __Pyx_GOTREF(__pyx_t_8);
17560  #endif
17561  }
17562  } else {
17563  __pyx_t_8 = __pyx_t_16(__pyx_t_5);
17564  if (unlikely(!__pyx_t_8)) {
17565  PyObject* exc_type = PyErr_Occurred();
17566  if (exc_type) {
17567  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17568  else __PYX_ERR(0, 1032, __pyx_L1_error)
17569  }
17570  break;
17571  }
17572  __Pyx_GOTREF(__pyx_t_8);
17573  }
17574  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_8);
17575  __pyx_t_8 = 0;
17576 
17577  /* "WaveTools.py":1033
17578  * self.k = 2.0*M_PI/self.wavelength
17579  * for ii in range(len(self.tanhF)):
17580  * kk = (ii+1)*self.k # <<<<<<<<<<<<<<
17581  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
17582  *
17583  */
17584  __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_v_ii, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1033, __pyx_L1_error)
17585  __Pyx_GOTREF(__pyx_t_8);
17586  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->k); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1033, __pyx_L1_error)
17587  __Pyx_GOTREF(__pyx_t_14);
17588  __pyx_t_6 = PyNumber_Multiply(__pyx_t_8, __pyx_t_14); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1033, __pyx_L1_error)
17589  __Pyx_GOTREF(__pyx_t_6);
17590  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17591  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17592  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_6);
17593  __pyx_t_6 = 0;
17594 
17595  /* "WaveTools.py":1034
17596  * for ii in range(len(self.tanhF)):
17597  * kk = (ii+1)*self.k
17598  * self.tanhF[ii] = float(np.tanh(kk*self.depth) ) # <<<<<<<<<<<<<<
17599  *
17600  *
17601  */
17602  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1034, __pyx_L1_error)
17603  __Pyx_GOTREF(__pyx_t_14);
17604  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_tanh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1034, __pyx_L1_error)
17605  __Pyx_GOTREF(__pyx_t_8);
17606  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17607  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1034, __pyx_L1_error)
17608  __Pyx_GOTREF(__pyx_t_14);
17609  __pyx_t_7 = PyNumber_Multiply(__pyx_v_kk, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1034, __pyx_L1_error)
17610  __Pyx_GOTREF(__pyx_t_7);
17611  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
17612  __pyx_t_14 = NULL;
17613  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
17614  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_8);
17615  if (likely(__pyx_t_14)) {
17616  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
17617  __Pyx_INCREF(__pyx_t_14);
17618  __Pyx_INCREF(function);
17619  __Pyx_DECREF_SET(__pyx_t_8, function);
17620  }
17621  }
17622  __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_14, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
17623  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
17624  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
17625  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error)
17626  __Pyx_GOTREF(__pyx_t_6);
17627  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17628  __pyx_t_8 = __Pyx_PyNumber_Float(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1034, __pyx_L1_error)
17629  __Pyx_GOTREF(__pyx_t_8);
17630  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17631  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->tanhF), __pyx_v_ii, __pyx_t_8) < 0)) __PYX_ERR(0, 1034, __pyx_L1_error)
17632  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17633 
17634  /* "WaveTools.py":1032
17635  * self.wavelength = Fenton.getWavelength()*depth
17636  * self.k = 2.0*M_PI/self.wavelength
17637  * for ii in range(len(self.tanhF)): # <<<<<<<<<<<<<<
17638  * kk = (ii+1)*self.k
17639  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
17640  */
17641  }
17642  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17643 
17644  /* "WaveTools.py":999
17645  * kk = (ii+1)*self.k
17646  * self.tanhF[ii] = float(np.tanh(kk*self.depth) )
17647  * elif autoFenton is True: # <<<<<<<<<<<<<<
17648  * from proteus.fenton import Fenton
17649  * comm = Comm.get()
17650  */
17651  }
17652  __pyx_L5:;
17653 
17654  /* "WaveTools.py":984
17655  * self.k = dispersion(w=self.omega,d=self.depth,g=self.gAbs)
17656  * self.wavelength = 2.0*M_PI/self.k
17657  * elif waveType == "Fenton": # <<<<<<<<<<<<<<
17658  * if autoFenton is False:
17659  * try:
17660  */
17661  }
17662  __pyx_L4:;
17663 
17664  /* "WaveTools.py":1037
17665  *
17666  *
17667  * self.kDir = self.k * self.waveDir # <<<<<<<<<<<<<<
17668  * self.amplitude = 0.5*waveHeight
17669  * self.mV = np.array(meanVelocity)
17670  */
17671  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_self->k); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1037, __pyx_L1_error)
17672  __Pyx_GOTREF(__pyx_t_5);
17673  __pyx_t_8 = PyNumber_Multiply(__pyx_t_5, ((PyObject *)__pyx_v_self->waveDir)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1037, __pyx_L1_error)
17674  __Pyx_GOTREF(__pyx_t_8);
17675  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17676  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1037, __pyx_L1_error)
17677  __Pyx_GIVEREF(__pyx_t_8);
17678  __Pyx_GOTREF(__pyx_v_self->kDir);
17679  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
17680  __pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_8);
17681  __pyx_t_8 = 0;
17682 
17683  /* "WaveTools.py":1038
17684  *
17685  * self.kDir = self.k * self.waveDir
17686  * self.amplitude = 0.5*waveHeight # <<<<<<<<<<<<<<
17687  * self.mV = np.array(meanVelocity)
17688  * #Checking that meanvelocity is a vector
17689  */
17690  __pyx_t_8 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_waveHeight); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1038, __pyx_L1_error)
17691  __Pyx_GOTREF(__pyx_t_8);
17692  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1038, __pyx_L1_error)
17693  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17694  __pyx_v_self->amplitude = __pyx_t_9;
17695 
17696  /* "WaveTools.py":1039
17697  * self.kDir = self.k * self.waveDir
17698  * self.amplitude = 0.5*waveHeight
17699  * self.mV = np.array(meanVelocity) # <<<<<<<<<<<<<<
17700  * #Checking that meanvelocity is a vector
17701  *
17702  */
17703  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1039, __pyx_L1_error)
17704  __Pyx_GOTREF(__pyx_t_5);
17705  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1039, __pyx_L1_error)
17706  __Pyx_GOTREF(__pyx_t_6);
17707  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17708  __pyx_t_5 = NULL;
17709  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
17710  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
17711  if (likely(__pyx_t_5)) {
17712  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
17713  __Pyx_INCREF(__pyx_t_5);
17714  __Pyx_INCREF(function);
17715  __Pyx_DECREF_SET(__pyx_t_6, function);
17716  }
17717  }
17718  __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_meanVelocity) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_meanVelocity);
17719  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17720  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error)
17721  __Pyx_GOTREF(__pyx_t_8);
17722  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17723  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1039, __pyx_L1_error)
17724  __Pyx_GIVEREF(__pyx_t_8);
17725  __Pyx_GOTREF(__pyx_v_self->mV);
17726  __Pyx_DECREF(((PyObject *)__pyx_v_self->mV));
17727  __pyx_v_self->mV = ((PyArrayObject *)__pyx_t_8);
17728  __pyx_t_8 = 0;
17729 
17730  /* "WaveTools.py":1042
17731  * #Checking that meanvelocity is a vector
17732  *
17733  * if(len(meanVelocity) != 3): # <<<<<<<<<<<<<<
17734  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0)
17735  * sys.exit(1)
17736  */
17737  __pyx_t_15 = PyObject_Length(__pyx_v_meanVelocity); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1042, __pyx_L1_error)
17738  __pyx_t_3 = ((__pyx_t_15 != 3) != 0);
17739  if (__pyx_t_3) {
17740 
17741  /* "WaveTools.py":1043
17742  *
17743  * if(len(meanVelocity) != 3):
17744  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0) # <<<<<<<<<<<<<<
17745  * sys.exit(1)
17746  * if(self.Nf > 1000):
17747  */
17748  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1043, __pyx_L1_error)
17749  __Pyx_GOTREF(__pyx_t_8);
17750  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1043, __pyx_L1_error)
17751  __Pyx_GOTREF(__pyx_t_6);
17752  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 1043, __pyx_L1_error)
17753  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1043, __pyx_L1_error)
17754  __Pyx_GOTREF(__pyx_t_5);
17755  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17756  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17757  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17758 
17759  /* "WaveTools.py":1044
17760  * if(len(meanVelocity) != 3):
17761  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0)
17762  * sys.exit(1) # <<<<<<<<<<<<<<
17763  * if(self.Nf > 1000):
17764  * logEvent("ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ",level=0)
17765  */
17766  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1044, __pyx_L1_error)
17767  __Pyx_GOTREF(__pyx_t_6);
17768  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1044, __pyx_L1_error)
17769  __Pyx_GOTREF(__pyx_t_8);
17770  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17771  __pyx_t_6 = NULL;
17772  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
17773  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
17774  if (likely(__pyx_t_6)) {
17775  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
17776  __Pyx_INCREF(__pyx_t_6);
17777  __Pyx_INCREF(function);
17778  __Pyx_DECREF_SET(__pyx_t_8, function);
17779  }
17780  }
17781  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_1);
17782  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
17783  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1044, __pyx_L1_error)
17784  __Pyx_GOTREF(__pyx_t_5);
17785  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17786  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17787 
17788  /* "WaveTools.py":1042
17789  * #Checking that meanvelocity is a vector
17790  *
17791  * if(len(meanVelocity) != 3): # <<<<<<<<<<<<<<
17792  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0)
17793  * sys.exit(1)
17794  */
17795  }
17796 
17797  /* "WaveTools.py":1045
17798  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0)
17799  * sys.exit(1)
17800  * if(self.Nf > 1000): # <<<<<<<<<<<<<<
17801  * logEvent("ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ",level=0)
17802  * sys.exit(1)
17803  */
17804  __pyx_t_3 = ((__pyx_v_self->Nf > 0x3E8) != 0);
17805  if (__pyx_t_3) {
17806 
17807  /* "WaveTools.py":1046
17808  * sys.exit(1)
17809  * if(self.Nf > 1000):
17810  * logEvent("ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ",level=0) # <<<<<<<<<<<<<<
17811  * sys.exit(1)
17812  *
17813  */
17814  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1046, __pyx_L1_error)
17815  __Pyx_GOTREF(__pyx_t_5);
17816  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1046, __pyx_L1_error)
17817  __Pyx_GOTREF(__pyx_t_8);
17818  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 1046, __pyx_L1_error)
17819  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__19, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1046, __pyx_L1_error)
17820  __Pyx_GOTREF(__pyx_t_6);
17821  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17822  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17823  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17824 
17825  /* "WaveTools.py":1047
17826  * if(self.Nf > 1000):
17827  * logEvent("ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ",level=0)
17828  * sys.exit(1) # <<<<<<<<<<<<<<
17829  *
17830  * # C++ declarations
17831  */
17832  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sys); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1047, __pyx_L1_error)
17833  __Pyx_GOTREF(__pyx_t_8);
17834  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error)
17835  __Pyx_GOTREF(__pyx_t_5);
17836  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17837  __pyx_t_8 = NULL;
17838  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
17839  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
17840  if (likely(__pyx_t_8)) {
17841  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
17842  __Pyx_INCREF(__pyx_t_8);
17843  __Pyx_INCREF(function);
17844  __Pyx_DECREF_SET(__pyx_t_5, function);
17845  }
17846  }
17847  __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_1);
17848  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
17849  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
17850  __Pyx_GOTREF(__pyx_t_6);
17851  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17852  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17853 
17854  /* "WaveTools.py":1045
17855  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0)
17856  * sys.exit(1)
17857  * if(self.Nf > 1000): # <<<<<<<<<<<<<<
17858  * logEvent("ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ",level=0)
17859  * sys.exit(1)
17860  */
17861  }
17862 
17863  /* "WaveTools.py":1051
17864  * # C++ declarations
17865  *
17866  * self.tanhL =float(np.tanh(self.k*self.depth)) # <<<<<<<<<<<<<<
17867  * for ij in range(3):
17868  * self.kDir_c[ij] = self.kDir[ij]
17869  */
17870  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error)
17871  __Pyx_GOTREF(__pyx_t_5);
17872  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tanh); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1051, __pyx_L1_error)
17873  __Pyx_GOTREF(__pyx_t_8);
17874  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17875  __pyx_t_5 = PyFloat_FromDouble((__pyx_v_self->k * __pyx_v_self->depth)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1051, __pyx_L1_error)
17876  __Pyx_GOTREF(__pyx_t_5);
17877  __pyx_t_7 = NULL;
17878  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
17879  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
17880  if (likely(__pyx_t_7)) {
17881  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
17882  __Pyx_INCREF(__pyx_t_7);
17883  __Pyx_INCREF(function);
17884  __Pyx_DECREF_SET(__pyx_t_8, function);
17885  }
17886  }
17887  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5);
17888  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
17889  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17890  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1051, __pyx_L1_error)
17891  __Pyx_GOTREF(__pyx_t_6);
17892  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17893  __pyx_t_9 = __Pyx_PyObject_AsDouble(__pyx_t_6); if (unlikely(__pyx_t_9 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error)
17894  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17895  __pyx_v_self->tanhL = __pyx_t_9;
17896 
17897  /* "WaveTools.py":1052
17898  *
17899  * self.tanhL =float(np.tanh(self.k*self.depth))
17900  * for ij in range(3): # <<<<<<<<<<<<<<
17901  * self.kDir_c[ij] = self.kDir[ij]
17902  * self.waveDir_c[ij] = self.waveDir[ij]
17903  */
17904  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1052, __pyx_L1_error)
17905  __Pyx_GOTREF(__pyx_t_8);
17906  __pyx_t_5 = NULL;
17907  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
17908  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
17909  if (likely(__pyx_t_5)) {
17910  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
17911  __Pyx_INCREF(__pyx_t_5);
17912  __Pyx_INCREF(function);
17913  __Pyx_DECREF_SET(__pyx_t_8, function);
17914  }
17915  }
17916  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_5, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_int_3);
17917  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
17918  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1052, __pyx_L1_error)
17919  __Pyx_GOTREF(__pyx_t_6);
17920  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17921  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
17922  __pyx_t_8 = __pyx_t_6; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
17923  __pyx_t_16 = NULL;
17924  } else {
17925  __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1052, __pyx_L1_error)
17926  __Pyx_GOTREF(__pyx_t_8);
17927  __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1052, __pyx_L1_error)
17928  }
17929  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17930  for (;;) {
17931  if (likely(!__pyx_t_16)) {
17932  if (likely(PyList_CheckExact(__pyx_t_8))) {
17933  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
17934  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17935  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1052, __pyx_L1_error)
17936  #else
17937  __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1052, __pyx_L1_error)
17938  __Pyx_GOTREF(__pyx_t_6);
17939  #endif
17940  } else {
17941  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
17942  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17943  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1052, __pyx_L1_error)
17944  #else
17945  __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1052, __pyx_L1_error)
17946  __Pyx_GOTREF(__pyx_t_6);
17947  #endif
17948  }
17949  } else {
17950  __pyx_t_6 = __pyx_t_16(__pyx_t_8);
17951  if (unlikely(!__pyx_t_6)) {
17952  PyObject* exc_type = PyErr_Occurred();
17953  if (exc_type) {
17954  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
17955  else __PYX_ERR(0, 1052, __pyx_L1_error)
17956  }
17957  break;
17958  }
17959  __Pyx_GOTREF(__pyx_t_6);
17960  }
17961  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_6);
17962  __pyx_t_6 = 0;
17963 
17964  /* "WaveTools.py":1053
17965  * self.tanhL =float(np.tanh(self.k*self.depth))
17966  * for ij in range(3):
17967  * self.kDir_c[ij] = self.kDir[ij] # <<<<<<<<<<<<<<
17968  * self.waveDir_c[ij] = self.waveDir[ij]
17969  * self.vDir_c[ij] = self.vDir[ij]
17970  */
17971  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1053, __pyx_L1_error)
17972  __Pyx_GOTREF(__pyx_t_6);
17973  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1053, __pyx_L1_error)
17974  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17975  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1053, __pyx_L1_error)
17976  (__pyx_v_self->kDir_c[__pyx_t_18]) = __pyx_t_9;
17977 
17978  /* "WaveTools.py":1054
17979  * for ij in range(3):
17980  * self.kDir_c[ij] = self.kDir[ij]
17981  * self.waveDir_c[ij] = self.waveDir[ij] # <<<<<<<<<<<<<<
17982  * self.vDir_c[ij] = self.vDir[ij]
17983  * self.mV_c[ij] = self.mV[ij]
17984  */
17985  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDir), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1054, __pyx_L1_error)
17986  __Pyx_GOTREF(__pyx_t_6);
17987  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1054, __pyx_L1_error)
17988  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
17989  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1054, __pyx_L1_error)
17990  (__pyx_v_self->waveDir_c[__pyx_t_18]) = __pyx_t_9;
17991 
17992  /* "WaveTools.py":1055
17993  * self.kDir_c[ij] = self.kDir[ij]
17994  * self.waveDir_c[ij] = self.waveDir[ij]
17995  * self.vDir_c[ij] = self.vDir[ij] # <<<<<<<<<<<<<<
17996  * self.mV_c[ij] = self.mV[ij]
17997  * self.kDir_ = self.kDir_c
17998  */
17999  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->vDir), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1055, __pyx_L1_error)
18000  __Pyx_GOTREF(__pyx_t_6);
18001  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error)
18002  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18003  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L1_error)
18004  (__pyx_v_self->vDir_c[__pyx_t_18]) = __pyx_t_9;
18005 
18006  /* "WaveTools.py":1056
18007  * self.waveDir_c[ij] = self.waveDir[ij]
18008  * self.vDir_c[ij] = self.vDir[ij]
18009  * self.mV_c[ij] = self.mV[ij] # <<<<<<<<<<<<<<
18010  * self.kDir_ = self.kDir_c
18011  * self.waveDir_ = self.waveDir_c
18012  */
18013  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->mV), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1056, __pyx_L1_error)
18014  __Pyx_GOTREF(__pyx_t_6);
18015  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L1_error)
18016  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18017  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1056, __pyx_L1_error)
18018  (__pyx_v_self->mV_c[__pyx_t_18]) = __pyx_t_9;
18019 
18020  /* "WaveTools.py":1052
18021  *
18022  * self.tanhL =float(np.tanh(self.k*self.depth))
18023  * for ij in range(3): # <<<<<<<<<<<<<<
18024  * self.kDir_c[ij] = self.kDir[ij]
18025  * self.waveDir_c[ij] = self.waveDir[ij]
18026  */
18027  }
18028  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18029 
18030  /* "WaveTools.py":1057
18031  * self.vDir_c[ij] = self.vDir[ij]
18032  * self.mV_c[ij] = self.mV[ij]
18033  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
18034  * self.waveDir_ = self.waveDir_c
18035  * self.vDir_ = self.vDir_c
18036  */
18037  __pyx_t_19 = __pyx_v_self->kDir_c;
18038  __pyx_v_self->kDir_ = __pyx_t_19;
18039 
18040  /* "WaveTools.py":1058
18041  * self.mV_c[ij] = self.mV[ij]
18042  * self.kDir_ = self.kDir_c
18043  * self.waveDir_ = self.waveDir_c # <<<<<<<<<<<<<<
18044  * self.vDir_ = self.vDir_c
18045  * self.mV_ = self.mV_c
18046  */
18047  __pyx_t_19 = __pyx_v_self->waveDir_c;
18048  __pyx_v_self->waveDir_ = __pyx_t_19;
18049 
18050  /* "WaveTools.py":1059
18051  * self.kDir_ = self.kDir_c
18052  * self.waveDir_ = self.waveDir_c
18053  * self.vDir_ = self.vDir_c # <<<<<<<<<<<<<<
18054  * self.mV_ = self.mV_c
18055  *
18056  */
18057  __pyx_t_19 = __pyx_v_self->vDir_c;
18058  __pyx_v_self->vDir_ = __pyx_t_19;
18059 
18060  /* "WaveTools.py":1060
18061  * self.waveDir_ = self.waveDir_c
18062  * self.vDir_ = self.vDir_c
18063  * self.mV_ = self.mV_c # <<<<<<<<<<<<<<
18064  *
18065  *
18066  */
18067  __pyx_t_19 = __pyx_v_self->mV_c;
18068  __pyx_v_self->mV_ = __pyx_t_19;
18069 
18070  /* "WaveTools.py":1065
18071  *
18072  *
18073  * if "Fenton" in self.waveType: # <<<<<<<<<<<<<<
18074  * for ij in range(Nf):
18075  * self.Ycoeff_c[ij] = self.Ycoeff[ij]
18076  */
18077  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_Fenton, __pyx_v_self->waveType, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1065, __pyx_L1_error)
18078  __pyx_t_4 = (__pyx_t_3 != 0);
18079  if (__pyx_t_4) {
18080 
18081  /* "WaveTools.py":1066
18082  *
18083  * if "Fenton" in self.waveType:
18084  * for ij in range(Nf): # <<<<<<<<<<<<<<
18085  * self.Ycoeff_c[ij] = self.Ycoeff[ij]
18086  * self.Bcoeff_c[ij] = self.Bcoeff[ij]
18087  */
18088  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18089  __Pyx_GOTREF(__pyx_t_6);
18090  __pyx_t_5 = NULL;
18091  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
18092  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
18093  if (likely(__pyx_t_5)) {
18094  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18095  __Pyx_INCREF(__pyx_t_5);
18096  __Pyx_INCREF(function);
18097  __Pyx_DECREF_SET(__pyx_t_6, function);
18098  }
18099  }
18100  __pyx_t_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_Nf) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_Nf);
18101  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
18102  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1066, __pyx_L1_error)
18103  __Pyx_GOTREF(__pyx_t_8);
18104  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18105  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
18106  __pyx_t_6 = __pyx_t_8; __Pyx_INCREF(__pyx_t_6); __pyx_t_15 = 0;
18107  __pyx_t_16 = NULL;
18108  } else {
18109  __pyx_t_15 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1066, __pyx_L1_error)
18110  __Pyx_GOTREF(__pyx_t_6);
18111  __pyx_t_16 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1066, __pyx_L1_error)
18112  }
18113  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18114  for (;;) {
18115  if (likely(!__pyx_t_16)) {
18116  if (likely(PyList_CheckExact(__pyx_t_6))) {
18117  if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_6)) break;
18118  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18119  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
18120  #else
18121  __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1066, __pyx_L1_error)
18122  __Pyx_GOTREF(__pyx_t_8);
18123  #endif
18124  } else {
18125  if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
18126  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18127  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_15); __Pyx_INCREF(__pyx_t_8); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 1066, __pyx_L1_error)
18128  #else
18129  __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1066, __pyx_L1_error)
18130  __Pyx_GOTREF(__pyx_t_8);
18131  #endif
18132  }
18133  } else {
18134  __pyx_t_8 = __pyx_t_16(__pyx_t_6);
18135  if (unlikely(!__pyx_t_8)) {
18136  PyObject* exc_type = PyErr_Occurred();
18137  if (exc_type) {
18138  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18139  else __PYX_ERR(0, 1066, __pyx_L1_error)
18140  }
18141  break;
18142  }
18143  __Pyx_GOTREF(__pyx_t_8);
18144  }
18145  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_8);
18146  __pyx_t_8 = 0;
18147 
18148  /* "WaveTools.py":1067
18149  * if "Fenton" in self.waveType:
18150  * for ij in range(Nf):
18151  * self.Ycoeff_c[ij] = self.Ycoeff[ij] # <<<<<<<<<<<<<<
18152  * self.Bcoeff_c[ij] = self.Bcoeff[ij]
18153  * self.tanh_c[ij] = self.tanhF[ij]
18154  */
18155  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Ycoeff), __pyx_v_ij); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1067, __pyx_L1_error)
18156  __Pyx_GOTREF(__pyx_t_8);
18157  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1067, __pyx_L1_error)
18158  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18159  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1067, __pyx_L1_error)
18160  (__pyx_v_self->Ycoeff_c[__pyx_t_18]) = __pyx_t_9;
18161 
18162  /* "WaveTools.py":1068
18163  * for ij in range(Nf):
18164  * self.Ycoeff_c[ij] = self.Ycoeff[ij]
18165  * self.Bcoeff_c[ij] = self.Bcoeff[ij] # <<<<<<<<<<<<<<
18166  * self.tanh_c[ij] = self.tanhF[ij]
18167  * self.Ycoeff_ = self.Ycoeff_c
18168  */
18169  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Bcoeff), __pyx_v_ij); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1068, __pyx_L1_error)
18170  __Pyx_GOTREF(__pyx_t_8);
18171  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error)
18172  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18173  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error)
18174  (__pyx_v_self->Bcoeff_c[__pyx_t_18]) = __pyx_t_9;
18175 
18176  /* "WaveTools.py":1069
18177  * self.Ycoeff_c[ij] = self.Ycoeff[ij]
18178  * self.Bcoeff_c[ij] = self.Bcoeff[ij]
18179  * self.tanh_c[ij] = self.tanhF[ij] # <<<<<<<<<<<<<<
18180  * self.Ycoeff_ = self.Ycoeff_c
18181  * self.Bcoeff_ = self.Bcoeff_c
18182  */
18183  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->tanhF), __pyx_v_ij); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1069, __pyx_L1_error)
18184  __Pyx_GOTREF(__pyx_t_8);
18185  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L1_error)
18186  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18187  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1069, __pyx_L1_error)
18188  (__pyx_v_self->tanh_c[__pyx_t_18]) = __pyx_t_9;
18189 
18190  /* "WaveTools.py":1066
18191  *
18192  * if "Fenton" in self.waveType:
18193  * for ij in range(Nf): # <<<<<<<<<<<<<<
18194  * self.Ycoeff_c[ij] = self.Ycoeff[ij]
18195  * self.Bcoeff_c[ij] = self.Bcoeff[ij]
18196  */
18197  }
18198  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18199 
18200  /* "WaveTools.py":1070
18201  * self.Bcoeff_c[ij] = self.Bcoeff[ij]
18202  * self.tanh_c[ij] = self.tanhF[ij]
18203  * self.Ycoeff_ = self.Ycoeff_c # <<<<<<<<<<<<<<
18204  * self.Bcoeff_ = self.Bcoeff_c
18205  * self.tanhF_ = self.tanh_c
18206  */
18207  __pyx_t_19 = __pyx_v_self->Ycoeff_c;
18208  __pyx_v_self->Ycoeff_ = __pyx_t_19;
18209 
18210  /* "WaveTools.py":1071
18211  * self.tanh_c[ij] = self.tanhF[ij]
18212  * self.Ycoeff_ = self.Ycoeff_c
18213  * self.Bcoeff_ = self.Bcoeff_c # <<<<<<<<<<<<<<
18214  * self.tanhF_ = self.tanh_c
18215  *
18216  */
18217  __pyx_t_19 = __pyx_v_self->Bcoeff_c;
18218  __pyx_v_self->Bcoeff_ = __pyx_t_19;
18219 
18220  /* "WaveTools.py":1072
18221  * self.Ycoeff_ = self.Ycoeff_c
18222  * self.Bcoeff_ = self.Bcoeff_c
18223  * self.tanhF_ = self.tanh_c # <<<<<<<<<<<<<<
18224  *
18225  *
18226  */
18227  __pyx_t_19 = __pyx_v_self->tanh_c;
18228  __pyx_v_self->tanhF_ = __pyx_t_19;
18229 
18230  /* "WaveTools.py":1065
18231  *
18232  *
18233  * if "Fenton" in self.waveType: # <<<<<<<<<<<<<<
18234  * for ij in range(Nf):
18235  * self.Ycoeff_c[ij] = self.Ycoeff[ij]
18236  */
18237  }
18238 
18239  /* "WaveTools.py":1079
18240  *
18241  *
18242  * if self.waveType == "Linear": # <<<<<<<<<<<<<<
18243  * self._cpp_eta = self.etaLinear
18244  * self._cpp_u = self.uLinear
18245  */
18246  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_self->waveType, __pyx_n_s_Linear, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1079, __pyx_L1_error)
18247  if (__pyx_t_4) {
18248 
18249  /* "WaveTools.py":1080
18250  *
18251  * if self.waveType == "Linear":
18252  * self._cpp_eta = self.etaLinear # <<<<<<<<<<<<<<
18253  * self._cpp_u = self.uLinear
18254  * else:
18255  */
18256  __pyx_t_20 = ((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->etaLinear;
18257  __pyx_v_self->_cpp_eta = __pyx_t_20;
18258 
18259  /* "WaveTools.py":1081
18260  * if self.waveType == "Linear":
18261  * self._cpp_eta = self.etaLinear
18262  * self._cpp_u = self.uLinear # <<<<<<<<<<<<<<
18263  * else:
18264  * self._cpp_eta = self.etaFenton
18265  */
18266  __pyx_t_21 = ((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->uLinear;
18267  __pyx_v_self->_cpp_u = __pyx_t_21;
18268 
18269  /* "WaveTools.py":1079
18270  *
18271  *
18272  * if self.waveType == "Linear": # <<<<<<<<<<<<<<
18273  * self._cpp_eta = self.etaLinear
18274  * self._cpp_u = self.uLinear
18275  */
18276  goto __pyx_L34;
18277  }
18278 
18279  /* "WaveTools.py":1083
18280  * self._cpp_u = self.uLinear
18281  * else:
18282  * self._cpp_eta = self.etaFenton # <<<<<<<<<<<<<<
18283  * self._cpp_u = self.uFenton
18284  *
18285  */
18286  /*else*/ {
18287  __pyx_t_22 = ((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->etaFenton;
18288  __pyx_v_self->_cpp_eta = __pyx_t_22;
18289 
18290  /* "WaveTools.py":1084
18291  * else:
18292  * self._cpp_eta = self.etaFenton
18293  * self._cpp_u = self.uFenton # <<<<<<<<<<<<<<
18294  *
18295  *
18296  */
18297  __pyx_t_23 = ((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->uFenton;
18298  __pyx_v_self->_cpp_u = __pyx_t_23;
18299  }
18300  __pyx_L34:;
18301 
18302  /* "WaveTools.py":940
18303  *
18304  * """
18305  * def __init__(self, # <<<<<<<<<<<<<<
18306  * period,
18307  * waveHeight,
18308  */
18309 
18310  /* function exit code */
18311  __pyx_r = 0;
18312  goto __pyx_L0;
18313  __pyx_L1_error:;
18314  __Pyx_XDECREF(__pyx_t_2);
18315  __Pyx_XDECREF(__pyx_t_5);
18316  __Pyx_XDECREF(__pyx_t_6);
18317  __Pyx_XDECREF(__pyx_t_7);
18318  __Pyx_XDECREF(__pyx_t_8);
18319  __Pyx_XDECREF(__pyx_t_14);
18320  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
18321  __pyx_r = -1;
18322  __pyx_L0:;
18323  __Pyx_XDECREF(__pyx_v_knownWaveTypes);
18324  __Pyx_XDECREF(__pyx_v_ii);
18325  __Pyx_XDECREF(__pyx_v_kk);
18326  __Pyx_XDECREF(__pyx_v_Fenton);
18327  __Pyx_XDECREF(__pyx_v_comm);
18328  __Pyx_XDECREF(__pyx_v_ij);
18329  __Pyx_XDECREF(__pyx_v_autoFentonOpts);
18330  __Pyx_RefNannyFinishContext();
18331  return __pyx_r;
18332 }
18333 
18334 /* "WaveTools.py":1087
18335  *
18336  *
18337  * def etaLinear(self, x, t): # <<<<<<<<<<<<<<
18338  *
18339  * return __cpp_eta_mode(x ,t, self.kDir_,self.omega,self.phi0,self.amplitude, self.fast)
18340  */
18341 
18342 static double __pyx_f_9WaveTools_18MonochromaticWaves_etaLinear(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
18343  double __pyx_r;
18344  __Pyx_RefNannyDeclarations
18345  __Pyx_RefNannySetupContext("etaLinear", 0);
18346 
18347  /* "WaveTools.py":1089
18348  * def etaLinear(self, x, t):
18349  *
18350  * return __cpp_eta_mode(x ,t, self.kDir_,self.omega,self.phi0,self.amplitude, self.fast) # <<<<<<<<<<<<<<
18351  *
18352  * def etaFenton(self, x, t):
18353  */
18354  __pyx_r = proteus::__cpp_eta_mode(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->omega, __pyx_v_self->phi0, __pyx_v_self->amplitude, __pyx_v_self->fast);
18355  goto __pyx_L0;
18356 
18357  /* "WaveTools.py":1087
18358  *
18359  *
18360  * def etaLinear(self, x, t): # <<<<<<<<<<<<<<
18361  *
18362  * return __cpp_eta_mode(x ,t, self.kDir_,self.omega,self.phi0,self.amplitude, self.fast)
18363  */
18364 
18365  /* function exit code */
18366  __pyx_L0:;
18367  __Pyx_RefNannyFinishContext();
18368  return __pyx_r;
18369 }
18370 
18371 /* "WaveTools.py":1091
18372  * return __cpp_eta_mode(x ,t, self.kDir_,self.omega,self.phi0,self.amplitude, self.fast)
18373  *
18374  * def etaFenton(self, x, t): # <<<<<<<<<<<<<<
18375  *
18376  * return __cpp_etaFenton(x,t,self.kDir_, self.k, self.omega,self.phi0,self.amplitude, self.Nf, self.Ycoeff_, self.fast)
18377  */
18378 
18379 static double __pyx_f_9WaveTools_18MonochromaticWaves_etaFenton(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
18380  double __pyx_r;
18381  __Pyx_RefNannyDeclarations
18382  __Pyx_RefNannySetupContext("etaFenton", 0);
18383 
18384  /* "WaveTools.py":1093
18385  * def etaFenton(self, x, t):
18386  *
18387  * return __cpp_etaFenton(x,t,self.kDir_, self.k, self.omega,self.phi0,self.amplitude, self.Nf, self.Ycoeff_, self.fast) # <<<<<<<<<<<<<<
18388  *
18389  *
18390  */
18391  __pyx_r = proteus::__cpp_etaFenton(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->k, __pyx_v_self->omega, __pyx_v_self->phi0, __pyx_v_self->amplitude, __pyx_v_self->Nf, __pyx_v_self->Ycoeff_, __pyx_v_self->fast);
18392  goto __pyx_L0;
18393 
18394  /* "WaveTools.py":1091
18395  * return __cpp_eta_mode(x ,t, self.kDir_,self.omega,self.phi0,self.amplitude, self.fast)
18396  *
18397  * def etaFenton(self, x, t): # <<<<<<<<<<<<<<
18398  *
18399  * return __cpp_etaFenton(x,t,self.kDir_, self.k, self.omega,self.phi0,self.amplitude, self.Nf, self.Ycoeff_, self.fast)
18400  */
18401 
18402  /* function exit code */
18403  __pyx_L0:;
18404  __Pyx_RefNannyFinishContext();
18405  return __pyx_r;
18406 }
18407 
18408 /* "WaveTools.py":1096
18409  *
18410  *
18411  * def uLinear(self, U, x, t): # <<<<<<<<<<<<<<
18412  * __cpp_vel_mode_p(U, x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl,self.depth,self.waveDir_,self.vDir_, self.tanhL, self.gAbs, self.fast)
18413  *
18414  */
18415 
18416 static void __pyx_f_9WaveTools_18MonochromaticWaves_uLinear(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
18417  __Pyx_RefNannyDeclarations
18418  __Pyx_RefNannySetupContext("uLinear", 0);
18419 
18420  /* "WaveTools.py":1097
18421  *
18422  * def uLinear(self, U, x, t):
18423  * __cpp_vel_mode_p(U, x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl,self.depth,self.waveDir_,self.vDir_, self.tanhL, self.gAbs, self.fast) # <<<<<<<<<<<<<<
18424  *
18425  * def uFenton(self, U, x, t):
18426  */
18427  proteus::__cpp_vel_mode_p(__pyx_v_U, __pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->k, __pyx_v_self->omega, __pyx_v_self->phi0, __pyx_v_self->amplitude, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanhL, __pyx_v_self->gAbs, __pyx_v_self->fast);
18428 
18429  /* "WaveTools.py":1096
18430  *
18431  *
18432  * def uLinear(self, U, x, t): # <<<<<<<<<<<<<<
18433  * __cpp_vel_mode_p(U, x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl,self.depth,self.waveDir_,self.vDir_, self.tanhL, self.gAbs, self.fast)
18434  *
18435  */
18436 
18437  /* function exit code */
18438  __Pyx_RefNannyFinishContext();
18439 }
18440 
18441 /* "WaveTools.py":1099
18442  * __cpp_vel_mode_p(U, x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl,self.depth,self.waveDir_,self.vDir_, self.tanhL, self.gAbs, self.fast)
18443  *
18444  * def uFenton(self, U, x, t): # <<<<<<<<<<<<<<
18445  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast)
18446  *
18447  */
18448 
18449 static void __pyx_f_9WaveTools_18MonochromaticWaves_uFenton(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
18450  __Pyx_RefNannyDeclarations
18451  __Pyx_RefNannySetupContext("uFenton", 0);
18452 
18453  /* "WaveTools.py":1100
18454  *
18455  * def uFenton(self, U, x, t):
18456  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast) # <<<<<<<<<<<<<<
18457  *
18458  * def eta(self,x,t):
18459  */
18460  proteus::__cpp_uFenton(__pyx_v_U, __pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->k, __pyx_v_self->omega, __pyx_v_self->phi0, __pyx_v_self->amplitude, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->gAbs, __pyx_v_self->Nf, __pyx_v_self->Bcoeff_, __pyx_v_self->mV_, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanhF_, __pyx_v_self->fast);
18461 
18462  /* "WaveTools.py":1099
18463  * __cpp_vel_mode_p(U, x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl,self.depth,self.waveDir_,self.vDir_, self.tanhL, self.gAbs, self.fast)
18464  *
18465  * def uFenton(self, U, x, t): # <<<<<<<<<<<<<<
18466  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast)
18467  *
18468  */
18469 
18470  /* function exit code */
18471  __Pyx_RefNannyFinishContext();
18472 }
18473 
18474 /* "WaveTools.py":1102
18475  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast)
18476  *
18477  * def eta(self,x,t): # <<<<<<<<<<<<<<
18478  * """Calculates free surface elevation (MonochromaticWaves class)
18479  * Parameters
18480  */
18481 
18482 /* Python wrapper */
18483 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18484 static char __pyx_doc_9WaveTools_18MonochromaticWaves_2eta[] = "Calculates free surface elevation (MonochromaticWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
18485 static PyMethodDef __pyx_mdef_9WaveTools_18MonochromaticWaves_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_18MonochromaticWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_18MonochromaticWaves_2eta};
18486 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18487  PyObject *__pyx_v_x = 0;
18488  PyObject *__pyx_v_t = 0;
18489  PyObject *__pyx_r = 0;
18490  __Pyx_RefNannyDeclarations
18491  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
18492  {
18493  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
18494  PyObject* values[2] = {0,0};
18495  if (unlikely(__pyx_kwds)) {
18496  Py_ssize_t kw_args;
18497  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18498  switch (pos_args) {
18499  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18500  CYTHON_FALLTHROUGH;
18501  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18502  CYTHON_FALLTHROUGH;
18503  case 0: break;
18504  default: goto __pyx_L5_argtuple_error;
18505  }
18506  kw_args = PyDict_Size(__pyx_kwds);
18507  switch (pos_args) {
18508  case 0:
18509  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18510  else goto __pyx_L5_argtuple_error;
18511  CYTHON_FALLTHROUGH;
18512  case 1:
18513  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18514  else {
18515  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 1102, __pyx_L3_error)
18516  }
18517  }
18518  if (unlikely(kw_args > 0)) {
18519  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 1102, __pyx_L3_error)
18520  }
18521  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18522  goto __pyx_L5_argtuple_error;
18523  } else {
18524  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18525  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18526  }
18527  __pyx_v_x = values[0];
18528  __pyx_v_t = values[1];
18529  }
18530  goto __pyx_L4_argument_unpacking_done;
18531  __pyx_L5_argtuple_error:;
18532  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1102, __pyx_L3_error)
18533  __pyx_L3_error:;
18534  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
18535  __Pyx_RefNannyFinishContext();
18536  return NULL;
18537  __pyx_L4_argument_unpacking_done:;
18538  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_2eta(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
18539 
18540  /* function exit code */
18541  __Pyx_RefNannyFinishContext();
18542  return __pyx_r;
18543 }
18544 
18545 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_2eta(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
18546  double __pyx_v_xx[3];
18547  PyObject *__pyx_r = NULL;
18548  __Pyx_RefNannyDeclarations
18549  PyObject *__pyx_t_1 = NULL;
18550  double __pyx_t_2;
18551  int __pyx_t_3;
18552  __Pyx_RefNannySetupContext("eta", 0);
18553 
18554  /* "WaveTools.py":1118
18555  * """
18556  * cython.declare(xx=cython.double[3])
18557  * xx[0] = x[0] # <<<<<<<<<<<<<<
18558  * xx[1] = x[1]
18559  * xx[2] = x[2]
18560  */
18561  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
18562  __Pyx_GOTREF(__pyx_t_1);
18563  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L1_error)
18564  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18565  (__pyx_v_xx[0]) = __pyx_t_2;
18566 
18567  /* "WaveTools.py":1119
18568  * cython.declare(xx=cython.double[3])
18569  * xx[0] = x[0]
18570  * xx[1] = x[1] # <<<<<<<<<<<<<<
18571  * xx[2] = x[2]
18572  * if self.waveType =="Linear":
18573  */
18574  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1119, __pyx_L1_error)
18575  __Pyx_GOTREF(__pyx_t_1);
18576  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1119, __pyx_L1_error)
18577  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18578  (__pyx_v_xx[1]) = __pyx_t_2;
18579 
18580  /* "WaveTools.py":1120
18581  * xx[0] = x[0]
18582  * xx[1] = x[1]
18583  * xx[2] = x[2] # <<<<<<<<<<<<<<
18584  * if self.waveType =="Linear":
18585  * return self.etaLinear(xx,t)
18586  */
18587  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
18588  __Pyx_GOTREF(__pyx_t_1);
18589  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1120, __pyx_L1_error)
18590  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18591  (__pyx_v_xx[2]) = __pyx_t_2;
18592 
18593  /* "WaveTools.py":1121
18594  * xx[1] = x[1]
18595  * xx[2] = x[2]
18596  * if self.waveType =="Linear": # <<<<<<<<<<<<<<
18597  * return self.etaLinear(xx,t)
18598  * else:
18599  */
18600  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_self->waveType, __pyx_n_s_Linear, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1121, __pyx_L1_error)
18601  if (__pyx_t_3) {
18602 
18603  /* "WaveTools.py":1122
18604  * xx[2] = x[2]
18605  * if self.waveType =="Linear":
18606  * return self.etaLinear(xx,t) # <<<<<<<<<<<<<<
18607  * else:
18608  * return self.etaFenton(xx,t)
18609  */
18610  __Pyx_XDECREF(__pyx_r);
18611  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error)
18612  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->etaLinear(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
18613  __Pyx_GOTREF(__pyx_t_1);
18614  __pyx_r = __pyx_t_1;
18615  __pyx_t_1 = 0;
18616  goto __pyx_L0;
18617 
18618  /* "WaveTools.py":1121
18619  * xx[1] = x[1]
18620  * xx[2] = x[2]
18621  * if self.waveType =="Linear": # <<<<<<<<<<<<<<
18622  * return self.etaLinear(xx,t)
18623  * else:
18624  */
18625  }
18626 
18627  /* "WaveTools.py":1124
18628  * return self.etaLinear(xx,t)
18629  * else:
18630  * return self.etaFenton(xx,t) # <<<<<<<<<<<<<<
18631  *
18632  * def u(self,x,t):
18633  */
18634  /*else*/ {
18635  __Pyx_XDECREF(__pyx_r);
18636  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L1_error)
18637  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->etaFenton(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error)
18638  __Pyx_GOTREF(__pyx_t_1);
18639  __pyx_r = __pyx_t_1;
18640  __pyx_t_1 = 0;
18641  goto __pyx_L0;
18642  }
18643 
18644  /* "WaveTools.py":1102
18645  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast)
18646  *
18647  * def eta(self,x,t): # <<<<<<<<<<<<<<
18648  * """Calculates free surface elevation (MonochromaticWaves class)
18649  * Parameters
18650  */
18651 
18652  /* function exit code */
18653  __pyx_L1_error:;
18654  __Pyx_XDECREF(__pyx_t_1);
18655  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
18656  __pyx_r = NULL;
18657  __pyx_L0:;
18658  __Pyx_XGIVEREF(__pyx_r);
18659  __Pyx_RefNannyFinishContext();
18660  return __pyx_r;
18661 }
18662 
18663 /* "WaveTools.py":1126
18664  * return self.etaFenton(xx,t)
18665  *
18666  * def u(self,x,t): # <<<<<<<<<<<<<<
18667  * """Calculates wave velocity vector (MonochromaticWaves class).
18668  * Parameters
18669  */
18670 
18671 /* Python wrapper */
18672 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
18673 static char __pyx_doc_9WaveTools_18MonochromaticWaves_4u[] = "Calculates wave velocity vector (MonochromaticWaves class).\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
18674 static PyMethodDef __pyx_mdef_9WaveTools_18MonochromaticWaves_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_18MonochromaticWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_18MonochromaticWaves_4u};
18675 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18676  PyObject *__pyx_v_x = 0;
18677  PyObject *__pyx_v_t = 0;
18678  PyObject *__pyx_r = 0;
18679  __Pyx_RefNannyDeclarations
18680  __Pyx_RefNannySetupContext("u (wrapper)", 0);
18681  {
18682  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
18683  PyObject* values[2] = {0,0};
18684  if (unlikely(__pyx_kwds)) {
18685  Py_ssize_t kw_args;
18686  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18687  switch (pos_args) {
18688  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18689  CYTHON_FALLTHROUGH;
18690  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18691  CYTHON_FALLTHROUGH;
18692  case 0: break;
18693  default: goto __pyx_L5_argtuple_error;
18694  }
18695  kw_args = PyDict_Size(__pyx_kwds);
18696  switch (pos_args) {
18697  case 0:
18698  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18699  else goto __pyx_L5_argtuple_error;
18700  CYTHON_FALLTHROUGH;
18701  case 1:
18702  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18703  else {
18704  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 1126, __pyx_L3_error)
18705  }
18706  }
18707  if (unlikely(kw_args > 0)) {
18708  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 1126, __pyx_L3_error)
18709  }
18710  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
18711  goto __pyx_L5_argtuple_error;
18712  } else {
18713  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18714  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18715  }
18716  __pyx_v_x = values[0];
18717  __pyx_v_t = values[1];
18718  }
18719  goto __pyx_L4_argument_unpacking_done;
18720  __pyx_L5_argtuple_error:;
18721  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1126, __pyx_L3_error)
18722  __pyx_L3_error:;
18723  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
18724  __Pyx_RefNannyFinishContext();
18725  return NULL;
18726  __pyx_L4_argument_unpacking_done:;
18727  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_4u(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
18728 
18729  /* function exit code */
18730  __Pyx_RefNannyFinishContext();
18731  return __pyx_r;
18732 }
18733 
18734 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_4u(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
18735  double __pyx_v_xx[3];
18736  double __pyx_v_cppU[3];
18737  PyObject *__pyx_v_ii = NULL;
18738  PyObject *__pyx_v_U = NULL;
18739  PyObject *__pyx_r = NULL;
18740  __Pyx_RefNannyDeclarations
18741  PyObject *__pyx_t_1 = NULL;
18742  PyObject *__pyx_t_2 = NULL;
18743  PyObject *__pyx_t_3 = NULL;
18744  Py_ssize_t __pyx_t_4;
18745  PyObject *(*__pyx_t_5)(PyObject *);
18746  double __pyx_t_6;
18747  Py_ssize_t __pyx_t_7;
18748  int __pyx_t_8;
18749  __Pyx_RefNannySetupContext("u", 0);
18750 
18751  /* "WaveTools.py":1143
18752  * cython.declare(xx=cython.double[3])
18753  * cython.declare(cppU=cython.double[3])
18754  * for ii in range(3): # <<<<<<<<<<<<<<
18755  * xx[ii] = x[ii]
18756  * cppU[ii] = 0.
18757  */
18758  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
18759  __Pyx_GOTREF(__pyx_t_2);
18760  __pyx_t_3 = NULL;
18761  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
18762  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
18763  if (likely(__pyx_t_3)) {
18764  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
18765  __Pyx_INCREF(__pyx_t_3);
18766  __Pyx_INCREF(function);
18767  __Pyx_DECREF_SET(__pyx_t_2, function);
18768  }
18769  }
18770  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
18771  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
18772  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
18773  __Pyx_GOTREF(__pyx_t_1);
18774  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18775  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
18776  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
18777  __pyx_t_5 = NULL;
18778  } else {
18779  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1143, __pyx_L1_error)
18780  __Pyx_GOTREF(__pyx_t_2);
18781  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1143, __pyx_L1_error)
18782  }
18783  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18784  for (;;) {
18785  if (likely(!__pyx_t_5)) {
18786  if (likely(PyList_CheckExact(__pyx_t_2))) {
18787  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18788  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18789  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1143, __pyx_L1_error)
18790  #else
18791  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
18792  __Pyx_GOTREF(__pyx_t_1);
18793  #endif
18794  } else {
18795  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18796  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
18797  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1143, __pyx_L1_error)
18798  #else
18799  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error)
18800  __Pyx_GOTREF(__pyx_t_1);
18801  #endif
18802  }
18803  } else {
18804  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
18805  if (unlikely(!__pyx_t_1)) {
18806  PyObject* exc_type = PyErr_Occurred();
18807  if (exc_type) {
18808  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
18809  else __PYX_ERR(0, 1143, __pyx_L1_error)
18810  }
18811  break;
18812  }
18813  __Pyx_GOTREF(__pyx_t_1);
18814  }
18815  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
18816  __pyx_t_1 = 0;
18817 
18818  /* "WaveTools.py":1144
18819  * cython.declare(cppU=cython.double[3])
18820  * for ii in range(3):
18821  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
18822  * cppU[ii] = 0.
18823  *
18824  */
18825  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error)
18826  __Pyx_GOTREF(__pyx_t_1);
18827  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L1_error)
18828  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18829  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L1_error)
18830  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
18831 
18832  /* "WaveTools.py":1145
18833  * for ii in range(3):
18834  * xx[ii] = x[ii]
18835  * cppU[ii] = 0. # <<<<<<<<<<<<<<
18836  *
18837  *
18838  */
18839  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1145, __pyx_L1_error)
18840  (__pyx_v_cppU[__pyx_t_7]) = 0.;
18841 
18842  /* "WaveTools.py":1143
18843  * cython.declare(xx=cython.double[3])
18844  * cython.declare(cppU=cython.double[3])
18845  * for ii in range(3): # <<<<<<<<<<<<<<
18846  * xx[ii] = x[ii]
18847  * cppU[ii] = 0.
18848  */
18849  }
18850  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18851 
18852  /* "WaveTools.py":1148
18853  *
18854  *
18855  * U = np.zeros(3,) # <<<<<<<<<<<<<<
18856  * if self.waveType =="Linear":
18857  * self.uLinear(cppU,xx,t)
18858  */
18859  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1148, __pyx_L1_error)
18860  __Pyx_GOTREF(__pyx_t_1);
18861  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error)
18862  __Pyx_GOTREF(__pyx_t_3);
18863  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18864  __pyx_t_1 = NULL;
18865  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18866  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
18867  if (likely(__pyx_t_1)) {
18868  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18869  __Pyx_INCREF(__pyx_t_1);
18870  __Pyx_INCREF(function);
18871  __Pyx_DECREF_SET(__pyx_t_3, function);
18872  }
18873  }
18874  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
18875  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
18876  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error)
18877  __Pyx_GOTREF(__pyx_t_2);
18878  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18879  __pyx_v_U = __pyx_t_2;
18880  __pyx_t_2 = 0;
18881 
18882  /* "WaveTools.py":1149
18883  *
18884  * U = np.zeros(3,)
18885  * if self.waveType =="Linear": # <<<<<<<<<<<<<<
18886  * self.uLinear(cppU,xx,t)
18887  * U[0] = cppU[0]
18888  */
18889  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_self->waveType, __pyx_n_s_Linear, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1149, __pyx_L1_error)
18890  if (__pyx_t_8) {
18891 
18892  /* "WaveTools.py":1150
18893  * U = np.zeros(3,)
18894  * if self.waveType =="Linear":
18895  * self.uLinear(cppU,xx,t) # <<<<<<<<<<<<<<
18896  * U[0] = cppU[0]
18897  * U[1] = cppU[1]
18898  */
18899  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1150, __pyx_L1_error)
18900  ((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->uLinear(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
18901 
18902  /* "WaveTools.py":1151
18903  * if self.waveType =="Linear":
18904  * self.uLinear(cppU,xx,t)
18905  * U[0] = cppU[0] # <<<<<<<<<<<<<<
18906  * U[1] = cppU[1]
18907  * U[2] = cppU[2]
18908  */
18909  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L1_error)
18910  __Pyx_GOTREF(__pyx_t_2);
18911  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1151, __pyx_L1_error)
18912  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18913 
18914  /* "WaveTools.py":1152
18915  * self.uLinear(cppU,xx,t)
18916  * U[0] = cppU[0]
18917  * U[1] = cppU[1] # <<<<<<<<<<<<<<
18918  * U[2] = cppU[2]
18919  * else:
18920  */
18921  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
18922  __Pyx_GOTREF(__pyx_t_2);
18923  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1152, __pyx_L1_error)
18924  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18925 
18926  /* "WaveTools.py":1153
18927  * U[0] = cppU[0]
18928  * U[1] = cppU[1]
18929  * U[2] = cppU[2] # <<<<<<<<<<<<<<
18930  * else:
18931  * self.uFenton(cppU,xx,t)
18932  */
18933  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
18934  __Pyx_GOTREF(__pyx_t_2);
18935  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1153, __pyx_L1_error)
18936  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18937 
18938  /* "WaveTools.py":1149
18939  *
18940  * U = np.zeros(3,)
18941  * if self.waveType =="Linear": # <<<<<<<<<<<<<<
18942  * self.uLinear(cppU,xx,t)
18943  * U[0] = cppU[0]
18944  */
18945  goto __pyx_L5;
18946  }
18947 
18948  /* "WaveTools.py":1155
18949  * U[2] = cppU[2]
18950  * else:
18951  * self.uFenton(cppU,xx,t) # <<<<<<<<<<<<<<
18952  * U[0] = cppU[0]
18953  * U[1] = cppU[1]
18954  */
18955  /*else*/ {
18956  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1155, __pyx_L1_error)
18957  ((struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves *)__pyx_v_self->__pyx_vtab)->uFenton(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
18958 
18959  /* "WaveTools.py":1156
18960  * else:
18961  * self.uFenton(cppU,xx,t)
18962  * U[0] = cppU[0] # <<<<<<<<<<<<<<
18963  * U[1] = cppU[1]
18964  * U[2] = cppU[2]
18965  */
18966  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
18967  __Pyx_GOTREF(__pyx_t_2);
18968  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1156, __pyx_L1_error)
18969  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18970 
18971  /* "WaveTools.py":1157
18972  * self.uFenton(cppU,xx,t)
18973  * U[0] = cppU[0]
18974  * U[1] = cppU[1] # <<<<<<<<<<<<<<
18975  * U[2] = cppU[2]
18976  * return U
18977  */
18978  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error)
18979  __Pyx_GOTREF(__pyx_t_2);
18980  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1157, __pyx_L1_error)
18981  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18982 
18983  /* "WaveTools.py":1158
18984  * U[0] = cppU[0]
18985  * U[1] = cppU[1]
18986  * U[2] = cppU[2] # <<<<<<<<<<<<<<
18987  * return U
18988  *
18989  */
18990  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error)
18991  __Pyx_GOTREF(__pyx_t_2);
18992  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1158, __pyx_L1_error)
18993  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18994  }
18995  __pyx_L5:;
18996 
18997  /* "WaveTools.py":1159
18998  * U[1] = cppU[1]
18999  * U[2] = cppU[2]
19000  * return U # <<<<<<<<<<<<<<
19001  *
19002  * class NewWave(object):
19003  */
19004  __Pyx_XDECREF(__pyx_r);
19005  __Pyx_INCREF(__pyx_v_U);
19006  __pyx_r = __pyx_v_U;
19007  goto __pyx_L0;
19008 
19009  /* "WaveTools.py":1126
19010  * return self.etaFenton(xx,t)
19011  *
19012  * def u(self,x,t): # <<<<<<<<<<<<<<
19013  * """Calculates wave velocity vector (MonochromaticWaves class).
19014  * Parameters
19015  */
19016 
19017  /* function exit code */
19018  __pyx_L1_error:;
19019  __Pyx_XDECREF(__pyx_t_1);
19020  __Pyx_XDECREF(__pyx_t_2);
19021  __Pyx_XDECREF(__pyx_t_3);
19022  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
19023  __pyx_r = NULL;
19024  __pyx_L0:;
19025  __Pyx_XDECREF(__pyx_v_ii);
19026  __Pyx_XDECREF(__pyx_v_U);
19027  __Pyx_XGIVEREF(__pyx_r);
19028  __Pyx_RefNannyFinishContext();
19029  return __pyx_r;
19030 }
19031 
19032 /* "WaveTools.pxd":69
19033  * cdef double[1000] tanh_c
19034  * cdef public:
19035  * double wavelength # <<<<<<<<<<<<<<
19036  * double mwl
19037  * cdef cfeta _cpp_eta
19038  */
19039 
19040 /* Python wrapper */
19041 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_10wavelength_1__get__(PyObject *__pyx_v_self); /*proto*/
19042 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_10wavelength_1__get__(PyObject *__pyx_v_self) {
19043  PyObject *__pyx_r = 0;
19044  __Pyx_RefNannyDeclarations
19045  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19046  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_10wavelength___get__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self));
19047 
19048  /* function exit code */
19049  __Pyx_RefNannyFinishContext();
19050  return __pyx_r;
19051 }
19052 
19053 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_10wavelength___get__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self) {
19054  PyObject *__pyx_r = NULL;
19055  __Pyx_RefNannyDeclarations
19056  PyObject *__pyx_t_1 = NULL;
19057  __Pyx_RefNannySetupContext("__get__", 0);
19058  __Pyx_XDECREF(__pyx_r);
19059  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->wavelength); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 69, __pyx_L1_error)
19060  __Pyx_GOTREF(__pyx_t_1);
19061  __pyx_r = __pyx_t_1;
19062  __pyx_t_1 = 0;
19063  goto __pyx_L0;
19064 
19065  /* function exit code */
19066  __pyx_L1_error:;
19067  __Pyx_XDECREF(__pyx_t_1);
19068  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.wavelength.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19069  __pyx_r = NULL;
19070  __pyx_L0:;
19071  __Pyx_XGIVEREF(__pyx_r);
19072  __Pyx_RefNannyFinishContext();
19073  return __pyx_r;
19074 }
19075 
19076 /* Python wrapper */
19077 static int __pyx_pw_9WaveTools_18MonochromaticWaves_10wavelength_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
19078 static int __pyx_pw_9WaveTools_18MonochromaticWaves_10wavelength_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
19079  int __pyx_r;
19080  __Pyx_RefNannyDeclarations
19081  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
19082  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_10wavelength_2__set__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
19083 
19084  /* function exit code */
19085  __Pyx_RefNannyFinishContext();
19086  return __pyx_r;
19087 }
19088 
19089 static int __pyx_pf_9WaveTools_18MonochromaticWaves_10wavelength_2__set__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_value) {
19090  int __pyx_r;
19091  __Pyx_RefNannyDeclarations
19092  double __pyx_t_1;
19093  __Pyx_RefNannySetupContext("__set__", 0);
19094  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 69, __pyx_L1_error)
19095  __pyx_v_self->wavelength = __pyx_t_1;
19096 
19097  /* function exit code */
19098  __pyx_r = 0;
19099  goto __pyx_L0;
19100  __pyx_L1_error:;
19101  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.wavelength.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19102  __pyx_r = -1;
19103  __pyx_L0:;
19104  __Pyx_RefNannyFinishContext();
19105  return __pyx_r;
19106 }
19107 
19108 /* "WaveTools.pxd":70
19109  * cdef public:
19110  * double wavelength
19111  * double mwl # <<<<<<<<<<<<<<
19112  * cdef cfeta _cpp_eta
19113  * cdef cfvel _cpp_u
19114  */
19115 
19116 /* Python wrapper */
19117 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
19118 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_3mwl_1__get__(PyObject *__pyx_v_self) {
19119  PyObject *__pyx_r = 0;
19120  __Pyx_RefNannyDeclarations
19121  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
19122  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_3mwl___get__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self));
19123 
19124  /* function exit code */
19125  __Pyx_RefNannyFinishContext();
19126  return __pyx_r;
19127 }
19128 
19129 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_3mwl___get__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self) {
19130  PyObject *__pyx_r = NULL;
19131  __Pyx_RefNannyDeclarations
19132  PyObject *__pyx_t_1 = NULL;
19133  __Pyx_RefNannySetupContext("__get__", 0);
19134  __Pyx_XDECREF(__pyx_r);
19135  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 70, __pyx_L1_error)
19136  __Pyx_GOTREF(__pyx_t_1);
19137  __pyx_r = __pyx_t_1;
19138  __pyx_t_1 = 0;
19139  goto __pyx_L0;
19140 
19141  /* function exit code */
19142  __pyx_L1_error:;
19143  __Pyx_XDECREF(__pyx_t_1);
19144  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19145  __pyx_r = NULL;
19146  __pyx_L0:;
19147  __Pyx_XGIVEREF(__pyx_r);
19148  __Pyx_RefNannyFinishContext();
19149  return __pyx_r;
19150 }
19151 
19152 /* Python wrapper */
19153 static int __pyx_pw_9WaveTools_18MonochromaticWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
19154 static int __pyx_pw_9WaveTools_18MonochromaticWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
19155  int __pyx_r;
19156  __Pyx_RefNannyDeclarations
19157  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
19158  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_3mwl_2__set__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
19159 
19160  /* function exit code */
19161  __Pyx_RefNannyFinishContext();
19162  return __pyx_r;
19163 }
19164 
19165 static int __pyx_pf_9WaveTools_18MonochromaticWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, PyObject *__pyx_v_value) {
19166  int __pyx_r;
19167  __Pyx_RefNannyDeclarations
19168  double __pyx_t_1;
19169  __Pyx_RefNannySetupContext("__set__", 0);
19170  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 70, __pyx_L1_error)
19171  __pyx_v_self->mwl = __pyx_t_1;
19172 
19173  /* function exit code */
19174  __pyx_r = 0;
19175  goto __pyx_L0;
19176  __pyx_L1_error:;
19177  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19178  __pyx_r = -1;
19179  __pyx_L0:;
19180  __Pyx_RefNannyFinishContext();
19181  return __pyx_r;
19182 }
19183 
19184 /* "(tree fragment)":1
19185  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
19186  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19187  * def __setstate_cython__(self, __pyx_state):
19188  */
19189 
19190 /* Python wrapper */
19191 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
19192 static PyMethodDef __pyx_mdef_9WaveTools_18MonochromaticWaves_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_18MonochromaticWaves_7__reduce_cython__, METH_NOARGS, 0};
19193 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
19194  PyObject *__pyx_r = 0;
19195  __Pyx_RefNannyDeclarations
19196  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
19197  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_6__reduce_cython__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self));
19198 
19199  /* function exit code */
19200  __Pyx_RefNannyFinishContext();
19201  return __pyx_r;
19202 }
19203 
19204 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self) {
19205  PyObject *__pyx_r = NULL;
19206  __Pyx_RefNannyDeclarations
19207  PyObject *__pyx_t_1 = NULL;
19208  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
19209 
19210  /* "(tree fragment)":2
19211  * def __reduce_cython__(self):
19212  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
19213  * def __setstate_cython__(self, __pyx_state):
19214  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19215  */
19216  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
19217  __Pyx_GOTREF(__pyx_t_1);
19218  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19219  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19220  __PYX_ERR(1, 2, __pyx_L1_error)
19221 
19222  /* "(tree fragment)":1
19223  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
19224  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19225  * def __setstate_cython__(self, __pyx_state):
19226  */
19227 
19228  /* function exit code */
19229  __pyx_L1_error:;
19230  __Pyx_XDECREF(__pyx_t_1);
19231  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19232  __pyx_r = NULL;
19233  __Pyx_XGIVEREF(__pyx_r);
19234  __Pyx_RefNannyFinishContext();
19235  return __pyx_r;
19236 }
19237 
19238 /* "(tree fragment)":3
19239  * def __reduce_cython__(self):
19240  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19241  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
19242  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19243  */
19244 
19245 /* Python wrapper */
19246 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
19247 static PyMethodDef __pyx_mdef_9WaveTools_18MonochromaticWaves_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_18MonochromaticWaves_9__setstate_cython__, METH_O, 0};
19248 static PyObject *__pyx_pw_9WaveTools_18MonochromaticWaves_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
19249  PyObject *__pyx_r = 0;
19250  __Pyx_RefNannyDeclarations
19251  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
19252  __pyx_r = __pyx_pf_9WaveTools_18MonochromaticWaves_8__setstate_cython__(((struct __pyx_obj_9WaveTools_MonochromaticWaves *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
19253 
19254  /* function exit code */
19255  __Pyx_RefNannyFinishContext();
19256  return __pyx_r;
19257 }
19258 
19259 static PyObject *__pyx_pf_9WaveTools_18MonochromaticWaves_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MonochromaticWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
19260  PyObject *__pyx_r = NULL;
19261  __Pyx_RefNannyDeclarations
19262  PyObject *__pyx_t_1 = NULL;
19263  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
19264 
19265  /* "(tree fragment)":4
19266  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19267  * def __setstate_cython__(self, __pyx_state):
19268  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
19269  */
19270  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
19271  __Pyx_GOTREF(__pyx_t_1);
19272  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19273  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19274  __PYX_ERR(1, 4, __pyx_L1_error)
19275 
19276  /* "(tree fragment)":3
19277  * def __reduce_cython__(self):
19278  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19279  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
19280  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
19281  */
19282 
19283  /* function exit code */
19284  __pyx_L1_error:;
19285  __Pyx_XDECREF(__pyx_t_1);
19286  __Pyx_AddTraceback("WaveTools.MonochromaticWaves.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19287  __pyx_r = NULL;
19288  __Pyx_XGIVEREF(__pyx_r);
19289  __Pyx_RefNannyFinishContext();
19290  return __pyx_r;
19291 }
19292 
19293 /* "WaveTools.py":1200
19294  * Switch for optimised functions
19295  * """
19296  * def __cinit__(self, # <<<<<<<<<<<<<<
19297  * Tp,
19298  * Hs,
19299  */
19300 
19301 /* Python wrapper */
19302 static int __pyx_pw_9WaveTools_7NewWave_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19303 static int __pyx_pw_9WaveTools_7NewWave_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19304  PyObject *__pyx_v_Tp = 0;
19305  PyObject *__pyx_v_Hs = 0;
19306  PyObject *__pyx_v_mwl = 0;
19307  PyObject *__pyx_v_depth = 0;
19308  PyObject *__pyx_v_waveDir = 0;
19309  PyObject *__pyx_v_g = 0;
19310  PyObject *__pyx_v_N = 0;
19311  PyObject *__pyx_v_bandFactor = 0;
19312  PyObject *__pyx_v_spectName = 0;
19313  PyObject *__pyx_v_spectral_params = 0;
19314  CYTHON_UNUSED PyObject *__pyx_v_crestFocus = 0;
19315  PyObject *__pyx_v_xfocus = 0;
19316  PyObject *__pyx_v_tfocus = 0;
19317  PyObject *__pyx_v_fast = 0;
19318  PyObject *__pyx_v_Nmax = 0;
19319  int __pyx_r;
19320  __Pyx_RefNannyDeclarations
19321  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
19322  {
19323  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spectral_params,&__pyx_n_s_crestFocus,&__pyx_n_s_xfocus,&__pyx_n_s_tfocus,&__pyx_n_s_fast,&__pyx_n_s_Nmax,0};
19324  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
19325 
19326  /* "WaveTools.py":1210
19327  * bandFactor, #accelerationof gravity
19328  * spectName ,# random words will result in error and return the available spectra
19329  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth} # <<<<<<<<<<<<<<
19330  * crestFocus=True,
19331  * xfocus=np.array([0.,0.,0]),
19332  */
19333  values[9] = ((PyObject *)Py_None);
19334 
19335  /* "WaveTools.py":1211
19336  * spectName ,# random words will result in error and return the available spectra
19337  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
19338  * crestFocus=True, # <<<<<<<<<<<<<<
19339  * xfocus=np.array([0.,0.,0]),
19340  * tfocus=0.,
19341  */
19342  values[10] = ((PyObject *)Py_True);
19343  values[11] = __pyx_k__22;
19344  values[12] = ((PyObject *)__pyx_float_0_);
19345 
19346  /* "WaveTools.py":1214
19347  * xfocus=np.array([0.,0.,0]),
19348  * tfocus=0.,
19349  * fast = True, # <<<<<<<<<<<<<<
19350  * Nmax = 1000
19351  * ):
19352  */
19353  values[13] = ((PyObject *)Py_True);
19354  values[14] = ((PyObject *)__pyx_int_1000);
19355  if (unlikely(__pyx_kwds)) {
19356  Py_ssize_t kw_args;
19357  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19358  switch (pos_args) {
19359  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
19360  CYTHON_FALLTHROUGH;
19361  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
19362  CYTHON_FALLTHROUGH;
19363  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
19364  CYTHON_FALLTHROUGH;
19365  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
19366  CYTHON_FALLTHROUGH;
19367  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
19368  CYTHON_FALLTHROUGH;
19369  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
19370  CYTHON_FALLTHROUGH;
19371  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19372  CYTHON_FALLTHROUGH;
19373  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19374  CYTHON_FALLTHROUGH;
19375  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19376  CYTHON_FALLTHROUGH;
19377  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19378  CYTHON_FALLTHROUGH;
19379  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19380  CYTHON_FALLTHROUGH;
19381  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19382  CYTHON_FALLTHROUGH;
19383  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19384  CYTHON_FALLTHROUGH;
19385  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19386  CYTHON_FALLTHROUGH;
19387  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19388  CYTHON_FALLTHROUGH;
19389  case 0: break;
19390  default: goto __pyx_L5_argtuple_error;
19391  }
19392  kw_args = PyDict_Size(__pyx_kwds);
19393  switch (pos_args) {
19394  case 0:
19395  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
19396  else goto __pyx_L5_argtuple_error;
19397  CYTHON_FALLTHROUGH;
19398  case 1:
19399  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
19400  else {
19401  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 1); __PYX_ERR(0, 1200, __pyx_L3_error)
19402  }
19403  CYTHON_FALLTHROUGH;
19404  case 2:
19405  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
19406  else {
19407  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 2); __PYX_ERR(0, 1200, __pyx_L3_error)
19408  }
19409  CYTHON_FALLTHROUGH;
19410  case 3:
19411  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
19412  else {
19413  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 3); __PYX_ERR(0, 1200, __pyx_L3_error)
19414  }
19415  CYTHON_FALLTHROUGH;
19416  case 4:
19417  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
19418  else {
19419  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 4); __PYX_ERR(0, 1200, __pyx_L3_error)
19420  }
19421  CYTHON_FALLTHROUGH;
19422  case 5:
19423  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
19424  else {
19425  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 5); __PYX_ERR(0, 1200, __pyx_L3_error)
19426  }
19427  CYTHON_FALLTHROUGH;
19428  case 6:
19429  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
19430  else {
19431  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 6); __PYX_ERR(0, 1200, __pyx_L3_error)
19432  }
19433  CYTHON_FALLTHROUGH;
19434  case 7:
19435  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
19436  else {
19437  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 7); __PYX_ERR(0, 1200, __pyx_L3_error)
19438  }
19439  CYTHON_FALLTHROUGH;
19440  case 8:
19441  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
19442  else {
19443  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, 8); __PYX_ERR(0, 1200, __pyx_L3_error)
19444  }
19445  CYTHON_FALLTHROUGH;
19446  case 9:
19447  if (kw_args > 0) {
19448  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params);
19449  if (value) { values[9] = value; kw_args--; }
19450  }
19451  CYTHON_FALLTHROUGH;
19452  case 10:
19453  if (kw_args > 0) {
19454  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_crestFocus);
19455  if (value) { values[10] = value; kw_args--; }
19456  }
19457  CYTHON_FALLTHROUGH;
19458  case 11:
19459  if (kw_args > 0) {
19460  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xfocus);
19461  if (value) { values[11] = value; kw_args--; }
19462  }
19463  CYTHON_FALLTHROUGH;
19464  case 12:
19465  if (kw_args > 0) {
19466  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tfocus);
19467  if (value) { values[12] = value; kw_args--; }
19468  }
19469  CYTHON_FALLTHROUGH;
19470  case 13:
19471  if (kw_args > 0) {
19472  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
19473  if (value) { values[13] = value; kw_args--; }
19474  }
19475  CYTHON_FALLTHROUGH;
19476  case 14:
19477  if (kw_args > 0) {
19478  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nmax);
19479  if (value) { values[14] = value; kw_args--; }
19480  }
19481  }
19482  if (unlikely(kw_args > 0)) {
19483  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1200, __pyx_L3_error)
19484  }
19485  } else {
19486  switch (PyTuple_GET_SIZE(__pyx_args)) {
19487  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
19488  CYTHON_FALLTHROUGH;
19489  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
19490  CYTHON_FALLTHROUGH;
19491  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
19492  CYTHON_FALLTHROUGH;
19493  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
19494  CYTHON_FALLTHROUGH;
19495  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
19496  CYTHON_FALLTHROUGH;
19497  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
19498  CYTHON_FALLTHROUGH;
19499  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19500  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19501  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19502  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19503  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19504  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19505  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19506  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19507  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19508  break;
19509  default: goto __pyx_L5_argtuple_error;
19510  }
19511  }
19512  __pyx_v_Tp = values[0];
19513  __pyx_v_Hs = values[1];
19514  __pyx_v_mwl = values[2];
19515  __pyx_v_depth = values[3];
19516  __pyx_v_waveDir = values[4];
19517  __pyx_v_g = values[5];
19518  __pyx_v_N = values[6];
19519  __pyx_v_bandFactor = values[7];
19520  __pyx_v_spectName = values[8];
19521  __pyx_v_spectral_params = values[9];
19522  __pyx_v_crestFocus = values[10];
19523  __pyx_v_xfocus = values[11];
19524  __pyx_v_tfocus = values[12];
19525  __pyx_v_fast = values[13];
19526  __pyx_v_Nmax = values[14];
19527  }
19528  goto __pyx_L4_argument_unpacking_done;
19529  __pyx_L5_argtuple_error:;
19530  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1200, __pyx_L3_error)
19531  __pyx_L3_error:;
19532  __Pyx_AddTraceback("WaveTools.NewWave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
19533  __Pyx_RefNannyFinishContext();
19534  return -1;
19535  __pyx_L4_argument_unpacking_done:;
19536  __pyx_r = __pyx_pf_9WaveTools_7NewWave___cinit__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spectral_params, __pyx_v_crestFocus, __pyx_v_xfocus, __pyx_v_tfocus, __pyx_v_fast, __pyx_v_Nmax);
19537 
19538  /* "WaveTools.py":1200
19539  * Switch for optimised functions
19540  * """
19541  * def __cinit__(self, # <<<<<<<<<<<<<<
19542  * Tp,
19543  * Hs,
19544  */
19545 
19546  /* function exit code */
19547  __Pyx_RefNannyFinishContext();
19548  return __pyx_r;
19549 }
19550 static PyObject *__pyx_gb_9WaveTools_7NewWave_9__cinit___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
19551 
19552 /* "WaveTools.py":1264
19553  * if(self.N > 10000):
19554  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
19555  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega # <<<<<<<<<<<<<<
19556  *
19557  *
19558  */
19559 
19560 static PyObject *__pyx_pf_9WaveTools_7NewWave_9__cinit___genexpr(PyObject *__pyx_self) {
19561  struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
19562  PyObject *__pyx_r = NULL;
19563  __Pyx_RefNannyDeclarations
19564  __Pyx_RefNannySetupContext("genexpr", 0);
19565  __pyx_cur_scope = (struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *)__pyx_tp_new_9WaveTools___pyx_scope_struct_1_genexpr(__pyx_ptype_9WaveTools___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
19566  if (unlikely(!__pyx_cur_scope)) {
19567  __pyx_cur_scope = ((struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *)Py_None);
19568  __Pyx_INCREF(Py_None);
19569  __PYX_ERR(0, 1264, __pyx_L1_error)
19570  } else {
19571  __Pyx_GOTREF(__pyx_cur_scope);
19572  }
19573  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *) __pyx_self;
19574  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
19575  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
19576  {
19577  __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_9WaveTools_7NewWave_9__cinit___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_cinit___locals_genexpr, __pyx_n_s_WaveTools); if (unlikely(!gen)) __PYX_ERR(0, 1264, __pyx_L1_error)
19578  __Pyx_DECREF(__pyx_cur_scope);
19579  __Pyx_RefNannyFinishContext();
19580  return (PyObject *) gen;
19581  }
19582 
19583  /* function exit code */
19584  __pyx_L1_error:;
19585  __Pyx_AddTraceback("WaveTools.NewWave.__cinit__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
19586  __pyx_r = NULL;
19587  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
19588  __Pyx_XGIVEREF(__pyx_r);
19589  __Pyx_RefNannyFinishContext();
19590  return __pyx_r;
19591 }
19592 
19593 static PyObject *__pyx_gb_9WaveTools_7NewWave_9__cinit___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
19594 {
19595  struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
19596  PyObject *__pyx_r = NULL;
19597  PyObject *__pyx_t_1 = NULL;
19598  PyObject *__pyx_t_2 = NULL;
19599  PyObject *__pyx_t_3 = NULL;
19600  Py_ssize_t __pyx_t_4;
19601  PyObject *(*__pyx_t_5)(PyObject *);
19602  PyObject *__pyx_t_6 = NULL;
19603  __Pyx_RefNannyDeclarations
19604  __Pyx_RefNannySetupContext("genexpr", 0);
19605  switch (__pyx_generator->resume_label) {
19606  case 0: goto __pyx_L3_first_run;
19607  case 1: goto __pyx_L6_resume_from_yield;
19608  default: /* CPython raises the right error here */
19609  __Pyx_RefNannyFinishContext();
19610  return NULL;
19611  }
19612  __pyx_L3_first_run:;
19613  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1264, __pyx_L1_error)
19614  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L1_error)
19615  __Pyx_GOTREF(__pyx_t_2);
19616  __pyx_t_3 = NULL;
19617  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
19618  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
19619  if (likely(__pyx_t_3)) {
19620  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
19621  __Pyx_INCREF(__pyx_t_3);
19622  __Pyx_INCREF(function);
19623  __Pyx_DECREF_SET(__pyx_t_2, function);
19624  }
19625  }
19626  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
19627  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19628  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
19629  __Pyx_GOTREF(__pyx_t_1);
19630  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19631  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
19632  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
19633  __pyx_t_5 = NULL;
19634  } else {
19635  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L1_error)
19636  __Pyx_GOTREF(__pyx_t_2);
19637  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1264, __pyx_L1_error)
19638  }
19639  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19640  for (;;) {
19641  if (likely(!__pyx_t_5)) {
19642  if (likely(PyList_CheckExact(__pyx_t_2))) {
19643  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
19644  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19645  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1264, __pyx_L1_error)
19646  #else
19647  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
19648  __Pyx_GOTREF(__pyx_t_1);
19649  #endif
19650  } else {
19651  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
19652  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
19653  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1264, __pyx_L1_error)
19654  #else
19655  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
19656  __Pyx_GOTREF(__pyx_t_1);
19657  #endif
19658  }
19659  } else {
19660  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
19661  if (unlikely(!__pyx_t_1)) {
19662  PyObject* exc_type = PyErr_Occurred();
19663  if (exc_type) {
19664  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
19665  else __PYX_ERR(0, 1264, __pyx_L1_error)
19666  }
19667  break;
19668  }
19669  __Pyx_GOTREF(__pyx_t_1);
19670  }
19671  __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_j);
19672  __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_j, __pyx_t_1);
19673  __Pyx_GIVEREF(__pyx_t_1);
19674  __pyx_t_1 = 0;
19675  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1264, __pyx_L1_error) }
19676  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
19677  __Pyx_GOTREF(__pyx_t_1);
19678  __Pyx_INCREF(__pyx_slice__4);
19679  __Pyx_GIVEREF(__pyx_slice__4);
19680  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__4);
19681  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_j);
19682  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_j);
19683  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_j);
19684  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->kDir), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error)
19685  __Pyx_GOTREF(__pyx_t_3);
19686  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19687  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_xfocus)) { __Pyx_RaiseClosureNameError("xfocus"); __PYX_ERR(0, 1264, __pyx_L1_error) }
19688  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_xfocus, __pyx_cur_scope->__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
19689  __Pyx_GOTREF(__pyx_t_1);
19690  __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error)
19691  __Pyx_GOTREF(__pyx_t_6);
19692  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19693  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19694  __pyx_r = __pyx_t_6;
19695  __pyx_t_6 = 0;
19696  __Pyx_XGIVEREF(__pyx_t_2);
19697  __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
19698  __pyx_cur_scope->__pyx_t_1 = __pyx_t_4;
19699  __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
19700  __Pyx_XGIVEREF(__pyx_r);
19701  __Pyx_RefNannyFinishContext();
19702  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
19703  /* return from generator, yielding value */
19704  __pyx_generator->resume_label = 1;
19705  return __pyx_r;
19706  __pyx_L6_resume_from_yield:;
19707  __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
19708  __pyx_cur_scope->__pyx_t_0 = 0;
19709  __Pyx_XGOTREF(__pyx_t_2);
19710  __pyx_t_4 = __pyx_cur_scope->__pyx_t_1;
19711  __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
19712  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1264, __pyx_L1_error)
19713  }
19714  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19715  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
19716 
19717  /* function exit code */
19718  PyErr_SetNone(PyExc_StopIteration);
19719  goto __pyx_L0;
19720  __pyx_L1_error:;
19721  __Pyx_XDECREF(__pyx_t_1);
19722  __Pyx_XDECREF(__pyx_t_2);
19723  __Pyx_XDECREF(__pyx_t_3);
19724  __Pyx_XDECREF(__pyx_t_6);
19725  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
19726  __pyx_L0:;
19727  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
19728  #if !CYTHON_USE_EXC_INFO_STACK
19729  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
19730  #endif
19731  __pyx_generator->resume_label = -1;
19732  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
19733  __Pyx_RefNannyFinishContext();
19734  return __pyx_r;
19735 }
19736 
19737 /* "WaveTools.py":1200
19738  * Switch for optimised functions
19739  * """
19740  * def __cinit__(self, # <<<<<<<<<<<<<<
19741  * Tp,
19742  * Hs,
19743  */
19744 
19745 static int __pyx_pf_9WaveTools_7NewWave___cinit__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, CYTHON_UNUSED PyObject *__pyx_v_crestFocus, PyObject *__pyx_v_xfocus, PyObject *__pyx_v_tfocus, PyObject *__pyx_v_fast, PyObject *__pyx_v_Nmax) {
19746  struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *__pyx_cur_scope;
19747  PyObject *__pyx_v_validSpectra = NULL;
19748  PyObject *__pyx_v_spec_fun = NULL;
19749  double __pyx_v_fmax;
19750  PyObject *__pyx_v_fmin = NULL;
19751  PyObject *__pyx_v_fim = NULL;
19752  PyObject *__pyx_v_wim = NULL;
19753  PyObject *__pyx_v_ii = NULL;
19754  PyObject *__pyx_v_mm = NULL;
19755  PyObject *__pyx_v_m0 = NULL;
19756  PyObject *__pyx_v_An = NULL;
19757  PyObject *__pyx_v_ij = NULL;
19758  PyObject *__pyx_v_kk = NULL;
19759  int __pyx_r;
19760  __Pyx_RefNannyDeclarations
19761  bool __pyx_t_1;
19762  PyObject *__pyx_t_2 = NULL;
19763  PyObject *__pyx_t_3 = NULL;
19764  PyObject *__pyx_t_4 = NULL;
19765  int __pyx_t_5;
19766  PyObject *__pyx_t_6 = NULL;
19767  PyObject *__pyx_t_7 = NULL;
19768  double __pyx_t_8;
19769  PyObject *__pyx_t_9 = NULL;
19770  int __pyx_t_10;
19771  int __pyx_t_11;
19772  PyObject *__pyx_t_12 = NULL;
19773  PyObject *__pyx_t_13 = NULL;
19774  PyObject *__pyx_t_14 = NULL;
19775  PyObject *__pyx_t_15 = NULL;
19776  Py_ssize_t __pyx_t_16;
19777  PyObject *(*__pyx_t_17)(PyObject *);
19778  Py_ssize_t __pyx_t_18;
19779  double *__pyx_t_19;
19780  PyObject *(*__pyx_t_20)(PyObject *);
19781  Py_ssize_t __pyx_t_21;
19782  __Pyx_RefNannySetupContext("__cinit__", 0);
19783  __pyx_cur_scope = (struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *)__pyx_tp_new_9WaveTools___pyx_scope_struct____cinit__(__pyx_ptype_9WaveTools___pyx_scope_struct____cinit__, __pyx_empty_tuple, NULL);
19784  if (unlikely(!__pyx_cur_scope)) {
19785  __pyx_cur_scope = ((struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *)Py_None);
19786  __Pyx_INCREF(Py_None);
19787  __PYX_ERR(0, 1200, __pyx_L1_error)
19788  } else {
19789  __Pyx_GOTREF(__pyx_cur_scope);
19790  }
19791  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
19792  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
19793  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
19794  __pyx_cur_scope->__pyx_v_xfocus = __pyx_v_xfocus;
19795  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_xfocus);
19796  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xfocus);
19797  __Pyx_INCREF(__pyx_v_waveDir);
19798 
19799  /* "WaveTools.py":1217
19800  * Nmax = 1000
19801  * ):
19802  * self.fast= fast # <<<<<<<<<<<<<<
19803  * validSpectra = [JONSWAP,PM_mod]
19804  * spec_fun =loadExistingFunction(spectName, validSpectra)
19805  */
19806  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error)
19807  __pyx_cur_scope->__pyx_v_self->fast = __pyx_t_1;
19808 
19809  /* "WaveTools.py":1218
19810  * ):
19811  * self.fast= fast
19812  * validSpectra = [JONSWAP,PM_mod] # <<<<<<<<<<<<<<
19813  * spec_fun =loadExistingFunction(spectName, validSpectra)
19814  * self.g = np.array(g)
19815  */
19816  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_JONSWAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error)
19817  __Pyx_GOTREF(__pyx_t_2);
19818  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PM_mod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1218, __pyx_L1_error)
19819  __Pyx_GOTREF(__pyx_t_3);
19820  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error)
19821  __Pyx_GOTREF(__pyx_t_4);
19822  __Pyx_GIVEREF(__pyx_t_2);
19823  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
19824  __Pyx_GIVEREF(__pyx_t_3);
19825  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
19826  __pyx_t_2 = 0;
19827  __pyx_t_3 = 0;
19828  __pyx_v_validSpectra = ((PyObject*)__pyx_t_4);
19829  __pyx_t_4 = 0;
19830 
19831  /* "WaveTools.py":1219
19832  * self.fast= fast
19833  * validSpectra = [JONSWAP,PM_mod]
19834  * spec_fun =loadExistingFunction(spectName, validSpectra) # <<<<<<<<<<<<<<
19835  * self.g = np.array(g)
19836  * waveDir = setDirVector(np.array(waveDir))
19837  */
19838  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_loadExistingFunction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1219, __pyx_L1_error)
19839  __Pyx_GOTREF(__pyx_t_3);
19840  __pyx_t_2 = NULL;
19841  __pyx_t_5 = 0;
19842  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19843  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19844  if (likely(__pyx_t_2)) {
19845  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19846  __Pyx_INCREF(__pyx_t_2);
19847  __Pyx_INCREF(function);
19848  __Pyx_DECREF_SET(__pyx_t_3, function);
19849  __pyx_t_5 = 1;
19850  }
19851  }
19852  #if CYTHON_FAST_PYCALL
19853  if (PyFunction_Check(__pyx_t_3)) {
19854  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_spectName, __pyx_v_validSpectra};
19855  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
19856  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19857  __Pyx_GOTREF(__pyx_t_4);
19858  } else
19859  #endif
19860  #if CYTHON_FAST_PYCCALL
19861  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19862  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_spectName, __pyx_v_validSpectra};
19863  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
19864  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19865  __Pyx_GOTREF(__pyx_t_4);
19866  } else
19867  #endif
19868  {
19869  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1219, __pyx_L1_error)
19870  __Pyx_GOTREF(__pyx_t_6);
19871  if (__pyx_t_2) {
19872  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
19873  }
19874  __Pyx_INCREF(__pyx_v_spectName);
19875  __Pyx_GIVEREF(__pyx_v_spectName);
19876  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_spectName);
19877  __Pyx_INCREF(__pyx_v_validSpectra);
19878  __Pyx_GIVEREF(__pyx_v_validSpectra);
19879  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_validSpectra);
19880  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1219, __pyx_L1_error)
19881  __Pyx_GOTREF(__pyx_t_4);
19882  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19883  }
19884  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19885  __pyx_v_spec_fun = __pyx_t_4;
19886  __pyx_t_4 = 0;
19887 
19888  /* "WaveTools.py":1220
19889  * validSpectra = [JONSWAP,PM_mod]
19890  * spec_fun =loadExistingFunction(spectName, validSpectra)
19891  * self.g = np.array(g) # <<<<<<<<<<<<<<
19892  * waveDir = setDirVector(np.array(waveDir))
19893  * self.waveDir = waveDir
19894  */
19895  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1220, __pyx_L1_error)
19896  __Pyx_GOTREF(__pyx_t_3);
19897  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1220, __pyx_L1_error)
19898  __Pyx_GOTREF(__pyx_t_6);
19899  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19900  __pyx_t_3 = NULL;
19901  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
19902  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
19903  if (likely(__pyx_t_3)) {
19904  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19905  __Pyx_INCREF(__pyx_t_3);
19906  __Pyx_INCREF(function);
19907  __Pyx_DECREF_SET(__pyx_t_6, function);
19908  }
19909  }
19910  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_g);
19911  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19912  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1220, __pyx_L1_error)
19913  __Pyx_GOTREF(__pyx_t_4);
19914  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19915  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1220, __pyx_L1_error)
19916  __Pyx_GIVEREF(__pyx_t_4);
19917  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->g);
19918  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->g));
19919  __pyx_cur_scope->__pyx_v_self->g = ((PyArrayObject *)__pyx_t_4);
19920  __pyx_t_4 = 0;
19921 
19922  /* "WaveTools.py":1221
19923  * spec_fun =loadExistingFunction(spectName, validSpectra)
19924  * self.g = np.array(g)
19925  * waveDir = setDirVector(np.array(waveDir)) # <<<<<<<<<<<<<<
19926  * self.waveDir = waveDir
19927  * self.vDir = setVertDir(g)
19928  */
19929  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1221, __pyx_L1_error)
19930  __Pyx_GOTREF(__pyx_t_6);
19931  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error)
19932  __Pyx_GOTREF(__pyx_t_2);
19933  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1221, __pyx_L1_error)
19934  __Pyx_GOTREF(__pyx_t_7);
19935  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19936  __pyx_t_2 = NULL;
19937  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
19938  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
19939  if (likely(__pyx_t_2)) {
19940  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19941  __Pyx_INCREF(__pyx_t_2);
19942  __Pyx_INCREF(function);
19943  __Pyx_DECREF_SET(__pyx_t_7, function);
19944  }
19945  }
19946  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_v_waveDir) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_waveDir);
19947  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19948  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1221, __pyx_L1_error)
19949  __Pyx_GOTREF(__pyx_t_3);
19950  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19951  __pyx_t_7 = NULL;
19952  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
19953  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
19954  if (likely(__pyx_t_7)) {
19955  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19956  __Pyx_INCREF(__pyx_t_7);
19957  __Pyx_INCREF(function);
19958  __Pyx_DECREF_SET(__pyx_t_6, function);
19959  }
19960  }
19961  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
19962  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
19963  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19964  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error)
19965  __Pyx_GOTREF(__pyx_t_4);
19966  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19967  __Pyx_DECREF_SET(__pyx_v_waveDir, __pyx_t_4);
19968  __pyx_t_4 = 0;
19969 
19970  /* "WaveTools.py":1222
19971  * self.g = np.array(g)
19972  * waveDir = setDirVector(np.array(waveDir))
19973  * self.waveDir = waveDir # <<<<<<<<<<<<<<
19974  * self.vDir = setVertDir(g)
19975  * dirCheck(self.waveDir,self.vDir)
19976  */
19977  if (!(likely(((__pyx_v_waveDir) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_waveDir, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1222, __pyx_L1_error)
19978  __pyx_t_4 = __pyx_v_waveDir;
19979  __Pyx_INCREF(__pyx_t_4);
19980  __Pyx_GIVEREF(__pyx_t_4);
19981  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->waveDir);
19982  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir));
19983  __pyx_cur_scope->__pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_4);
19984  __pyx_t_4 = 0;
19985 
19986  /* "WaveTools.py":1223
19987  * waveDir = setDirVector(np.array(waveDir))
19988  * self.waveDir = waveDir
19989  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
19990  * dirCheck(self.waveDir,self.vDir)
19991  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
19992  */
19993  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1223, __pyx_L1_error)
19994  __Pyx_GOTREF(__pyx_t_6);
19995  __pyx_t_3 = NULL;
19996  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
19997  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
19998  if (likely(__pyx_t_3)) {
19999  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20000  __Pyx_INCREF(__pyx_t_3);
20001  __Pyx_INCREF(function);
20002  __Pyx_DECREF_SET(__pyx_t_6, function);
20003  }
20004  }
20005  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_g);
20006  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20007  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1223, __pyx_L1_error)
20008  __Pyx_GOTREF(__pyx_t_4);
20009  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20010  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1223, __pyx_L1_error)
20011  __Pyx_GIVEREF(__pyx_t_4);
20012  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->vDir);
20013  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir));
20014  __pyx_cur_scope->__pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_4);
20015  __pyx_t_4 = 0;
20016 
20017  /* "WaveTools.py":1224
20018  * self.waveDir = waveDir
20019  * self.vDir = setVertDir(g)
20020  * dirCheck(self.waveDir,self.vDir) # <<<<<<<<<<<<<<
20021  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
20022  * self.Hs = Hs
20023  */
20024  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dirCheck); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1224, __pyx_L1_error)
20025  __Pyx_GOTREF(__pyx_t_6);
20026  __pyx_t_3 = NULL;
20027  __pyx_t_5 = 0;
20028  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
20029  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
20030  if (likely(__pyx_t_3)) {
20031  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20032  __Pyx_INCREF(__pyx_t_3);
20033  __Pyx_INCREF(function);
20034  __Pyx_DECREF_SET(__pyx_t_6, function);
20035  __pyx_t_5 = 1;
20036  }
20037  }
20038  #if CYTHON_FAST_PYCALL
20039  if (PyFunction_Check(__pyx_t_6)) {
20040  PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir), ((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir)};
20041  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error)
20042  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20043  __Pyx_GOTREF(__pyx_t_4);
20044  } else
20045  #endif
20046  #if CYTHON_FAST_PYCCALL
20047  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
20048  PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir), ((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir)};
20049  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error)
20050  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20051  __Pyx_GOTREF(__pyx_t_4);
20052  } else
20053  #endif
20054  {
20055  __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1224, __pyx_L1_error)
20056  __Pyx_GOTREF(__pyx_t_7);
20057  if (__pyx_t_3) {
20058  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
20059  }
20060  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir));
20061  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir));
20062  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir));
20063  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir));
20064  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir));
20065  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir));
20066  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error)
20067  __Pyx_GOTREF(__pyx_t_4);
20068  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20069  }
20070  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20071  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20072 
20073  /* "WaveTools.py":1225
20074  * self.vDir = setVertDir(g)
20075  * dirCheck(self.waveDir,self.vDir)
20076  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2]) # <<<<<<<<<<<<<<
20077  * self.Hs = Hs
20078  * self.depth = depth
20079  */
20080  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error)
20081  __Pyx_GOTREF(__pyx_t_4);
20082  __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1225, __pyx_L1_error)
20083  __Pyx_GOTREF(__pyx_t_6);
20084  __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1225, __pyx_L1_error)
20085  __Pyx_GOTREF(__pyx_t_7);
20086  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20087  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20088  __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1225, __pyx_L1_error)
20089  __Pyx_GOTREF(__pyx_t_6);
20090  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error)
20091  __Pyx_GOTREF(__pyx_t_4);
20092  __pyx_t_3 = PyNumber_Multiply(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error)
20093  __Pyx_GOTREF(__pyx_t_3);
20094  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20095  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20096  __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error)
20097  __Pyx_GOTREF(__pyx_t_4);
20098  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20099  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20100  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error)
20101  __Pyx_GOTREF(__pyx_t_3);
20102  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_cur_scope->__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1225, __pyx_L1_error)
20103  __Pyx_GOTREF(__pyx_t_7);
20104  __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1225, __pyx_L1_error)
20105  __Pyx_GOTREF(__pyx_t_6);
20106  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20107  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20108  __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1225, __pyx_L1_error)
20109  __Pyx_GOTREF(__pyx_t_7);
20110  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20111  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20112  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1225, __pyx_L1_error)
20113  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20114  __pyx_cur_scope->__pyx_v_self->gAbs = sqrt(__pyx_t_8);
20115 
20116  /* "WaveTools.py":1226
20117  * dirCheck(self.waveDir,self.vDir)
20118  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
20119  * self.Hs = Hs # <<<<<<<<<<<<<<
20120  * self.depth = depth
20121  * self.Tp = Tp
20122  */
20123  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_Hs); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L1_error)
20124  __pyx_cur_scope->__pyx_v_self->Hs = __pyx_t_8;
20125 
20126  /* "WaveTools.py":1227
20127  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
20128  * self.Hs = Hs
20129  * self.depth = depth # <<<<<<<<<<<<<<
20130  * self.Tp = Tp
20131  * self.fp = old_div(1.,Tp)
20132  */
20133  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1227, __pyx_L1_error)
20134  __pyx_cur_scope->__pyx_v_self->depth = __pyx_t_8;
20135 
20136  /* "WaveTools.py":1228
20137  * self.Hs = Hs
20138  * self.depth = depth
20139  * self.Tp = Tp # <<<<<<<<<<<<<<
20140  * self.fp = old_div(1.,Tp)
20141  * self.bandFactor = bandFactor
20142  */
20143  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_Tp); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
20144  __pyx_cur_scope->__pyx_v_self->Tp = __pyx_t_8;
20145 
20146  /* "WaveTools.py":1229
20147  * self.depth = depth
20148  * self.Tp = Tp
20149  * self.fp = old_div(1.,Tp) # <<<<<<<<<<<<<<
20150  * self.bandFactor = bandFactor
20151  * self.N = N
20152  */
20153  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1229, __pyx_L1_error)
20154  __Pyx_GOTREF(__pyx_t_6);
20155  __pyx_t_4 = NULL;
20156  __pyx_t_5 = 0;
20157  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
20158  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
20159  if (likely(__pyx_t_4)) {
20160  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20161  __Pyx_INCREF(__pyx_t_4);
20162  __Pyx_INCREF(function);
20163  __Pyx_DECREF_SET(__pyx_t_6, function);
20164  __pyx_t_5 = 1;
20165  }
20166  }
20167  #if CYTHON_FAST_PYCALL
20168  if (PyFunction_Check(__pyx_t_6)) {
20169  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_float_1_, __pyx_v_Tp};
20170  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1229, __pyx_L1_error)
20171  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20172  __Pyx_GOTREF(__pyx_t_7);
20173  } else
20174  #endif
20175  #if CYTHON_FAST_PYCCALL
20176  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
20177  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_float_1_, __pyx_v_Tp};
20178  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1229, __pyx_L1_error)
20179  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20180  __Pyx_GOTREF(__pyx_t_7);
20181  } else
20182  #endif
20183  {
20184  __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1229, __pyx_L1_error)
20185  __Pyx_GOTREF(__pyx_t_3);
20186  if (__pyx_t_4) {
20187  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
20188  }
20189  __Pyx_INCREF(__pyx_float_1_);
20190  __Pyx_GIVEREF(__pyx_float_1_);
20191  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_float_1_);
20192  __Pyx_INCREF(__pyx_v_Tp);
20193  __Pyx_GIVEREF(__pyx_v_Tp);
20194  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_Tp);
20195  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1229, __pyx_L1_error)
20196  __Pyx_GOTREF(__pyx_t_7);
20197  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20198  }
20199  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20200  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
20201  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20202  __pyx_cur_scope->__pyx_v_self->fp = __pyx_t_8;
20203 
20204  /* "WaveTools.py":1230
20205  * self.Tp = Tp
20206  * self.fp = old_div(1.,Tp)
20207  * self.bandFactor = bandFactor # <<<<<<<<<<<<<<
20208  * self.N = N
20209  * self.mwl = mwl
20210  */
20211  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_bandFactor); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1230, __pyx_L1_error)
20212  __pyx_cur_scope->__pyx_v_self->bandFactor = __pyx_t_8;
20213 
20214  /* "WaveTools.py":1231
20215  * self.fp = old_div(1.,Tp)
20216  * self.bandFactor = bandFactor
20217  * self.N = N # <<<<<<<<<<<<<<
20218  * self.mwl = mwl
20219  * fmax = self.bandFactor*self.fp
20220  */
20221  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1231, __pyx_L1_error)
20222  __pyx_cur_scope->__pyx_v_self->N = __pyx_t_5;
20223 
20224  /* "WaveTools.py":1232
20225  * self.bandFactor = bandFactor
20226  * self.N = N
20227  * self.mwl = mwl # <<<<<<<<<<<<<<
20228  * fmax = self.bandFactor*self.fp
20229  * fmin = old_div(self.fp,self.bandFactor)
20230  */
20231  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1232, __pyx_L1_error)
20232  __pyx_cur_scope->__pyx_v_self->mwl = __pyx_t_8;
20233 
20234  /* "WaveTools.py":1233
20235  * self.N = N
20236  * self.mwl = mwl
20237  * fmax = self.bandFactor*self.fp # <<<<<<<<<<<<<<
20238  * fmin = old_div(self.fp,self.bandFactor)
20239  * self.df = old_div((fmax-fmin),float(self.N-1))
20240  */
20241  __pyx_v_fmax = (__pyx_cur_scope->__pyx_v_self->bandFactor * __pyx_cur_scope->__pyx_v_self->fp);
20242 
20243  /* "WaveTools.py":1234
20244  * self.mwl = mwl
20245  * fmax = self.bandFactor*self.fp
20246  * fmin = old_div(self.fp,self.bandFactor) # <<<<<<<<<<<<<<
20247  * self.df = old_div((fmax-fmin),float(self.N-1))
20248  * self.fi = np.linspace(fmin,fmax,self.N)
20249  */
20250  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1234, __pyx_L1_error)
20251  __Pyx_GOTREF(__pyx_t_6);
20252  __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->fp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error)
20253  __Pyx_GOTREF(__pyx_t_3);
20254  __pyx_t_4 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->bandFactor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1234, __pyx_L1_error)
20255  __Pyx_GOTREF(__pyx_t_4);
20256  __pyx_t_2 = NULL;
20257  __pyx_t_5 = 0;
20258  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
20259  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
20260  if (likely(__pyx_t_2)) {
20261  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20262  __Pyx_INCREF(__pyx_t_2);
20263  __Pyx_INCREF(function);
20264  __Pyx_DECREF_SET(__pyx_t_6, function);
20265  __pyx_t_5 = 1;
20266  }
20267  }
20268  #if CYTHON_FAST_PYCALL
20269  if (PyFunction_Check(__pyx_t_6)) {
20270  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_4};
20271  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1234, __pyx_L1_error)
20272  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20273  __Pyx_GOTREF(__pyx_t_7);
20274  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20275  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20276  } else
20277  #endif
20278  #if CYTHON_FAST_PYCCALL
20279  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
20280  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_4};
20281  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1234, __pyx_L1_error)
20282  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20283  __Pyx_GOTREF(__pyx_t_7);
20284  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20285  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20286  } else
20287  #endif
20288  {
20289  __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1234, __pyx_L1_error)
20290  __Pyx_GOTREF(__pyx_t_9);
20291  if (__pyx_t_2) {
20292  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
20293  }
20294  __Pyx_GIVEREF(__pyx_t_3);
20295  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_3);
20296  __Pyx_GIVEREF(__pyx_t_4);
20297  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_4);
20298  __pyx_t_3 = 0;
20299  __pyx_t_4 = 0;
20300  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1234, __pyx_L1_error)
20301  __Pyx_GOTREF(__pyx_t_7);
20302  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20303  }
20304  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20305  __pyx_v_fmin = __pyx_t_7;
20306  __pyx_t_7 = 0;
20307 
20308  /* "WaveTools.py":1235
20309  * fmax = self.bandFactor*self.fp
20310  * fmin = old_div(self.fp,self.bandFactor)
20311  * self.df = old_div((fmax-fmin),float(self.N-1)) # <<<<<<<<<<<<<<
20312  * self.fi = np.linspace(fmin,fmax,self.N)
20313  * self.omega = 2.*M_PI*self.fi
20314  */
20315  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1235, __pyx_L1_error)
20316  __Pyx_GOTREF(__pyx_t_6);
20317  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_fmax); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1235, __pyx_L1_error)
20318  __Pyx_GOTREF(__pyx_t_9);
20319  __pyx_t_4 = PyNumber_Subtract(__pyx_t_9, __pyx_v_fmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error)
20320  __Pyx_GOTREF(__pyx_t_4);
20321  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20322  __pyx_t_9 = PyFloat_FromDouble(((double)(__pyx_cur_scope->__pyx_v_self->N - 1))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1235, __pyx_L1_error)
20323  __Pyx_GOTREF(__pyx_t_9);
20324  __pyx_t_3 = NULL;
20325  __pyx_t_5 = 0;
20326  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
20327  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
20328  if (likely(__pyx_t_3)) {
20329  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
20330  __Pyx_INCREF(__pyx_t_3);
20331  __Pyx_INCREF(function);
20332  __Pyx_DECREF_SET(__pyx_t_6, function);
20333  __pyx_t_5 = 1;
20334  }
20335  }
20336  #if CYTHON_FAST_PYCALL
20337  if (PyFunction_Check(__pyx_t_6)) {
20338  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_9};
20339  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
20340  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20341  __Pyx_GOTREF(__pyx_t_7);
20342  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20343  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20344  } else
20345  #endif
20346  #if CYTHON_FAST_PYCCALL
20347  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
20348  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_9};
20349  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
20350  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20351  __Pyx_GOTREF(__pyx_t_7);
20352  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20353  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20354  } else
20355  #endif
20356  {
20357  __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1235, __pyx_L1_error)
20358  __Pyx_GOTREF(__pyx_t_2);
20359  if (__pyx_t_3) {
20360  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
20361  }
20362  __Pyx_GIVEREF(__pyx_t_4);
20363  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_t_4);
20364  __Pyx_GIVEREF(__pyx_t_9);
20365  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_t_9);
20366  __pyx_t_4 = 0;
20367  __pyx_t_9 = 0;
20368  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
20369  __Pyx_GOTREF(__pyx_t_7);
20370  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20371  }
20372  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20373  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L1_error)
20374  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20375  __pyx_cur_scope->__pyx_v_self->df = __pyx_t_8;
20376 
20377  /* "WaveTools.py":1236
20378  * fmin = old_div(self.fp,self.bandFactor)
20379  * self.df = old_div((fmax-fmin),float(self.N-1))
20380  * self.fi = np.linspace(fmin,fmax,self.N) # <<<<<<<<<<<<<<
20381  * self.omega = 2.*M_PI*self.fi
20382  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
20383  */
20384  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L1_error)
20385  __Pyx_GOTREF(__pyx_t_6);
20386  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_linspace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error)
20387  __Pyx_GOTREF(__pyx_t_2);
20388  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20389  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_fmax); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L1_error)
20390  __Pyx_GOTREF(__pyx_t_6);
20391  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->N); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1236, __pyx_L1_error)
20392  __Pyx_GOTREF(__pyx_t_9);
20393  __pyx_t_4 = NULL;
20394  __pyx_t_5 = 0;
20395  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20396  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20397  if (likely(__pyx_t_4)) {
20398  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20399  __Pyx_INCREF(__pyx_t_4);
20400  __Pyx_INCREF(function);
20401  __Pyx_DECREF_SET(__pyx_t_2, function);
20402  __pyx_t_5 = 1;
20403  }
20404  }
20405  #if CYTHON_FAST_PYCALL
20406  if (PyFunction_Check(__pyx_t_2)) {
20407  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_fmin, __pyx_t_6, __pyx_t_9};
20408  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L1_error)
20409  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20410  __Pyx_GOTREF(__pyx_t_7);
20411  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20412  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20413  } else
20414  #endif
20415  #if CYTHON_FAST_PYCCALL
20416  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20417  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_fmin, __pyx_t_6, __pyx_t_9};
20418  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L1_error)
20419  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20420  __Pyx_GOTREF(__pyx_t_7);
20421  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20422  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20423  } else
20424  #endif
20425  {
20426  __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
20427  __Pyx_GOTREF(__pyx_t_3);
20428  if (__pyx_t_4) {
20429  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
20430  }
20431  __Pyx_INCREF(__pyx_v_fmin);
20432  __Pyx_GIVEREF(__pyx_v_fmin);
20433  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_fmin);
20434  __Pyx_GIVEREF(__pyx_t_6);
20435  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_t_6);
20436  __Pyx_GIVEREF(__pyx_t_9);
20437  PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_t_9);
20438  __pyx_t_6 = 0;
20439  __pyx_t_9 = 0;
20440  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L1_error)
20441  __Pyx_GOTREF(__pyx_t_7);
20442  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20443  }
20444  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20445  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1236, __pyx_L1_error)
20446  __Pyx_GIVEREF(__pyx_t_7);
20447  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->fi);
20448  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fi));
20449  __pyx_cur_scope->__pyx_v_self->fi = ((PyArrayObject *)__pyx_t_7);
20450  __pyx_t_7 = 0;
20451 
20452  /* "WaveTools.py":1237
20453  * self.df = old_div((fmax-fmin),float(self.N-1))
20454  * self.fi = np.linspace(fmin,fmax,self.N)
20455  * self.omega = 2.*M_PI*self.fi # <<<<<<<<<<<<<<
20456  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
20457  * fim = reduceToIntervals(self.fi,self.df)
20458  */
20459  __pyx_t_7 = PyFloat_FromDouble((2. * M_PI)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1237, __pyx_L1_error)
20460  __Pyx_GOTREF(__pyx_t_7);
20461  __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fi)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error)
20462  __Pyx_GOTREF(__pyx_t_2);
20463  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20464  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1237, __pyx_L1_error)
20465  __Pyx_GIVEREF(__pyx_t_2);
20466  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->omega);
20467  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->omega));
20468  __pyx_cur_scope->__pyx_v_self->omega = ((PyArrayObject *)__pyx_t_2);
20469  __pyx_t_2 = 0;
20470 
20471  /* "WaveTools.py":1238
20472  * self.fi = np.linspace(fmin,fmax,self.N)
20473  * self.omega = 2.*M_PI*self.fi
20474  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs) # <<<<<<<<<<<<<<
20475  * fim = reduceToIntervals(self.fi,self.df)
20476  * self.fim = fim
20477  */
20478  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1238, __pyx_L1_error)
20479  __Pyx_GOTREF(__pyx_t_2);
20480  __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->depth); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error)
20481  __Pyx_GOTREF(__pyx_t_7);
20482  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
20483  __Pyx_GOTREF(__pyx_t_3);
20484  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->omega));
20485  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->omega));
20486  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_self->omega));
20487  __Pyx_GIVEREF(__pyx_t_7);
20488  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
20489  __pyx_t_7 = 0;
20490  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error)
20491  __Pyx_GOTREF(__pyx_t_7);
20492  __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->gAbs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1238, __pyx_L1_error)
20493  __Pyx_GOTREF(__pyx_t_9);
20494  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_g, __pyx_t_9) < 0) __PYX_ERR(0, 1238, __pyx_L1_error)
20495  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20496  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1238, __pyx_L1_error)
20497  __Pyx_GOTREF(__pyx_t_9);
20498  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20499  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20500  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20501  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1238, __pyx_L1_error)
20502  __Pyx_GIVEREF(__pyx_t_9);
20503  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->ki);
20504  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->ki));
20505  __pyx_cur_scope->__pyx_v_self->ki = ((PyArrayObject *)__pyx_t_9);
20506  __pyx_t_9 = 0;
20507 
20508  /* "WaveTools.py":1239
20509  * self.omega = 2.*M_PI*self.fi
20510  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
20511  * fim = reduceToIntervals(self.fi,self.df) # <<<<<<<<<<<<<<
20512  * self.fim = fim
20513  * wim = 2*np.pi*self.fim
20514  */
20515  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_reduceToIntervals); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1239, __pyx_L1_error)
20516  __Pyx_GOTREF(__pyx_t_7);
20517  __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->df); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error)
20518  __Pyx_GOTREF(__pyx_t_3);
20519  __pyx_t_2 = NULL;
20520  __pyx_t_5 = 0;
20521  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
20522  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
20523  if (likely(__pyx_t_2)) {
20524  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20525  __Pyx_INCREF(__pyx_t_2);
20526  __Pyx_INCREF(function);
20527  __Pyx_DECREF_SET(__pyx_t_7, function);
20528  __pyx_t_5 = 1;
20529  }
20530  }
20531  #if CYTHON_FAST_PYCALL
20532  if (PyFunction_Check(__pyx_t_7)) {
20533  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fi), __pyx_t_3};
20534  __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1239, __pyx_L1_error)
20535  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20536  __Pyx_GOTREF(__pyx_t_9);
20537  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20538  } else
20539  #endif
20540  #if CYTHON_FAST_PYCCALL
20541  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
20542  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fi), __pyx_t_3};
20543  __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1239, __pyx_L1_error)
20544  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20545  __Pyx_GOTREF(__pyx_t_9);
20546  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20547  } else
20548  #endif
20549  {
20550  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1239, __pyx_L1_error)
20551  __Pyx_GOTREF(__pyx_t_6);
20552  if (__pyx_t_2) {
20553  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
20554  }
20555  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fi));
20556  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fi));
20557  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fi));
20558  __Pyx_GIVEREF(__pyx_t_3);
20559  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
20560  __pyx_t_3 = 0;
20561  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1239, __pyx_L1_error)
20562  __Pyx_GOTREF(__pyx_t_9);
20563  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20564  }
20565  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20566  __pyx_v_fim = __pyx_t_9;
20567  __pyx_t_9 = 0;
20568 
20569  /* "WaveTools.py":1240
20570  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
20571  * fim = reduceToIntervals(self.fi,self.df)
20572  * self.fim = fim # <<<<<<<<<<<<<<
20573  * wim = 2*np.pi*self.fim
20574  * if (spectral_params is None):
20575  */
20576  if (!(likely(((__pyx_v_fim) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_fim, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1240, __pyx_L1_error)
20577  __pyx_t_9 = __pyx_v_fim;
20578  __Pyx_INCREF(__pyx_t_9);
20579  __Pyx_GIVEREF(__pyx_t_9);
20580  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->fim);
20581  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fim));
20582  __pyx_cur_scope->__pyx_v_self->fim = ((PyArrayObject *)__pyx_t_9);
20583  __pyx_t_9 = 0;
20584 
20585  /* "WaveTools.py":1241
20586  * fim = reduceToIntervals(self.fi,self.df)
20587  * self.fim = fim
20588  * wim = 2*np.pi*self.fim # <<<<<<<<<<<<<<
20589  * if (spectral_params is None):
20590  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
20591  */
20592  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1241, __pyx_L1_error)
20593  __Pyx_GOTREF(__pyx_t_9);
20594  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pi); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1241, __pyx_L1_error)
20595  __Pyx_GOTREF(__pyx_t_7);
20596  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20597  __pyx_t_9 = PyNumber_Multiply(__pyx_int_2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1241, __pyx_L1_error)
20598  __Pyx_GOTREF(__pyx_t_9);
20599  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20600  __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fim)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1241, __pyx_L1_error)
20601  __Pyx_GOTREF(__pyx_t_7);
20602  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20603  __pyx_v_wim = __pyx_t_7;
20604  __pyx_t_7 = 0;
20605 
20606  /* "WaveTools.py":1242
20607  * self.fim = fim
20608  * wim = 2*np.pi*self.fim
20609  * if (spectral_params is None): # <<<<<<<<<<<<<<
20610  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
20611  * else:
20612  */
20613  __pyx_t_10 = (__pyx_v_spectral_params == Py_None);
20614  __pyx_t_11 = (__pyx_t_10 != 0);
20615  if (__pyx_t_11) {
20616 
20617  /* "WaveTools.py":1243
20618  * wim = 2*np.pi*self.fim
20619  * if (spectral_params is None):
20620  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs) # <<<<<<<<<<<<<<
20621  * else:
20622  * try:
20623  */
20624  __pyx_t_9 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->fp); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1243, __pyx_L1_error)
20625  __Pyx_GOTREF(__pyx_t_9);
20626  __pyx_t_6 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->Hs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1243, __pyx_L1_error)
20627  __Pyx_GOTREF(__pyx_t_6);
20628  __Pyx_INCREF(__pyx_v_spec_fun);
20629  __pyx_t_3 = __pyx_v_spec_fun; __pyx_t_2 = NULL;
20630  __pyx_t_5 = 0;
20631  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
20632  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20633  if (likely(__pyx_t_2)) {
20634  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20635  __Pyx_INCREF(__pyx_t_2);
20636  __Pyx_INCREF(function);
20637  __Pyx_DECREF_SET(__pyx_t_3, function);
20638  __pyx_t_5 = 1;
20639  }
20640  }
20641  #if CYTHON_FAST_PYCALL
20642  if (PyFunction_Check(__pyx_t_3)) {
20643  PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_fim, __pyx_t_9, __pyx_t_6};
20644  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1243, __pyx_L1_error)
20645  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20646  __Pyx_GOTREF(__pyx_t_7);
20647  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20648  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20649  } else
20650  #endif
20651  #if CYTHON_FAST_PYCCALL
20652  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
20653  PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_fim, __pyx_t_9, __pyx_t_6};
20654  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1243, __pyx_L1_error)
20655  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20656  __Pyx_GOTREF(__pyx_t_7);
20657  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20658  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20659  } else
20660  #endif
20661  {
20662  __pyx_t_4 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error)
20663  __Pyx_GOTREF(__pyx_t_4);
20664  if (__pyx_t_2) {
20665  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
20666  }
20667  __Pyx_INCREF(__pyx_v_fim);
20668  __Pyx_GIVEREF(__pyx_v_fim);
20669  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_fim);
20670  __Pyx_GIVEREF(__pyx_t_9);
20671  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_9);
20672  __Pyx_GIVEREF(__pyx_t_6);
20673  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_t_6);
20674  __pyx_t_9 = 0;
20675  __pyx_t_6 = 0;
20676  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1243, __pyx_L1_error)
20677  __Pyx_GOTREF(__pyx_t_7);
20678  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20679  }
20680  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20681  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1243, __pyx_L1_error)
20682  __Pyx_GIVEREF(__pyx_t_7);
20683  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->Si_Jm);
20684  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
20685  __pyx_cur_scope->__pyx_v_self->Si_Jm = ((PyArrayObject *)__pyx_t_7);
20686  __pyx_t_7 = 0;
20687 
20688  /* "WaveTools.py":1242
20689  * self.fim = fim
20690  * wim = 2*np.pi*self.fim
20691  * if (spectral_params is None): # <<<<<<<<<<<<<<
20692  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
20693  * else:
20694  */
20695  goto __pyx_L3;
20696  }
20697 
20698  /* "WaveTools.py":1245
20699  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
20700  * else:
20701  * try: # <<<<<<<<<<<<<<
20702  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
20703  * except:
20704  */
20705  /*else*/ {
20706  {
20707  __Pyx_PyThreadState_declare
20708  __Pyx_PyThreadState_assign
20709  __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
20710  __Pyx_XGOTREF(__pyx_t_12);
20711  __Pyx_XGOTREF(__pyx_t_13);
20712  __Pyx_XGOTREF(__pyx_t_14);
20713  /*try:*/ {
20714 
20715  /* "WaveTools.py":1246
20716  * else:
20717  * try:
20718  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params) # <<<<<<<<<<<<<<
20719  * except:
20720  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName)
20721  */
20722  __pyx_t_7 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->fp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1246, __pyx_L4_error)
20723  __Pyx_GOTREF(__pyx_t_7);
20724  __pyx_t_3 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->Hs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L4_error)
20725  __Pyx_GOTREF(__pyx_t_3);
20726  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L4_error)
20727  __Pyx_GOTREF(__pyx_t_4);
20728  __Pyx_INCREF(__pyx_v_fim);
20729  __Pyx_GIVEREF(__pyx_v_fim);
20730  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fim);
20731  __Pyx_GIVEREF(__pyx_t_7);
20732  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
20733  __Pyx_GIVEREF(__pyx_t_3);
20734  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
20735  __pyx_t_7 = 0;
20736  __pyx_t_3 = 0;
20737  if (unlikely(__pyx_v_spectral_params == Py_None)) {
20738  PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
20739  __PYX_ERR(0, 1246, __pyx_L4_error)
20740  }
20741  if (likely(PyDict_CheckExact(__pyx_v_spectral_params))) {
20742  __pyx_t_3 = PyDict_Copy(__pyx_v_spectral_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L4_error)
20743  __Pyx_GOTREF(__pyx_t_3);
20744  } else {
20745  __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_spectral_params, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L4_error)
20746  __Pyx_GOTREF(__pyx_t_3);
20747  }
20748  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_spec_fun, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1246, __pyx_L4_error)
20749  __Pyx_GOTREF(__pyx_t_7);
20750  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20751  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20752  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1246, __pyx_L4_error)
20753  __Pyx_GIVEREF(__pyx_t_7);
20754  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->Si_Jm);
20755  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
20756  __pyx_cur_scope->__pyx_v_self->Si_Jm = ((PyArrayObject *)__pyx_t_7);
20757  __pyx_t_7 = 0;
20758 
20759  /* "WaveTools.py":1245
20760  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
20761  * else:
20762  * try: # <<<<<<<<<<<<<<
20763  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
20764  * except:
20765  */
20766  }
20767  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
20768  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
20769  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
20770  goto __pyx_L9_try_end;
20771  __pyx_L4_error:;
20772  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20773  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20774  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20775  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20776  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20777  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20778 
20779  /* "WaveTools.py":1247
20780  * try:
20781  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
20782  * except: # <<<<<<<<<<<<<<
20783  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName)
20784  * sys.exit(1)
20785  */
20786  /*except:*/ {
20787  __Pyx_AddTraceback("WaveTools.NewWave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20788  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 1247, __pyx_L6_except_error)
20789  __Pyx_GOTREF(__pyx_t_7);
20790  __Pyx_GOTREF(__pyx_t_3);
20791  __Pyx_GOTREF(__pyx_t_4);
20792 
20793  /* "WaveTools.py":1248
20794  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
20795  * except:
20796  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName) # <<<<<<<<<<<<<<
20797  * sys.exit(1)
20798  *
20799  */
20800  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1248, __pyx_L6_except_error)
20801  __Pyx_GOTREF(__pyx_t_9);
20802  __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ERROR_Wavetools_py_Additional_sp, __pyx_v_spectName); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1248, __pyx_L6_except_error)
20803  __Pyx_GOTREF(__pyx_t_2);
20804  __pyx_t_15 = NULL;
20805  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
20806  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_9);
20807  if (likely(__pyx_t_15)) {
20808  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
20809  __Pyx_INCREF(__pyx_t_15);
20810  __Pyx_INCREF(function);
20811  __Pyx_DECREF_SET(__pyx_t_9, function);
20812  }
20813  }
20814  __pyx_t_6 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2);
20815  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
20816  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20817  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L6_except_error)
20818  __Pyx_GOTREF(__pyx_t_6);
20819  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20820  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20821 
20822  /* "WaveTools.py":1249
20823  * except:
20824  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName)
20825  * sys.exit(1) # <<<<<<<<<<<<<<
20826  *
20827  * self.tanhF = np.zeros(N,"d")
20828  */
20829  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1249, __pyx_L6_except_error)
20830  __Pyx_GOTREF(__pyx_t_9);
20831  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L6_except_error)
20832  __Pyx_GOTREF(__pyx_t_2);
20833  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20834  __pyx_t_9 = NULL;
20835  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20836  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
20837  if (likely(__pyx_t_9)) {
20838  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20839  __Pyx_INCREF(__pyx_t_9);
20840  __Pyx_INCREF(function);
20841  __Pyx_DECREF_SET(__pyx_t_2, function);
20842  }
20843  }
20844  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
20845  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20846  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1249, __pyx_L6_except_error)
20847  __Pyx_GOTREF(__pyx_t_6);
20848  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20849  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20850  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
20851  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20852  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20853  goto __pyx_L5_exception_handled;
20854  }
20855  __pyx_L6_except_error:;
20856 
20857  /* "WaveTools.py":1245
20858  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
20859  * else:
20860  * try: # <<<<<<<<<<<<<<
20861  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
20862  * except:
20863  */
20864  __Pyx_XGIVEREF(__pyx_t_12);
20865  __Pyx_XGIVEREF(__pyx_t_13);
20866  __Pyx_XGIVEREF(__pyx_t_14);
20867  __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
20868  goto __pyx_L1_error;
20869  __pyx_L5_exception_handled:;
20870  __Pyx_XGIVEREF(__pyx_t_12);
20871  __Pyx_XGIVEREF(__pyx_t_13);
20872  __Pyx_XGIVEREF(__pyx_t_14);
20873  __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
20874  __pyx_L9_try_end:;
20875  }
20876  }
20877  __pyx_L3:;
20878 
20879  /* "WaveTools.py":1251
20880  * sys.exit(1)
20881  *
20882  * self.tanhF = np.zeros(N,"d") # <<<<<<<<<<<<<<
20883  * for ii in range(self.N):
20884  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
20885  */
20886  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
20887  __Pyx_GOTREF(__pyx_t_3);
20888  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error)
20889  __Pyx_GOTREF(__pyx_t_7);
20890  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20891  __pyx_t_3 = NULL;
20892  __pyx_t_5 = 0;
20893  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
20894  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
20895  if (likely(__pyx_t_3)) {
20896  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20897  __Pyx_INCREF(__pyx_t_3);
20898  __Pyx_INCREF(function);
20899  __Pyx_DECREF_SET(__pyx_t_7, function);
20900  __pyx_t_5 = 1;
20901  }
20902  }
20903  #if CYTHON_FAST_PYCALL
20904  if (PyFunction_Check(__pyx_t_7)) {
20905  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_N, __pyx_n_s_d};
20906  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error)
20907  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20908  __Pyx_GOTREF(__pyx_t_4);
20909  } else
20910  #endif
20911  #if CYTHON_FAST_PYCCALL
20912  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
20913  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_N, __pyx_n_s_d};
20914  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error)
20915  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20916  __Pyx_GOTREF(__pyx_t_4);
20917  } else
20918  #endif
20919  {
20920  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error)
20921  __Pyx_GOTREF(__pyx_t_6);
20922  if (__pyx_t_3) {
20923  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
20924  }
20925  __Pyx_INCREF(__pyx_v_N);
20926  __Pyx_GIVEREF(__pyx_v_N);
20927  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_N);
20928  __Pyx_INCREF(__pyx_n_s_d);
20929  __Pyx_GIVEREF(__pyx_n_s_d);
20930  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_d);
20931  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error)
20932  __Pyx_GOTREF(__pyx_t_4);
20933  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20934  }
20935  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20936  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1251, __pyx_L1_error)
20937  __Pyx_GIVEREF(__pyx_t_4);
20938  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->tanhF);
20939  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->tanhF));
20940  __pyx_cur_scope->__pyx_v_self->tanhF = ((PyArrayObject *)__pyx_t_4);
20941  __pyx_t_4 = 0;
20942 
20943  /* "WaveTools.py":1252
20944  *
20945  * self.tanhF = np.zeros(N,"d")
20946  * for ii in range(self.N): # <<<<<<<<<<<<<<
20947  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
20948  *
20949  */
20950  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error)
20951  __Pyx_GOTREF(__pyx_t_7);
20952  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error)
20953  __Pyx_GOTREF(__pyx_t_6);
20954  __pyx_t_3 = NULL;
20955  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
20956  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
20957  if (likely(__pyx_t_3)) {
20958  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20959  __Pyx_INCREF(__pyx_t_3);
20960  __Pyx_INCREF(function);
20961  __Pyx_DECREF_SET(__pyx_t_7, function);
20962  }
20963  }
20964  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20965  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
20966  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20967  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1252, __pyx_L1_error)
20968  __Pyx_GOTREF(__pyx_t_4);
20969  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20970  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
20971  __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_16 = 0;
20972  __pyx_t_17 = NULL;
20973  } else {
20974  __pyx_t_16 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error)
20975  __Pyx_GOTREF(__pyx_t_7);
20976  __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1252, __pyx_L1_error)
20977  }
20978  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20979  for (;;) {
20980  if (likely(!__pyx_t_17)) {
20981  if (likely(PyList_CheckExact(__pyx_t_7))) {
20982  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_7)) break;
20983  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20984  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1252, __pyx_L1_error)
20985  #else
20986  __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1252, __pyx_L1_error)
20987  __Pyx_GOTREF(__pyx_t_4);
20988  #endif
20989  } else {
20990  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
20991  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
20992  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1252, __pyx_L1_error)
20993  #else
20994  __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1252, __pyx_L1_error)
20995  __Pyx_GOTREF(__pyx_t_4);
20996  #endif
20997  }
20998  } else {
20999  __pyx_t_4 = __pyx_t_17(__pyx_t_7);
21000  if (unlikely(!__pyx_t_4)) {
21001  PyObject* exc_type = PyErr_Occurred();
21002  if (exc_type) {
21003  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21004  else __PYX_ERR(0, 1252, __pyx_L1_error)
21005  }
21006  break;
21007  }
21008  __Pyx_GOTREF(__pyx_t_4);
21009  }
21010  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_4);
21011  __pyx_t_4 = 0;
21012 
21013  /* "WaveTools.py":1253
21014  * self.tanhF = np.zeros(N,"d")
21015  * for ii in range(self.N):
21016  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) ) # <<<<<<<<<<<<<<
21017  *
21018  * mm = np.sum(returnRectangles(self.Si_Jm,wim))
21019  */
21020  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1253, __pyx_L1_error)
21021  __Pyx_GOTREF(__pyx_t_6);
21022  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tanh); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error)
21023  __Pyx_GOTREF(__pyx_t_3);
21024  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21025  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->ki), __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1253, __pyx_L1_error)
21026  __Pyx_GOTREF(__pyx_t_6);
21027  __pyx_t_2 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1253, __pyx_L1_error)
21028  __Pyx_GOTREF(__pyx_t_2);
21029  __pyx_t_9 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1253, __pyx_L1_error)
21030  __Pyx_GOTREF(__pyx_t_9);
21031  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21032  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21033  __pyx_t_2 = NULL;
21034  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
21035  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
21036  if (likely(__pyx_t_2)) {
21037  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21038  __Pyx_INCREF(__pyx_t_2);
21039  __Pyx_INCREF(function);
21040  __Pyx_DECREF_SET(__pyx_t_3, function);
21041  }
21042  }
21043  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9);
21044  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21045  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21046  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1253, __pyx_L1_error)
21047  __Pyx_GOTREF(__pyx_t_4);
21048  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21049  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1253, __pyx_L1_error)
21050  __Pyx_GOTREF(__pyx_t_3);
21051  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21052  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->tanhF), __pyx_v_ii, __pyx_t_3) < 0)) __PYX_ERR(0, 1253, __pyx_L1_error)
21053  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21054 
21055  /* "WaveTools.py":1252
21056  *
21057  * self.tanhF = np.zeros(N,"d")
21058  * for ii in range(self.N): # <<<<<<<<<<<<<<
21059  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
21060  *
21061  */
21062  }
21063  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21064 
21065  /* "WaveTools.py":1255
21066  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
21067  *
21068  * mm = np.sum(returnRectangles(self.Si_Jm,wim)) # <<<<<<<<<<<<<<
21069  * m0 = Hs*Hs/16.
21070  * An = np.sqrt(2.*m0*np.log(Nmax))
21071  */
21072  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
21073  __Pyx_GOTREF(__pyx_t_3);
21074  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1255, __pyx_L1_error)
21075  __Pyx_GOTREF(__pyx_t_4);
21076  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21077  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_returnRectangles); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1255, __pyx_L1_error)
21078  __Pyx_GOTREF(__pyx_t_9);
21079  __pyx_t_2 = NULL;
21080  __pyx_t_5 = 0;
21081  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
21082  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
21083  if (likely(__pyx_t_2)) {
21084  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21085  __Pyx_INCREF(__pyx_t_2);
21086  __Pyx_INCREF(function);
21087  __Pyx_DECREF_SET(__pyx_t_9, function);
21088  __pyx_t_5 = 1;
21089  }
21090  }
21091  #if CYTHON_FAST_PYCALL
21092  if (PyFunction_Check(__pyx_t_9)) {
21093  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm), __pyx_v_wim};
21094  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
21095  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21096  __Pyx_GOTREF(__pyx_t_3);
21097  } else
21098  #endif
21099  #if CYTHON_FAST_PYCCALL
21100  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
21101  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm), __pyx_v_wim};
21102  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
21103  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21104  __Pyx_GOTREF(__pyx_t_3);
21105  } else
21106  #endif
21107  {
21108  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1255, __pyx_L1_error)
21109  __Pyx_GOTREF(__pyx_t_6);
21110  if (__pyx_t_2) {
21111  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
21112  }
21113  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
21114  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
21115  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
21116  __Pyx_INCREF(__pyx_v_wim);
21117  __Pyx_GIVEREF(__pyx_v_wim);
21118  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_wim);
21119  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
21120  __Pyx_GOTREF(__pyx_t_3);
21121  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21122  }
21123  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21124  __pyx_t_9 = NULL;
21125  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
21126  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
21127  if (likely(__pyx_t_9)) {
21128  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21129  __Pyx_INCREF(__pyx_t_9);
21130  __Pyx_INCREF(function);
21131  __Pyx_DECREF_SET(__pyx_t_4, function);
21132  }
21133  }
21134  __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
21135  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21137  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1255, __pyx_L1_error)
21138  __Pyx_GOTREF(__pyx_t_7);
21139  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21140  __pyx_v_mm = __pyx_t_7;
21141  __pyx_t_7 = 0;
21142 
21143  /* "WaveTools.py":1256
21144  *
21145  * mm = np.sum(returnRectangles(self.Si_Jm,wim))
21146  * m0 = Hs*Hs/16. # <<<<<<<<<<<<<<
21147  * An = np.sqrt(2.*m0*np.log(Nmax))
21148  * self.ai = An*returnRectangles(self.Si_Jm,wim)/mm
21149  */
21150  __pyx_t_7 = PyNumber_Multiply(__pyx_v_Hs, __pyx_v_Hs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1256, __pyx_L1_error)
21151  __Pyx_GOTREF(__pyx_t_7);
21152  __pyx_t_4 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_7, __pyx_float_16_, 16., 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1256, __pyx_L1_error)
21153  __Pyx_GOTREF(__pyx_t_4);
21154  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21155  __pyx_v_m0 = __pyx_t_4;
21156  __pyx_t_4 = 0;
21157 
21158  /* "WaveTools.py":1257
21159  * mm = np.sum(returnRectangles(self.Si_Jm,wim))
21160  * m0 = Hs*Hs/16.
21161  * An = np.sqrt(2.*m0*np.log(Nmax)) # <<<<<<<<<<<<<<
21162  * self.ai = An*returnRectangles(self.Si_Jm,wim)/mm
21163  * self.kDir = np.zeros((len(self.ki),3),)
21164  */
21165  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1257, __pyx_L1_error)
21166  __Pyx_GOTREF(__pyx_t_7);
21167  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error)
21168  __Pyx_GOTREF(__pyx_t_3);
21169  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21170  __pyx_t_7 = PyNumber_Multiply(__pyx_float_2_, __pyx_v_m0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1257, __pyx_L1_error)
21171  __Pyx_GOTREF(__pyx_t_7);
21172  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1257, __pyx_L1_error)
21173  __Pyx_GOTREF(__pyx_t_6);
21174  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error)
21175  __Pyx_GOTREF(__pyx_t_2);
21176  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21177  __pyx_t_6 = NULL;
21178  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21179  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
21180  if (likely(__pyx_t_6)) {
21181  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21182  __Pyx_INCREF(__pyx_t_6);
21183  __Pyx_INCREF(function);
21184  __Pyx_DECREF_SET(__pyx_t_2, function);
21185  }
21186  }
21187  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_Nmax) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_Nmax);
21188  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
21189  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1257, __pyx_L1_error)
21190  __Pyx_GOTREF(__pyx_t_9);
21191  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21192  __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error)
21193  __Pyx_GOTREF(__pyx_t_2);
21194  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21195  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21196  __pyx_t_9 = NULL;
21197  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
21198  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
21199  if (likely(__pyx_t_9)) {
21200  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21201  __Pyx_INCREF(__pyx_t_9);
21202  __Pyx_INCREF(function);
21203  __Pyx_DECREF_SET(__pyx_t_3, function);
21204  }
21205  }
21206  __pyx_t_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
21207  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21208  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21209  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1257, __pyx_L1_error)
21210  __Pyx_GOTREF(__pyx_t_4);
21211  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21212  __pyx_v_An = __pyx_t_4;
21213  __pyx_t_4 = 0;
21214 
21215  /* "WaveTools.py":1258
21216  * m0 = Hs*Hs/16.
21217  * An = np.sqrt(2.*m0*np.log(Nmax))
21218  * self.ai = An*returnRectangles(self.Si_Jm,wim)/mm # <<<<<<<<<<<<<<
21219  * self.kDir = np.zeros((len(self.ki),3),)
21220  * for ii in range(3):
21221  */
21222  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_returnRectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
21223  __Pyx_GOTREF(__pyx_t_3);
21224  __pyx_t_2 = NULL;
21225  __pyx_t_5 = 0;
21226  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
21227  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
21228  if (likely(__pyx_t_2)) {
21229  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21230  __Pyx_INCREF(__pyx_t_2);
21231  __Pyx_INCREF(function);
21232  __Pyx_DECREF_SET(__pyx_t_3, function);
21233  __pyx_t_5 = 1;
21234  }
21235  }
21236  #if CYTHON_FAST_PYCALL
21237  if (PyFunction_Check(__pyx_t_3)) {
21238  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm), __pyx_v_wim};
21239  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
21240  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21241  __Pyx_GOTREF(__pyx_t_4);
21242  } else
21243  #endif
21244  #if CYTHON_FAST_PYCCALL
21245  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
21246  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm), __pyx_v_wim};
21247  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
21248  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21249  __Pyx_GOTREF(__pyx_t_4);
21250  } else
21251  #endif
21252  {
21253  __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1258, __pyx_L1_error)
21254  __Pyx_GOTREF(__pyx_t_9);
21255  if (__pyx_t_2) {
21256  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
21257  }
21258  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
21259  __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
21260  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, ((PyObject *)__pyx_cur_scope->__pyx_v_self->Si_Jm));
21261  __Pyx_INCREF(__pyx_v_wim);
21262  __Pyx_GIVEREF(__pyx_v_wim);
21263  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_wim);
21264  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
21265  __Pyx_GOTREF(__pyx_t_4);
21266  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21267  }
21268  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21269  __pyx_t_3 = PyNumber_Multiply(__pyx_v_An, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
21270  __Pyx_GOTREF(__pyx_t_3);
21271  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21272  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_mm); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L1_error)
21273  __Pyx_GOTREF(__pyx_t_4);
21274  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21275  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1258, __pyx_L1_error)
21276  __Pyx_GIVEREF(__pyx_t_4);
21277  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->ai);
21278  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->ai));
21279  __pyx_cur_scope->__pyx_v_self->ai = ((PyArrayObject *)__pyx_t_4);
21280  __pyx_t_4 = 0;
21281 
21282  /* "WaveTools.py":1259
21283  * An = np.sqrt(2.*m0*np.log(Nmax))
21284  * self.ai = An*returnRectangles(self.Si_Jm,wim)/mm
21285  * self.kDir = np.zeros((len(self.ki),3),) # <<<<<<<<<<<<<<
21286  * for ii in range(3):
21287  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
21288  */
21289  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
21290  __Pyx_GOTREF(__pyx_t_3);
21291  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1259, __pyx_L1_error)
21292  __Pyx_GOTREF(__pyx_t_9);
21293  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21294  __pyx_t_3 = ((PyObject *)__pyx_cur_scope->__pyx_v_self->ki);
21295  __Pyx_INCREF(__pyx_t_3);
21296  __pyx_t_16 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1259, __pyx_L1_error)
21297  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21298  __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
21299  __Pyx_GOTREF(__pyx_t_3);
21300  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
21301  __Pyx_GOTREF(__pyx_t_2);
21302  __Pyx_GIVEREF(__pyx_t_3);
21303  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
21304  __Pyx_INCREF(__pyx_int_3);
21305  __Pyx_GIVEREF(__pyx_int_3);
21306  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_3);
21307  __pyx_t_3 = 0;
21308  __pyx_t_3 = NULL;
21309  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
21310  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
21311  if (likely(__pyx_t_3)) {
21312  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21313  __Pyx_INCREF(__pyx_t_3);
21314  __Pyx_INCREF(function);
21315  __Pyx_DECREF_SET(__pyx_t_9, function);
21316  }
21317  }
21318  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2);
21319  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
21320  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21321  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1259, __pyx_L1_error)
21322  __Pyx_GOTREF(__pyx_t_4);
21323  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21324  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1259, __pyx_L1_error)
21325  __Pyx_GIVEREF(__pyx_t_4);
21326  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->kDir);
21327  __Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->kDir));
21328  __pyx_cur_scope->__pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_4);
21329  __pyx_t_4 = 0;
21330 
21331  /* "WaveTools.py":1260
21332  * self.ai = An*returnRectangles(self.Si_Jm,wim)/mm
21333  * self.kDir = np.zeros((len(self.ki),3),)
21334  * for ii in range(3): # <<<<<<<<<<<<<<
21335  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
21336  * if(self.N > 10000):
21337  */
21338  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_range); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1260, __pyx_L1_error)
21339  __Pyx_GOTREF(__pyx_t_9);
21340  __pyx_t_2 = NULL;
21341  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
21342  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
21343  if (likely(__pyx_t_2)) {
21344  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21345  __Pyx_INCREF(__pyx_t_2);
21346  __Pyx_INCREF(function);
21347  __Pyx_DECREF_SET(__pyx_t_9, function);
21348  }
21349  }
21350  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_int_3);
21351  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21352  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1260, __pyx_L1_error)
21353  __Pyx_GOTREF(__pyx_t_4);
21354  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21355  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
21356  __pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_16 = 0;
21357  __pyx_t_17 = NULL;
21358  } else {
21359  __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1260, __pyx_L1_error)
21360  __Pyx_GOTREF(__pyx_t_9);
21361  __pyx_t_17 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1260, __pyx_L1_error)
21362  }
21363  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21364  for (;;) {
21365  if (likely(!__pyx_t_17)) {
21366  if (likely(PyList_CheckExact(__pyx_t_9))) {
21367  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_9)) break;
21368  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21369  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1260, __pyx_L1_error)
21370  #else
21371  __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1260, __pyx_L1_error)
21372  __Pyx_GOTREF(__pyx_t_4);
21373  #endif
21374  } else {
21375  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
21376  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21377  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_4); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1260, __pyx_L1_error)
21378  #else
21379  __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1260, __pyx_L1_error)
21380  __Pyx_GOTREF(__pyx_t_4);
21381  #endif
21382  }
21383  } else {
21384  __pyx_t_4 = __pyx_t_17(__pyx_t_9);
21385  if (unlikely(!__pyx_t_4)) {
21386  PyObject* exc_type = PyErr_Occurred();
21387  if (exc_type) {
21388  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21389  else __PYX_ERR(0, 1260, __pyx_L1_error)
21390  }
21391  break;
21392  }
21393  __Pyx_GOTREF(__pyx_t_4);
21394  }
21395  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_4);
21396  __pyx_t_4 = 0;
21397 
21398  /* "WaveTools.py":1261
21399  * self.kDir = np.zeros((len(self.ki),3),)
21400  * for ii in range(3):
21401  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii] # <<<<<<<<<<<<<<
21402  * if(self.N > 10000):
21403  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
21404  */
21405  __pyx_t_4 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_self->ki), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1261, __pyx_L1_error)
21406  __Pyx_GOTREF(__pyx_t_4);
21407  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir), __pyx_v_ii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error)
21408  __Pyx_GOTREF(__pyx_t_2);
21409  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error)
21410  __Pyx_GOTREF(__pyx_t_3);
21411  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21412  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21413  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error)
21414  __Pyx_GOTREF(__pyx_t_2);
21415  __Pyx_INCREF(__pyx_slice__4);
21416  __Pyx_GIVEREF(__pyx_slice__4);
21417  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__4);
21418  __Pyx_INCREF(__pyx_v_ii);
21419  __Pyx_GIVEREF(__pyx_v_ii);
21420  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ii);
21421  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->kDir), __pyx_t_2, __pyx_t_3) < 0)) __PYX_ERR(0, 1261, __pyx_L1_error)
21422  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21423  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21424 
21425  /* "WaveTools.py":1260
21426  * self.ai = An*returnRectangles(self.Si_Jm,wim)/mm
21427  * self.kDir = np.zeros((len(self.ki),3),)
21428  * for ii in range(3): # <<<<<<<<<<<<<<
21429  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
21430  * if(self.N > 10000):
21431  */
21432  }
21433  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21434 
21435  /* "WaveTools.py":1262
21436  * for ii in range(3):
21437  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
21438  * if(self.N > 10000): # <<<<<<<<<<<<<<
21439  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
21440  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega
21441  */
21442  __pyx_t_11 = ((__pyx_cur_scope->__pyx_v_self->N > 0x2710) != 0);
21443  if (__pyx_t_11) {
21444 
21445  /* "WaveTools.py":1263
21446  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
21447  * if(self.N > 10000):
21448  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0) # <<<<<<<<<<<<<<
21449  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega
21450  *
21451  */
21452  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1263, __pyx_L1_error)
21453  __Pyx_GOTREF(__pyx_t_9);
21454  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
21455  __Pyx_GOTREF(__pyx_t_3);
21456  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
21457  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__23, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
21458  __Pyx_GOTREF(__pyx_t_2);
21459  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21460  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21461  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21462 
21463  /* "WaveTools.py":1262
21464  * for ii in range(3):
21465  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
21466  * if(self.N > 10000): # <<<<<<<<<<<<<<
21467  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
21468  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega
21469  */
21470  }
21471 
21472  /* "WaveTools.py":1264
21473  * if(self.N > 10000):
21474  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
21475  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega # <<<<<<<<<<<<<<
21476  *
21477  *
21478  */
21479  __pyx_t_2 = __pyx_pf_9WaveTools_7NewWave_9__cinit___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L1_error)
21480  __Pyx_GOTREF(__pyx_t_2);
21481  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error)
21482  __Pyx_GOTREF(__pyx_t_3);
21483  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21484  __pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L1_error)
21485  __Pyx_GOTREF(__pyx_t_2);
21486  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21487  __pyx_t_3 = PyNumber_Multiply(__pyx_v_tfocus, ((PyObject *)__pyx_cur_scope->__pyx_v_self->omega)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error)
21488  __Pyx_GOTREF(__pyx_t_3);
21489  __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1264, __pyx_L1_error)
21490  __Pyx_GOTREF(__pyx_t_9);
21491  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21492  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21493  __Pyx_GIVEREF(__pyx_t_9);
21494  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->phi);
21495  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->phi);
21496  __pyx_cur_scope->__pyx_v_self->phi = __pyx_t_9;
21497  __pyx_t_9 = 0;
21498 
21499  /* "WaveTools.py":1268
21500  *
21501  * #C++ declarations
21502  * for ij in range(3): # <<<<<<<<<<<<<<
21503  * self.waveDir_c[ij] = self.waveDir[ij]
21504  * self.vDir_c[ij] = self.vDir[ij]
21505  */
21506  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error)
21507  __Pyx_GOTREF(__pyx_t_3);
21508  __pyx_t_2 = NULL;
21509  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
21510  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
21511  if (likely(__pyx_t_2)) {
21512  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
21513  __Pyx_INCREF(__pyx_t_2);
21514  __Pyx_INCREF(function);
21515  __Pyx_DECREF_SET(__pyx_t_3, function);
21516  }
21517  }
21518  __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
21519  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
21520  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1268, __pyx_L1_error)
21521  __Pyx_GOTREF(__pyx_t_9);
21522  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21523  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
21524  __pyx_t_3 = __pyx_t_9; __Pyx_INCREF(__pyx_t_3); __pyx_t_16 = 0;
21525  __pyx_t_17 = NULL;
21526  } else {
21527  __pyx_t_16 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1268, __pyx_L1_error)
21528  __Pyx_GOTREF(__pyx_t_3);
21529  __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1268, __pyx_L1_error)
21530  }
21531  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21532  for (;;) {
21533  if (likely(!__pyx_t_17)) {
21534  if (likely(PyList_CheckExact(__pyx_t_3))) {
21535  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_3)) break;
21536  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21537  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1268, __pyx_L1_error)
21538  #else
21539  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1268, __pyx_L1_error)
21540  __Pyx_GOTREF(__pyx_t_9);
21541  #endif
21542  } else {
21543  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
21544  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21545  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1268, __pyx_L1_error)
21546  #else
21547  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1268, __pyx_L1_error)
21548  __Pyx_GOTREF(__pyx_t_9);
21549  #endif
21550  }
21551  } else {
21552  __pyx_t_9 = __pyx_t_17(__pyx_t_3);
21553  if (unlikely(!__pyx_t_9)) {
21554  PyObject* exc_type = PyErr_Occurred();
21555  if (exc_type) {
21556  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21557  else __PYX_ERR(0, 1268, __pyx_L1_error)
21558  }
21559  break;
21560  }
21561  __Pyx_GOTREF(__pyx_t_9);
21562  }
21563  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_9);
21564  __pyx_t_9 = 0;
21565 
21566  /* "WaveTools.py":1269
21567  * #C++ declarations
21568  * for ij in range(3):
21569  * self.waveDir_c[ij] = self.waveDir[ij] # <<<<<<<<<<<<<<
21570  * self.vDir_c[ij] = self.vDir[ij]
21571  * self.waveDir_ = self.waveDir_c
21572  */
21573  __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->waveDir), __pyx_v_ij); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1269, __pyx_L1_error)
21574  __Pyx_GOTREF(__pyx_t_9);
21575  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L1_error)
21576  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21577  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L1_error)
21578  (__pyx_cur_scope->__pyx_v_self->waveDir_c[__pyx_t_18]) = __pyx_t_8;
21579 
21580  /* "WaveTools.py":1270
21581  * for ij in range(3):
21582  * self.waveDir_c[ij] = self.waveDir[ij]
21583  * self.vDir_c[ij] = self.vDir[ij] # <<<<<<<<<<<<<<
21584  * self.waveDir_ = self.waveDir_c
21585  * self.vDir_ = self.vDir_c
21586  */
21587  __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->vDir), __pyx_v_ij); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1270, __pyx_L1_error)
21588  __Pyx_GOTREF(__pyx_t_9);
21589  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1270, __pyx_L1_error)
21590  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21591  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1270, __pyx_L1_error)
21592  (__pyx_cur_scope->__pyx_v_self->vDir_c[__pyx_t_18]) = __pyx_t_8;
21593 
21594  /* "WaveTools.py":1268
21595  *
21596  * #C++ declarations
21597  * for ij in range(3): # <<<<<<<<<<<<<<
21598  * self.waveDir_c[ij] = self.waveDir[ij]
21599  * self.vDir_c[ij] = self.vDir[ij]
21600  */
21601  }
21602  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21603 
21604  /* "WaveTools.py":1271
21605  * self.waveDir_c[ij] = self.waveDir[ij]
21606  * self.vDir_c[ij] = self.vDir[ij]
21607  * self.waveDir_ = self.waveDir_c # <<<<<<<<<<<<<<
21608  * self.vDir_ = self.vDir_c
21609  *
21610  */
21611  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->waveDir_c;
21612  __pyx_cur_scope->__pyx_v_self->waveDir_ = __pyx_t_19;
21613 
21614  /* "WaveTools.py":1272
21615  * self.vDir_c[ij] = self.vDir[ij]
21616  * self.waveDir_ = self.waveDir_c
21617  * self.vDir_ = self.vDir_c # <<<<<<<<<<<<<<
21618  *
21619  *
21620  */
21621  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->vDir_c;
21622  __pyx_cur_scope->__pyx_v_self->vDir_ = __pyx_t_19;
21623 
21624  /* "WaveTools.py":1275
21625  *
21626  *
21627  * for ij in range(self.N): # <<<<<<<<<<<<<<
21628  * for kk in range(3):
21629  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
21630  */
21631  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_range); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1275, __pyx_L1_error)
21632  __Pyx_GOTREF(__pyx_t_9);
21633  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1275, __pyx_L1_error)
21634  __Pyx_GOTREF(__pyx_t_2);
21635  __pyx_t_4 = NULL;
21636  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
21637  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
21638  if (likely(__pyx_t_4)) {
21639  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21640  __Pyx_INCREF(__pyx_t_4);
21641  __Pyx_INCREF(function);
21642  __Pyx_DECREF_SET(__pyx_t_9, function);
21643  }
21644  }
21645  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_2);
21646  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21647  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21648  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error)
21649  __Pyx_GOTREF(__pyx_t_3);
21650  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21651  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
21652  __pyx_t_9 = __pyx_t_3; __Pyx_INCREF(__pyx_t_9); __pyx_t_16 = 0;
21653  __pyx_t_17 = NULL;
21654  } else {
21655  __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1275, __pyx_L1_error)
21656  __Pyx_GOTREF(__pyx_t_9);
21657  __pyx_t_17 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1275, __pyx_L1_error)
21658  }
21659  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21660  for (;;) {
21661  if (likely(!__pyx_t_17)) {
21662  if (likely(PyList_CheckExact(__pyx_t_9))) {
21663  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_9)) break;
21664  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21665  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1275, __pyx_L1_error)
21666  #else
21667  __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error)
21668  __Pyx_GOTREF(__pyx_t_3);
21669  #endif
21670  } else {
21671  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
21672  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21673  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_3); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1275, __pyx_L1_error)
21674  #else
21675  __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1275, __pyx_L1_error)
21676  __Pyx_GOTREF(__pyx_t_3);
21677  #endif
21678  }
21679  } else {
21680  __pyx_t_3 = __pyx_t_17(__pyx_t_9);
21681  if (unlikely(!__pyx_t_3)) {
21682  PyObject* exc_type = PyErr_Occurred();
21683  if (exc_type) {
21684  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21685  else __PYX_ERR(0, 1275, __pyx_L1_error)
21686  }
21687  break;
21688  }
21689  __Pyx_GOTREF(__pyx_t_3);
21690  }
21691  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_3);
21692  __pyx_t_3 = 0;
21693 
21694  /* "WaveTools.py":1276
21695  *
21696  * for ij in range(self.N):
21697  * for kk in range(3): # <<<<<<<<<<<<<<
21698  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
21699  * self.omega_c[ij] = self.omega[ij]
21700  */
21701  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error)
21702  __Pyx_GOTREF(__pyx_t_2);
21703  __pyx_t_4 = NULL;
21704  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
21705  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
21706  if (likely(__pyx_t_4)) {
21707  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
21708  __Pyx_INCREF(__pyx_t_4);
21709  __Pyx_INCREF(function);
21710  __Pyx_DECREF_SET(__pyx_t_2, function);
21711  }
21712  }
21713  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
21714  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
21715  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error)
21716  __Pyx_GOTREF(__pyx_t_3);
21717  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21718  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
21719  __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_18 = 0;
21720  __pyx_t_20 = NULL;
21721  } else {
21722  __pyx_t_18 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error)
21723  __Pyx_GOTREF(__pyx_t_2);
21724  __pyx_t_20 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1276, __pyx_L1_error)
21725  }
21726  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21727  for (;;) {
21728  if (likely(!__pyx_t_20)) {
21729  if (likely(PyList_CheckExact(__pyx_t_2))) {
21730  if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_2)) break;
21731  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21732  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_18); __Pyx_INCREF(__pyx_t_3); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 1276, __pyx_L1_error)
21733  #else
21734  __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error)
21735  __Pyx_GOTREF(__pyx_t_3);
21736  #endif
21737  } else {
21738  if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
21739  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
21740  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_18); __Pyx_INCREF(__pyx_t_3); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 1276, __pyx_L1_error)
21741  #else
21742  __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error)
21743  __Pyx_GOTREF(__pyx_t_3);
21744  #endif
21745  }
21746  } else {
21747  __pyx_t_3 = __pyx_t_20(__pyx_t_2);
21748  if (unlikely(!__pyx_t_3)) {
21749  PyObject* exc_type = PyErr_Occurred();
21750  if (exc_type) {
21751  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
21752  else __PYX_ERR(0, 1276, __pyx_L1_error)
21753  }
21754  break;
21755  }
21756  __Pyx_GOTREF(__pyx_t_3);
21757  }
21758  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_3);
21759  __pyx_t_3 = 0;
21760 
21761  /* "WaveTools.py":1277
21762  * for ij in range(self.N):
21763  * for kk in range(3):
21764  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk] # <<<<<<<<<<<<<<
21765  * self.omega_c[ij] = self.omega[ij]
21766  * self.ki_c[ij] =self.ki[ij]
21767  */
21768  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error)
21769  __Pyx_GOTREF(__pyx_t_3);
21770  __Pyx_INCREF(__pyx_v_ij);
21771  __Pyx_GIVEREF(__pyx_v_ij);
21772  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ij);
21773  __Pyx_INCREF(__pyx_v_kk);
21774  __Pyx_GIVEREF(__pyx_v_kk);
21775  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_kk);
21776  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->kDir), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1277, __pyx_L1_error)
21777  __Pyx_GOTREF(__pyx_t_4);
21778  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21779  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L1_error)
21780  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21781  __pyx_t_4 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1277, __pyx_L1_error)
21782  __Pyx_GOTREF(__pyx_t_4);
21783  __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_kk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error)
21784  __Pyx_GOTREF(__pyx_t_3);
21785  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21786  __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1277, __pyx_L1_error)
21787  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21788  (__pyx_cur_scope->__pyx_v_self->kDir_c[__pyx_t_21]) = __pyx_t_8;
21789 
21790  /* "WaveTools.py":1276
21791  *
21792  * for ij in range(self.N):
21793  * for kk in range(3): # <<<<<<<<<<<<<<
21794  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
21795  * self.omega_c[ij] = self.omega[ij]
21796  */
21797  }
21798  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21799 
21800  /* "WaveTools.py":1278
21801  * for kk in range(3):
21802  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
21803  * self.omega_c[ij] = self.omega[ij] # <<<<<<<<<<<<<<
21804  * self.ki_c[ij] =self.ki[ij]
21805  * self.tanh_c[ij] = self.tanhF[ij]
21806  */
21807  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->omega), __pyx_v_ij); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
21808  __Pyx_GOTREF(__pyx_t_2);
21809  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L1_error)
21810  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21811  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L1_error)
21812  (__pyx_cur_scope->__pyx_v_self->omega_c[__pyx_t_18]) = __pyx_t_8;
21813 
21814  /* "WaveTools.py":1279
21815  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
21816  * self.omega_c[ij] = self.omega[ij]
21817  * self.ki_c[ij] =self.ki[ij] # <<<<<<<<<<<<<<
21818  * self.tanh_c[ij] = self.tanhF[ij]
21819  * self.ai_c[ij] = self.ai[ij]
21820  */
21821  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->ki), __pyx_v_ij); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
21822  __Pyx_GOTREF(__pyx_t_2);
21823  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L1_error)
21824  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21825  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L1_error)
21826  (__pyx_cur_scope->__pyx_v_self->ki_c[__pyx_t_18]) = __pyx_t_8;
21827 
21828  /* "WaveTools.py":1280
21829  * self.omega_c[ij] = self.omega[ij]
21830  * self.ki_c[ij] =self.ki[ij]
21831  * self.tanh_c[ij] = self.tanhF[ij] # <<<<<<<<<<<<<<
21832  * self.ai_c[ij] = self.ai[ij]
21833  * self.phi_c[ij] = self.phi[ij]
21834  */
21835  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->tanhF), __pyx_v_ij); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error)
21836  __Pyx_GOTREF(__pyx_t_2);
21837  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L1_error)
21838  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21839  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1280, __pyx_L1_error)
21840  (__pyx_cur_scope->__pyx_v_self->tanh_c[__pyx_t_18]) = __pyx_t_8;
21841 
21842  /* "WaveTools.py":1281
21843  * self.ki_c[ij] =self.ki[ij]
21844  * self.tanh_c[ij] = self.tanhF[ij]
21845  * self.ai_c[ij] = self.ai[ij] # <<<<<<<<<<<<<<
21846  * self.phi_c[ij] = self.phi[ij]
21847  *
21848  */
21849  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_self->ai), __pyx_v_ij); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1281, __pyx_L1_error)
21850  __Pyx_GOTREF(__pyx_t_2);
21851  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1281, __pyx_L1_error)
21852  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21853  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1281, __pyx_L1_error)
21854  (__pyx_cur_scope->__pyx_v_self->ai_c[__pyx_t_18]) = __pyx_t_8;
21855 
21856  /* "WaveTools.py":1282
21857  * self.tanh_c[ij] = self.tanhF[ij]
21858  * self.ai_c[ij] = self.ai[ij]
21859  * self.phi_c[ij] = self.phi[ij] # <<<<<<<<<<<<<<
21860  *
21861  * self.kDir_ = self.kDir_c
21862  */
21863  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phi, __pyx_v_ij); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
21864  __Pyx_GOTREF(__pyx_t_2);
21865  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1282, __pyx_L1_error)
21866  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21867  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1282, __pyx_L1_error)
21868  (__pyx_cur_scope->__pyx_v_self->phi_c[__pyx_t_18]) = __pyx_t_8;
21869 
21870  /* "WaveTools.py":1275
21871  *
21872  *
21873  * for ij in range(self.N): # <<<<<<<<<<<<<<
21874  * for kk in range(3):
21875  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
21876  */
21877  }
21878  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21879 
21880  /* "WaveTools.py":1284
21881  * self.phi_c[ij] = self.phi[ij]
21882  *
21883  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
21884  * self.omega_ = self.omega_c
21885  * self.ki_ =self.ki_c
21886  */
21887  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->kDir_c;
21888  __pyx_cur_scope->__pyx_v_self->kDir_ = __pyx_t_19;
21889 
21890  /* "WaveTools.py":1285
21891  *
21892  * self.kDir_ = self.kDir_c
21893  * self.omega_ = self.omega_c # <<<<<<<<<<<<<<
21894  * self.ki_ =self.ki_c
21895  * self.ai_ = self.ai_c
21896  */
21897  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->omega_c;
21898  __pyx_cur_scope->__pyx_v_self->omega_ = __pyx_t_19;
21899 
21900  /* "WaveTools.py":1286
21901  * self.kDir_ = self.kDir_c
21902  * self.omega_ = self.omega_c
21903  * self.ki_ =self.ki_c # <<<<<<<<<<<<<<
21904  * self.ai_ = self.ai_c
21905  * self.tanh_ = self.tanh_c
21906  */
21907  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->ki_c;
21908  __pyx_cur_scope->__pyx_v_self->ki_ = __pyx_t_19;
21909 
21910  /* "WaveTools.py":1287
21911  * self.omega_ = self.omega_c
21912  * self.ki_ =self.ki_c
21913  * self.ai_ = self.ai_c # <<<<<<<<<<<<<<
21914  * self.tanh_ = self.tanh_c
21915  * self.phi_ = self.phi_c
21916  */
21917  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->ai_c;
21918  __pyx_cur_scope->__pyx_v_self->ai_ = __pyx_t_19;
21919 
21920  /* "WaveTools.py":1288
21921  * self.ki_ =self.ki_c
21922  * self.ai_ = self.ai_c
21923  * self.tanh_ = self.tanh_c # <<<<<<<<<<<<<<
21924  * self.phi_ = self.phi_c
21925  *
21926  */
21927  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->tanh_c;
21928  __pyx_cur_scope->__pyx_v_self->tanh_ = __pyx_t_19;
21929 
21930  /* "WaveTools.py":1289
21931  * self.ai_ = self.ai_c
21932  * self.tanh_ = self.tanh_c
21933  * self.phi_ = self.phi_c # <<<<<<<<<<<<<<
21934  *
21935  * def _cpp_eta(self, x, t):
21936  */
21937  __pyx_t_19 = __pyx_cur_scope->__pyx_v_self->phi_c;
21938  __pyx_cur_scope->__pyx_v_self->phi_ = __pyx_t_19;
21939 
21940  /* "WaveTools.py":1200
21941  * Switch for optimised functions
21942  * """
21943  * def __cinit__(self, # <<<<<<<<<<<<<<
21944  * Tp,
21945  * Hs,
21946  */
21947 
21948  /* function exit code */
21949  __pyx_r = 0;
21950  goto __pyx_L0;
21951  __pyx_L1_error:;
21952  __Pyx_XDECREF(__pyx_t_2);
21953  __Pyx_XDECREF(__pyx_t_3);
21954  __Pyx_XDECREF(__pyx_t_4);
21955  __Pyx_XDECREF(__pyx_t_6);
21956  __Pyx_XDECREF(__pyx_t_7);
21957  __Pyx_XDECREF(__pyx_t_9);
21958  __Pyx_XDECREF(__pyx_t_15);
21959  __Pyx_AddTraceback("WaveTools.NewWave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
21960  __pyx_r = -1;
21961  __pyx_L0:;
21962  __Pyx_XDECREF(__pyx_v_validSpectra);
21963  __Pyx_XDECREF(__pyx_v_spec_fun);
21964  __Pyx_XDECREF(__pyx_v_fmin);
21965  __Pyx_XDECREF(__pyx_v_fim);
21966  __Pyx_XDECREF(__pyx_v_wim);
21967  __Pyx_XDECREF(__pyx_v_ii);
21968  __Pyx_XDECREF(__pyx_v_mm);
21969  __Pyx_XDECREF(__pyx_v_m0);
21970  __Pyx_XDECREF(__pyx_v_An);
21971  __Pyx_XDECREF(__pyx_v_ij);
21972  __Pyx_XDECREF(__pyx_v_kk);
21973  __Pyx_XDECREF(__pyx_v_waveDir);
21974  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
21975  __Pyx_RefNannyFinishContext();
21976  return __pyx_r;
21977 }
21978 
21979 /* "WaveTools.py":1291
21980  * self.phi_ = self.phi_c
21981  *
21982  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
21983  *
21984  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
21985  */
21986 
21987 static double __pyx_f_9WaveTools_7NewWave__cpp_eta(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
21988  double __pyx_r;
21989  __Pyx_RefNannyDeclarations
21990  __Pyx_RefNannySetupContext("_cpp_eta", 0);
21991 
21992  /* "WaveTools.py":1293
21993  * def _cpp_eta(self, x, t):
21994  *
21995  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast) # <<<<<<<<<<<<<<
21996  *
21997  * def eta(self, x, t):
21998  */
21999  __pyx_r = proteus::__cpp_etaRandom(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->N, __pyx_v_self->fast);
22000  goto __pyx_L0;
22001 
22002  /* "WaveTools.py":1291
22003  * self.phi_ = self.phi_c
22004  *
22005  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
22006  *
22007  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
22008  */
22009 
22010  /* function exit code */
22011  __pyx_L0:;
22012  __Pyx_RefNannyFinishContext();
22013  return __pyx_r;
22014 }
22015 
22016 /* "WaveTools.py":1295
22017  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
22018  *
22019  * def eta(self, x, t): # <<<<<<<<<<<<<<
22020  * """Calculates free surface elevation (RandomWaves class)
22021  * Parameters
22022  */
22023 
22024 /* Python wrapper */
22025 static PyObject *__pyx_pw_9WaveTools_7NewWave_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22026 static char __pyx_doc_9WaveTools_7NewWave_2eta[] = "Calculates free surface elevation (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
22027 static PyMethodDef __pyx_mdef_9WaveTools_7NewWave_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7NewWave_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_7NewWave_2eta};
22028 static PyObject *__pyx_pw_9WaveTools_7NewWave_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22029  PyObject *__pyx_v_x = 0;
22030  PyObject *__pyx_v_t = 0;
22031  PyObject *__pyx_r = 0;
22032  __Pyx_RefNannyDeclarations
22033  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
22034  {
22035  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
22036  PyObject* values[2] = {0,0};
22037  if (unlikely(__pyx_kwds)) {
22038  Py_ssize_t kw_args;
22039  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22040  switch (pos_args) {
22041  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22042  CYTHON_FALLTHROUGH;
22043  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22044  CYTHON_FALLTHROUGH;
22045  case 0: break;
22046  default: goto __pyx_L5_argtuple_error;
22047  }
22048  kw_args = PyDict_Size(__pyx_kwds);
22049  switch (pos_args) {
22050  case 0:
22051  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
22052  else goto __pyx_L5_argtuple_error;
22053  CYTHON_FALLTHROUGH;
22054  case 1:
22055  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
22056  else {
22057  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 1295, __pyx_L3_error)
22058  }
22059  }
22060  if (unlikely(kw_args > 0)) {
22061  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 1295, __pyx_L3_error)
22062  }
22063  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
22064  goto __pyx_L5_argtuple_error;
22065  } else {
22066  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22067  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22068  }
22069  __pyx_v_x = values[0];
22070  __pyx_v_t = values[1];
22071  }
22072  goto __pyx_L4_argument_unpacking_done;
22073  __pyx_L5_argtuple_error:;
22074  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1295, __pyx_L3_error)
22075  __pyx_L3_error:;
22076  __Pyx_AddTraceback("WaveTools.NewWave.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
22077  __Pyx_RefNannyFinishContext();
22078  return NULL;
22079  __pyx_L4_argument_unpacking_done:;
22080  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2eta(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
22081 
22082  /* function exit code */
22083  __Pyx_RefNannyFinishContext();
22084  return __pyx_r;
22085 }
22086 
22087 static PyObject *__pyx_pf_9WaveTools_7NewWave_2eta(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
22088  double __pyx_v_xx[3];
22089  PyObject *__pyx_r = NULL;
22090  __Pyx_RefNannyDeclarations
22091  PyObject *__pyx_t_1 = NULL;
22092  double __pyx_t_2;
22093  __Pyx_RefNannySetupContext("eta", 0);
22094 
22095  /* "WaveTools.py":1311
22096  * """
22097  * cython.declare(xx=cython.double[3])
22098  * xx[0] = x[0] # <<<<<<<<<<<<<<
22099  * xx[1] = x[1]
22100  * xx[2] = x[2]
22101  */
22102  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error)
22103  __Pyx_GOTREF(__pyx_t_1);
22104  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1311, __pyx_L1_error)
22105  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22106  (__pyx_v_xx[0]) = __pyx_t_2;
22107 
22108  /* "WaveTools.py":1312
22109  * cython.declare(xx=cython.double[3])
22110  * xx[0] = x[0]
22111  * xx[1] = x[1] # <<<<<<<<<<<<<<
22112  * xx[2] = x[2]
22113  * return self._cpp_eta(xx,t)
22114  */
22115  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
22116  __Pyx_GOTREF(__pyx_t_1);
22117  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L1_error)
22118  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22119  (__pyx_v_xx[1]) = __pyx_t_2;
22120 
22121  /* "WaveTools.py":1313
22122  * xx[0] = x[0]
22123  * xx[1] = x[1]
22124  * xx[2] = x[2] # <<<<<<<<<<<<<<
22125  * return self._cpp_eta(xx,t)
22126  *
22127  */
22128  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1313, __pyx_L1_error)
22129  __Pyx_GOTREF(__pyx_t_1);
22130  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1313, __pyx_L1_error)
22131  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22132  (__pyx_v_xx[2]) = __pyx_t_2;
22133 
22134  /* "WaveTools.py":1314
22135  * xx[1] = x[1]
22136  * xx[2] = x[2]
22137  * return self._cpp_eta(xx,t) # <<<<<<<<<<<<<<
22138  *
22139  * def _cpp_u(self, U, x, t):
22140  */
22141  __Pyx_XDECREF(__pyx_r);
22142  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1314, __pyx_L1_error)
22143  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_NewWave *)__pyx_v_self->__pyx_vtab)->_cpp_eta(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1314, __pyx_L1_error)
22144  __Pyx_GOTREF(__pyx_t_1);
22145  __pyx_r = __pyx_t_1;
22146  __pyx_t_1 = 0;
22147  goto __pyx_L0;
22148 
22149  /* "WaveTools.py":1295
22150  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
22151  *
22152  * def eta(self, x, t): # <<<<<<<<<<<<<<
22153  * """Calculates free surface elevation (RandomWaves class)
22154  * Parameters
22155  */
22156 
22157  /* function exit code */
22158  __pyx_L1_error:;
22159  __Pyx_XDECREF(__pyx_t_1);
22160  __Pyx_AddTraceback("WaveTools.NewWave.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
22161  __pyx_r = NULL;
22162  __pyx_L0:;
22163  __Pyx_XGIVEREF(__pyx_r);
22164  __Pyx_RefNannyFinishContext();
22165  return __pyx_r;
22166 }
22167 
22168 /* "WaveTools.py":1316
22169  * return self._cpp_eta(xx,t)
22170  *
22171  * def _cpp_u(self, U, x, t): # <<<<<<<<<<<<<<
22172  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
22173  *
22174  */
22175 
22176 static void __pyx_f_9WaveTools_7NewWave__cpp_u(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
22177  __Pyx_RefNannyDeclarations
22178  __Pyx_RefNannySetupContext("_cpp_u", 0);
22179 
22180  /* "WaveTools.py":1317
22181  *
22182  * def _cpp_u(self, U, x, t):
22183  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast) # <<<<<<<<<<<<<<
22184  *
22185  * def u(self, x, t):
22186  */
22187  proteus::__cpp_uRandom(__pyx_v_U, __pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->N, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanh_, __pyx_v_self->gAbs, __pyx_v_self->fast);
22188 
22189  /* "WaveTools.py":1316
22190  * return self._cpp_eta(xx,t)
22191  *
22192  * def _cpp_u(self, U, x, t): # <<<<<<<<<<<<<<
22193  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
22194  *
22195  */
22196 
22197  /* function exit code */
22198  __Pyx_RefNannyFinishContext();
22199 }
22200 
22201 /* "WaveTools.py":1319
22202  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
22203  *
22204  * def u(self, x, t): # <<<<<<<<<<<<<<
22205  * """Calculates wave velocity vector (RandomWaves class)
22206  * Parameters
22207  */
22208 
22209 /* Python wrapper */
22210 static PyObject *__pyx_pw_9WaveTools_7NewWave_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22211 static char __pyx_doc_9WaveTools_7NewWave_4u[] = "Calculates wave velocity vector (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
22212 static PyMethodDef __pyx_mdef_9WaveTools_7NewWave_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7NewWave_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_7NewWave_4u};
22213 static PyObject *__pyx_pw_9WaveTools_7NewWave_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22214  PyObject *__pyx_v_x = 0;
22215  PyObject *__pyx_v_t = 0;
22216  PyObject *__pyx_r = 0;
22217  __Pyx_RefNannyDeclarations
22218  __Pyx_RefNannySetupContext("u (wrapper)", 0);
22219  {
22220  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
22221  PyObject* values[2] = {0,0};
22222  if (unlikely(__pyx_kwds)) {
22223  Py_ssize_t kw_args;
22224  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22225  switch (pos_args) {
22226  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22227  CYTHON_FALLTHROUGH;
22228  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22229  CYTHON_FALLTHROUGH;
22230  case 0: break;
22231  default: goto __pyx_L5_argtuple_error;
22232  }
22233  kw_args = PyDict_Size(__pyx_kwds);
22234  switch (pos_args) {
22235  case 0:
22236  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
22237  else goto __pyx_L5_argtuple_error;
22238  CYTHON_FALLTHROUGH;
22239  case 1:
22240  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
22241  else {
22242  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 1319, __pyx_L3_error)
22243  }
22244  }
22245  if (unlikely(kw_args > 0)) {
22246  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 1319, __pyx_L3_error)
22247  }
22248  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
22249  goto __pyx_L5_argtuple_error;
22250  } else {
22251  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22252  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22253  }
22254  __pyx_v_x = values[0];
22255  __pyx_v_t = values[1];
22256  }
22257  goto __pyx_L4_argument_unpacking_done;
22258  __pyx_L5_argtuple_error:;
22259  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1319, __pyx_L3_error)
22260  __pyx_L3_error:;
22261  __Pyx_AddTraceback("WaveTools.NewWave.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
22262  __Pyx_RefNannyFinishContext();
22263  return NULL;
22264  __pyx_L4_argument_unpacking_done:;
22265  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4u(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
22266 
22267  /* function exit code */
22268  __Pyx_RefNannyFinishContext();
22269  return __pyx_r;
22270 }
22271 
22272 static PyObject *__pyx_pf_9WaveTools_7NewWave_4u(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
22273  double __pyx_v_xx[3];
22274  double __pyx_v_cppU[3];
22275  PyObject *__pyx_v_ii = NULL;
22276  PyObject *__pyx_v_U = NULL;
22277  PyObject *__pyx_r = NULL;
22278  __Pyx_RefNannyDeclarations
22279  PyObject *__pyx_t_1 = NULL;
22280  PyObject *__pyx_t_2 = NULL;
22281  PyObject *__pyx_t_3 = NULL;
22282  Py_ssize_t __pyx_t_4;
22283  PyObject *(*__pyx_t_5)(PyObject *);
22284  double __pyx_t_6;
22285  Py_ssize_t __pyx_t_7;
22286  __Pyx_RefNannySetupContext("u", 0);
22287 
22288  /* "WaveTools.py":1337
22289  * cython.declare(xx=cython.double[3])
22290  * cython.declare(cppU=cython.double[3])
22291  * for ii in range(3): # <<<<<<<<<<<<<<
22292  * xx[ii] = x[ii]
22293  * cppU[ii] = 0.
22294  */
22295  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
22296  __Pyx_GOTREF(__pyx_t_2);
22297  __pyx_t_3 = NULL;
22298  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
22299  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
22300  if (likely(__pyx_t_3)) {
22301  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22302  __Pyx_INCREF(__pyx_t_3);
22303  __Pyx_INCREF(function);
22304  __Pyx_DECREF_SET(__pyx_t_2, function);
22305  }
22306  }
22307  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
22308  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22309  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
22310  __Pyx_GOTREF(__pyx_t_1);
22311  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22312  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
22313  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
22314  __pyx_t_5 = NULL;
22315  } else {
22316  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
22317  __Pyx_GOTREF(__pyx_t_2);
22318  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1337, __pyx_L1_error)
22319  }
22320  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22321  for (;;) {
22322  if (likely(!__pyx_t_5)) {
22323  if (likely(PyList_CheckExact(__pyx_t_2))) {
22324  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
22325  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22326  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error)
22327  #else
22328  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
22329  __Pyx_GOTREF(__pyx_t_1);
22330  #endif
22331  } else {
22332  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
22333  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22334  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1337, __pyx_L1_error)
22335  #else
22336  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
22337  __Pyx_GOTREF(__pyx_t_1);
22338  #endif
22339  }
22340  } else {
22341  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
22342  if (unlikely(!__pyx_t_1)) {
22343  PyObject* exc_type = PyErr_Occurred();
22344  if (exc_type) {
22345  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
22346  else __PYX_ERR(0, 1337, __pyx_L1_error)
22347  }
22348  break;
22349  }
22350  __Pyx_GOTREF(__pyx_t_1);
22351  }
22352  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
22353  __pyx_t_1 = 0;
22354 
22355  /* "WaveTools.py":1338
22356  * cython.declare(cppU=cython.double[3])
22357  * for ii in range(3):
22358  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
22359  * cppU[ii] = 0.
22360  * U = np.zeros(3,)
22361  */
22362  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
22363  __Pyx_GOTREF(__pyx_t_1);
22364  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L1_error)
22365  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22366  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L1_error)
22367  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
22368 
22369  /* "WaveTools.py":1339
22370  * for ii in range(3):
22371  * xx[ii] = x[ii]
22372  * cppU[ii] = 0. # <<<<<<<<<<<<<<
22373  * U = np.zeros(3,)
22374  * self._cpp_u(cppU,xx,t)
22375  */
22376  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L1_error)
22377  (__pyx_v_cppU[__pyx_t_7]) = 0.;
22378 
22379  /* "WaveTools.py":1337
22380  * cython.declare(xx=cython.double[3])
22381  * cython.declare(cppU=cython.double[3])
22382  * for ii in range(3): # <<<<<<<<<<<<<<
22383  * xx[ii] = x[ii]
22384  * cppU[ii] = 0.
22385  */
22386  }
22387  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22388 
22389  /* "WaveTools.py":1340
22390  * xx[ii] = x[ii]
22391  * cppU[ii] = 0.
22392  * U = np.zeros(3,) # <<<<<<<<<<<<<<
22393  * self._cpp_u(cppU,xx,t)
22394  * U[0] = cppU[0]
22395  */
22396  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
22397  __Pyx_GOTREF(__pyx_t_1);
22398  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __pyx_L1_error)
22399  __Pyx_GOTREF(__pyx_t_3);
22400  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22401  __pyx_t_1 = NULL;
22402  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
22403  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
22404  if (likely(__pyx_t_1)) {
22405  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
22406  __Pyx_INCREF(__pyx_t_1);
22407  __Pyx_INCREF(function);
22408  __Pyx_DECREF_SET(__pyx_t_3, function);
22409  }
22410  }
22411  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
22412  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22413  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1340, __pyx_L1_error)
22414  __Pyx_GOTREF(__pyx_t_2);
22415  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22416  __pyx_v_U = __pyx_t_2;
22417  __pyx_t_2 = 0;
22418 
22419  /* "WaveTools.py":1341
22420  * cppU[ii] = 0.
22421  * U = np.zeros(3,)
22422  * self._cpp_u(cppU,xx,t) # <<<<<<<<<<<<<<
22423  * U[0] = cppU[0]
22424  * U[1] = cppU[1]
22425  */
22426  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L1_error)
22427  ((struct __pyx_vtabstruct_9WaveTools_NewWave *)__pyx_v_self->__pyx_vtab)->_cpp_u(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
22428 
22429  /* "WaveTools.py":1342
22430  * U = np.zeros(3,)
22431  * self._cpp_u(cppU,xx,t)
22432  * U[0] = cppU[0] # <<<<<<<<<<<<<<
22433  * U[1] = cppU[1]
22434  * U[2] = cppU[2]
22435  */
22436  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
22437  __Pyx_GOTREF(__pyx_t_2);
22438  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1342, __pyx_L1_error)
22439  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22440 
22441  /* "WaveTools.py":1343
22442  * self._cpp_u(cppU,xx,t)
22443  * U[0] = cppU[0]
22444  * U[1] = cppU[1] # <<<<<<<<<<<<<<
22445  * U[2] = cppU[2]
22446  *
22447  */
22448  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1343, __pyx_L1_error)
22449  __Pyx_GOTREF(__pyx_t_2);
22450  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1343, __pyx_L1_error)
22451  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22452 
22453  /* "WaveTools.py":1344
22454  * U[0] = cppU[0]
22455  * U[1] = cppU[1]
22456  * U[2] = cppU[2] # <<<<<<<<<<<<<<
22457  *
22458  * return U
22459  */
22460  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __pyx_L1_error)
22461  __Pyx_GOTREF(__pyx_t_2);
22462  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1344, __pyx_L1_error)
22463  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22464 
22465  /* "WaveTools.py":1346
22466  * U[2] = cppU[2]
22467  *
22468  * return U # <<<<<<<<<<<<<<
22469  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])):
22470  * """Writes a timeseries of the free-surface elevation
22471  */
22472  __Pyx_XDECREF(__pyx_r);
22473  __Pyx_INCREF(__pyx_v_U);
22474  __pyx_r = __pyx_v_U;
22475  goto __pyx_L0;
22476 
22477  /* "WaveTools.py":1319
22478  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
22479  *
22480  * def u(self, x, t): # <<<<<<<<<<<<<<
22481  * """Calculates wave velocity vector (RandomWaves class)
22482  * Parameters
22483  */
22484 
22485  /* function exit code */
22486  __pyx_L1_error:;
22487  __Pyx_XDECREF(__pyx_t_1);
22488  __Pyx_XDECREF(__pyx_t_2);
22489  __Pyx_XDECREF(__pyx_t_3);
22490  __Pyx_AddTraceback("WaveTools.NewWave.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
22491  __pyx_r = NULL;
22492  __pyx_L0:;
22493  __Pyx_XDECREF(__pyx_v_ii);
22494  __Pyx_XDECREF(__pyx_v_U);
22495  __Pyx_XGIVEREF(__pyx_r);
22496  __Pyx_RefNannyFinishContext();
22497  return __pyx_r;
22498 }
22499 
22500 /* "WaveTools.py":1347
22501  *
22502  * return U
22503  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
22504  * """Writes a timeseries of the free-surface elevation
22505  *
22506  */
22507 
22508 /* Python wrapper */
22509 static PyObject *__pyx_pw_9WaveTools_7NewWave_7writeEtaSeries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
22510 static char __pyx_doc_9WaveTools_7NewWave_6writeEtaSeries[] = "Writes a timeseries of the free-surface elevation\n\n It also returns the free surface elevation as a time-eta array.\n If Lgen !=[0.,0.,0.,] then Tstart is modified to account for the\n wave transformation at the most remote point of the relaxation zone.\n\n Parameters\n ----------\n Tstart : float\n Start time\n Tend : float\n End time\n x0 : numpy.ndarray\n Position vector of the time series\n fname : string\n Filename for timeseries file\n Lgen : Optional[numpy.ndarray]\n Length vector of relaxation zone\n\n\n Returns\n ----------\n numpy.ndarray\n 2D numpy array Nx2 containing free-surface elevation in time.\n ";
22511 static PyMethodDef __pyx_mdef_9WaveTools_7NewWave_7writeEtaSeries = {"writeEtaSeries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7NewWave_7writeEtaSeries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_7NewWave_6writeEtaSeries};
22512 static PyObject *__pyx_pw_9WaveTools_7NewWave_7writeEtaSeries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22513  PyObject *__pyx_v_Tstart = 0;
22514  PyObject *__pyx_v_Tend = 0;
22515  PyObject *__pyx_v_x0 = 0;
22516  PyObject *__pyx_v_fname = 0;
22517  PyObject *__pyx_v_Lgen = 0;
22518  PyObject *__pyx_r = 0;
22519  __Pyx_RefNannyDeclarations
22520  __Pyx_RefNannySetupContext("writeEtaSeries (wrapper)", 0);
22521  {
22522  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Tstart,&__pyx_n_s_Tend,&__pyx_n_s_x0,&__pyx_n_s_fname,&__pyx_n_s_Lgen,0};
22523  PyObject* values[5] = {0,0,0,0,0};
22524  values[4] = __pyx_k__24;
22525  if (unlikely(__pyx_kwds)) {
22526  Py_ssize_t kw_args;
22527  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
22528  switch (pos_args) {
22529  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
22530  CYTHON_FALLTHROUGH;
22531  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
22532  CYTHON_FALLTHROUGH;
22533  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
22534  CYTHON_FALLTHROUGH;
22535  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22536  CYTHON_FALLTHROUGH;
22537  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22538  CYTHON_FALLTHROUGH;
22539  case 0: break;
22540  default: goto __pyx_L5_argtuple_error;
22541  }
22542  kw_args = PyDict_Size(__pyx_kwds);
22543  switch (pos_args) {
22544  case 0:
22545  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tstart)) != 0)) kw_args--;
22546  else goto __pyx_L5_argtuple_error;
22547  CYTHON_FALLTHROUGH;
22548  case 1:
22549  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tend)) != 0)) kw_args--;
22550  else {
22551  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, 1); __PYX_ERR(0, 1347, __pyx_L3_error)
22552  }
22553  CYTHON_FALLTHROUGH;
22554  case 2:
22555  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
22556  else {
22557  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, 2); __PYX_ERR(0, 1347, __pyx_L3_error)
22558  }
22559  CYTHON_FALLTHROUGH;
22560  case 3:
22561  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--;
22562  else {
22563  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, 3); __PYX_ERR(0, 1347, __pyx_L3_error)
22564  }
22565  CYTHON_FALLTHROUGH;
22566  case 4:
22567  if (kw_args > 0) {
22568  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Lgen);
22569  if (value) { values[4] = value; kw_args--; }
22570  }
22571  }
22572  if (unlikely(kw_args > 0)) {
22573  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeEtaSeries") < 0)) __PYX_ERR(0, 1347, __pyx_L3_error)
22574  }
22575  } else {
22576  switch (PyTuple_GET_SIZE(__pyx_args)) {
22577  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
22578  CYTHON_FALLTHROUGH;
22579  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
22580  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
22581  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
22582  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
22583  break;
22584  default: goto __pyx_L5_argtuple_error;
22585  }
22586  }
22587  __pyx_v_Tstart = values[0];
22588  __pyx_v_Tend = values[1];
22589  __pyx_v_x0 = values[2];
22590  __pyx_v_fname = values[3];
22591  __pyx_v_Lgen = values[4];
22592  }
22593  goto __pyx_L4_argument_unpacking_done;
22594  __pyx_L5_argtuple_error:;
22595  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1347, __pyx_L3_error)
22596  __pyx_L3_error:;
22597  __Pyx_AddTraceback("WaveTools.NewWave.writeEtaSeries", __pyx_clineno, __pyx_lineno, __pyx_filename);
22598  __Pyx_RefNannyFinishContext();
22599  return NULL;
22600  __pyx_L4_argument_unpacking_done:;
22601  __pyx_r = __pyx_pf_9WaveTools_7NewWave_6writeEtaSeries(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_x0, __pyx_v_fname, __pyx_v_Lgen);
22602 
22603  /* function exit code */
22604  __Pyx_RefNannyFinishContext();
22605  return __pyx_r;
22606 }
22607 
22608 static PyObject *__pyx_pf_9WaveTools_7NewWave_6writeEtaSeries(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_fname, PyObject *__pyx_v_Lgen) {
22609  PyObject *__pyx_v_dt = NULL;
22610  PyObject *__pyx_v_Tlag = NULL;
22611  PyObject *__pyx_v_j = NULL;
22612  PyObject *__pyx_v_Np = NULL;
22613  PyObject *__pyx_v_time = NULL;
22614  PyObject *__pyx_v_etaR = NULL;
22615  PyObject *__pyx_v_jj = NULL;
22616  PyObject *__pyx_v_series = NULL;
22617  PyObject *__pyx_r = NULL;
22618  __Pyx_RefNannyDeclarations
22619  PyObject *__pyx_t_1 = NULL;
22620  PyObject *__pyx_t_2 = NULL;
22621  PyObject *__pyx_t_3 = NULL;
22622  int __pyx_t_4;
22623  PyObject *__pyx_t_5 = NULL;
22624  int __pyx_t_6;
22625  PyObject *__pyx_t_7 = NULL;
22626  Py_ssize_t __pyx_t_8;
22627  PyObject *(*__pyx_t_9)(PyObject *);
22628  PyObject *__pyx_t_10 = NULL;
22629  PyObject *__pyx_t_11 = NULL;
22630  __Pyx_RefNannySetupContext("writeEtaSeries", 0);
22631  __Pyx_INCREF(__pyx_v_Tstart);
22632 
22633  /* "WaveTools.py":1373
22634  * 2D numpy array Nx2 containing free-surface elevation in time.
22635  * """
22636  * if sum(Lgen[:]*self.waveDir[:])< 0 : # <<<<<<<<<<<<<<
22637  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
22638  * sys.exit(1)
22639  */
22640  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1373, __pyx_L1_error)
22641  __Pyx_GOTREF(__pyx_t_1);
22642  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error)
22643  __Pyx_GOTREF(__pyx_t_2);
22644  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error)
22645  __Pyx_GOTREF(__pyx_t_3);
22646  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22647  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22648  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1373, __pyx_L1_error)
22649  __Pyx_GOTREF(__pyx_t_2);
22650  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22651  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error)
22652  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22653  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1373, __pyx_L1_error)
22654  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22655  if (__pyx_t_4) {
22656 
22657  /* "WaveTools.py":1374
22658  * """
22659  * if sum(Lgen[:]*self.waveDir[:])< 0 :
22660  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction') # <<<<<<<<<<<<<<
22661  * sys.exit(1)
22662  * dt = old_div(self.Tp,50.)
22663  */
22664  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1374, __pyx_L1_error)
22665  __Pyx_GOTREF(__pyx_t_2);
22666  __pyx_t_1 = NULL;
22667  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
22668  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
22669  if (likely(__pyx_t_1)) {
22670  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
22671  __Pyx_INCREF(__pyx_t_1);
22672  __Pyx_INCREF(function);
22673  __Pyx_DECREF_SET(__pyx_t_2, function);
22674  }
22675  }
22676  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_s_ERROR_Wavetools_py_Location_vect) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_ERROR_Wavetools_py_Location_vect);
22677  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22678  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1374, __pyx_L1_error)
22679  __Pyx_GOTREF(__pyx_t_3);
22680  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22681  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22682 
22683  /* "WaveTools.py":1375
22684  * if sum(Lgen[:]*self.waveDir[:])< 0 :
22685  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
22686  * sys.exit(1) # <<<<<<<<<<<<<<
22687  * dt = old_div(self.Tp,50.)
22688  * Tlag = np.zeros(len(self.omega),)
22689  */
22690  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error)
22691  __Pyx_GOTREF(__pyx_t_2);
22692  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L1_error)
22693  __Pyx_GOTREF(__pyx_t_1);
22694  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22695  __pyx_t_2 = NULL;
22696  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
22697  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
22698  if (likely(__pyx_t_2)) {
22699  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22700  __Pyx_INCREF(__pyx_t_2);
22701  __Pyx_INCREF(function);
22702  __Pyx_DECREF_SET(__pyx_t_1, function);
22703  }
22704  }
22705  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_1);
22706  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22707  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
22708  __Pyx_GOTREF(__pyx_t_3);
22709  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22710  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22711 
22712  /* "WaveTools.py":1373
22713  * 2D numpy array Nx2 containing free-surface elevation in time.
22714  * """
22715  * if sum(Lgen[:]*self.waveDir[:])< 0 : # <<<<<<<<<<<<<<
22716  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
22717  * sys.exit(1)
22718  */
22719  }
22720 
22721  /* "WaveTools.py":1376
22722  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
22723  * sys.exit(1)
22724  * dt = old_div(self.Tp,50.) # <<<<<<<<<<<<<<
22725  * Tlag = np.zeros(len(self.omega),)
22726  * for j in range(len(self.omega)):
22727  */
22728  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
22729  __Pyx_GOTREF(__pyx_t_1);
22730  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->Tp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error)
22731  __Pyx_GOTREF(__pyx_t_2);
22732  __pyx_t_5 = NULL;
22733  __pyx_t_6 = 0;
22734  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
22735  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
22736  if (likely(__pyx_t_5)) {
22737  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22738  __Pyx_INCREF(__pyx_t_5);
22739  __Pyx_INCREF(function);
22740  __Pyx_DECREF_SET(__pyx_t_1, function);
22741  __pyx_t_6 = 1;
22742  }
22743  }
22744  #if CYTHON_FAST_PYCALL
22745  if (PyFunction_Check(__pyx_t_1)) {
22746  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_float_50_};
22747  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
22748  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22749  __Pyx_GOTREF(__pyx_t_3);
22750  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22751  } else
22752  #endif
22753  #if CYTHON_FAST_PYCCALL
22754  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
22755  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_float_50_};
22756  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
22757  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22758  __Pyx_GOTREF(__pyx_t_3);
22759  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22760  } else
22761  #endif
22762  {
22763  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1376, __pyx_L1_error)
22764  __Pyx_GOTREF(__pyx_t_7);
22765  if (__pyx_t_5) {
22766  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
22767  }
22768  __Pyx_GIVEREF(__pyx_t_2);
22769  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
22770  __Pyx_INCREF(__pyx_float_50_);
22771  __Pyx_GIVEREF(__pyx_float_50_);
22772  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_float_50_);
22773  __pyx_t_2 = 0;
22774  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1376, __pyx_L1_error)
22775  __Pyx_GOTREF(__pyx_t_3);
22776  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22777  }
22778  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22779  __pyx_v_dt = __pyx_t_3;
22780  __pyx_t_3 = 0;
22781 
22782  /* "WaveTools.py":1377
22783  * sys.exit(1)
22784  * dt = old_div(self.Tp,50.)
22785  * Tlag = np.zeros(len(self.omega),) # <<<<<<<<<<<<<<
22786  * for j in range(len(self.omega)):
22787  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
22788  */
22789  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
22790  __Pyx_GOTREF(__pyx_t_1);
22791  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1377, __pyx_L1_error)
22792  __Pyx_GOTREF(__pyx_t_7);
22793  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22794  __pyx_t_1 = ((PyObject *)__pyx_v_self->omega);
22795  __Pyx_INCREF(__pyx_t_1);
22796  __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1377, __pyx_L1_error)
22797  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22798  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
22799  __Pyx_GOTREF(__pyx_t_1);
22800  __pyx_t_2 = NULL;
22801  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
22802  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
22803  if (likely(__pyx_t_2)) {
22804  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22805  __Pyx_INCREF(__pyx_t_2);
22806  __Pyx_INCREF(function);
22807  __Pyx_DECREF_SET(__pyx_t_7, function);
22808  }
22809  }
22810  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
22811  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22812  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22813  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error)
22814  __Pyx_GOTREF(__pyx_t_3);
22815  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22816  __pyx_v_Tlag = __pyx_t_3;
22817  __pyx_t_3 = 0;
22818 
22819  /* "WaveTools.py":1378
22820  * dt = old_div(self.Tp,50.)
22821  * Tlag = np.zeros(len(self.omega),)
22822  * for j in range(len(self.omega)): # <<<<<<<<<<<<<<
22823  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
22824  * Tlag = max(Tlag)
22825  */
22826  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1378, __pyx_L1_error)
22827  __Pyx_GOTREF(__pyx_t_7);
22828  __pyx_t_1 = ((PyObject *)__pyx_v_self->omega);
22829  __Pyx_INCREF(__pyx_t_1);
22830  __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1378, __pyx_L1_error)
22831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22832  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
22833  __Pyx_GOTREF(__pyx_t_1);
22834  __pyx_t_2 = NULL;
22835  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
22836  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
22837  if (likely(__pyx_t_2)) {
22838  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22839  __Pyx_INCREF(__pyx_t_2);
22840  __Pyx_INCREF(function);
22841  __Pyx_DECREF_SET(__pyx_t_7, function);
22842  }
22843  }
22844  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
22845  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
22846  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22847  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error)
22848  __Pyx_GOTREF(__pyx_t_3);
22849  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22850  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
22851  __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
22852  __pyx_t_9 = NULL;
22853  } else {
22854  __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1378, __pyx_L1_error)
22855  __Pyx_GOTREF(__pyx_t_7);
22856  __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1378, __pyx_L1_error)
22857  }
22858  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22859  for (;;) {
22860  if (likely(!__pyx_t_9)) {
22861  if (likely(PyList_CheckExact(__pyx_t_7))) {
22862  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
22863  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22864  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1378, __pyx_L1_error)
22865  #else
22866  __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error)
22867  __Pyx_GOTREF(__pyx_t_3);
22868  #endif
22869  } else {
22870  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
22871  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
22872  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1378, __pyx_L1_error)
22873  #else
22874  __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error)
22875  __Pyx_GOTREF(__pyx_t_3);
22876  #endif
22877  }
22878  } else {
22879  __pyx_t_3 = __pyx_t_9(__pyx_t_7);
22880  if (unlikely(!__pyx_t_3)) {
22881  PyObject* exc_type = PyErr_Occurred();
22882  if (exc_type) {
22883  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
22884  else __PYX_ERR(0, 1378, __pyx_L1_error)
22885  }
22886  break;
22887  }
22888  __Pyx_GOTREF(__pyx_t_3);
22889  }
22890  __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
22891  __pyx_t_3 = 0;
22892 
22893  /* "WaveTools.py":1379
22894  * Tlag = np.zeros(len(self.omega),)
22895  * for j in range(len(self.omega)):
22896  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j]) # <<<<<<<<<<<<<<
22897  * Tlag = max(Tlag)
22898  * Tstart = Tstart - Tlag
22899  */
22900  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
22901  __Pyx_GOTREF(__pyx_t_1);
22902  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error)
22903  __Pyx_GOTREF(__pyx_t_2);
22904  __Pyx_INCREF(__pyx_v_j);
22905  __Pyx_GIVEREF(__pyx_v_j);
22906  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_j);
22907  __Pyx_INCREF(__pyx_slice__4);
22908  __Pyx_GIVEREF(__pyx_slice__4);
22909  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__4);
22910  __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
22911  __Pyx_GOTREF(__pyx_t_5);
22912  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22913  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error)
22914  __Pyx_GOTREF(__pyx_t_2);
22915  __pyx_t_10 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1379, __pyx_L1_error)
22916  __Pyx_GOTREF(__pyx_t_10);
22917  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22918  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22919  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1379, __pyx_L1_error)
22920  __Pyx_GOTREF(__pyx_t_2);
22921  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22922  __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omega), __pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1379, __pyx_L1_error)
22923  __Pyx_GOTREF(__pyx_t_10);
22924  __pyx_t_5 = NULL;
22925  __pyx_t_6 = 0;
22926  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
22927  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
22928  if (likely(__pyx_t_5)) {
22929  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
22930  __Pyx_INCREF(__pyx_t_5);
22931  __Pyx_INCREF(function);
22932  __Pyx_DECREF_SET(__pyx_t_1, function);
22933  __pyx_t_6 = 1;
22934  }
22935  }
22936  #if CYTHON_FAST_PYCALL
22937  if (PyFunction_Check(__pyx_t_1)) {
22938  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_10};
22939  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
22940  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22941  __Pyx_GOTREF(__pyx_t_3);
22942  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22943  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22944  } else
22945  #endif
22946  #if CYTHON_FAST_PYCCALL
22947  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
22948  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_10};
22949  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
22950  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22951  __Pyx_GOTREF(__pyx_t_3);
22952  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22953  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22954  } else
22955  #endif
22956  {
22957  __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1379, __pyx_L1_error)
22958  __Pyx_GOTREF(__pyx_t_11);
22959  if (__pyx_t_5) {
22960  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
22961  }
22962  __Pyx_GIVEREF(__pyx_t_2);
22963  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_t_2);
22964  __Pyx_GIVEREF(__pyx_t_10);
22965  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_10);
22966  __pyx_t_2 = 0;
22967  __pyx_t_10 = 0;
22968  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1379, __pyx_L1_error)
22969  __Pyx_GOTREF(__pyx_t_3);
22970  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
22971  }
22972  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22973  if (unlikely(PyObject_SetItem(__pyx_v_Tlag, __pyx_v_j, __pyx_t_3) < 0)) __PYX_ERR(0, 1379, __pyx_L1_error)
22974  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22975 
22976  /* "WaveTools.py":1378
22977  * dt = old_div(self.Tp,50.)
22978  * Tlag = np.zeros(len(self.omega),)
22979  * for j in range(len(self.omega)): # <<<<<<<<<<<<<<
22980  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
22981  * Tlag = max(Tlag)
22982  */
22983  }
22984  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22985 
22986  /* "WaveTools.py":1380
22987  * for j in range(len(self.omega)):
22988  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
22989  * Tlag = max(Tlag) # <<<<<<<<<<<<<<
22990  * Tstart = Tstart - Tlag
22991  * Np = int(old_div((Tend - Tstart),dt))
22992  */
22993  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_Tlag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1380, __pyx_L1_error)
22994  __Pyx_GOTREF(__pyx_t_7);
22995  __Pyx_DECREF_SET(__pyx_v_Tlag, __pyx_t_7);
22996  __pyx_t_7 = 0;
22997 
22998  /* "WaveTools.py":1381
22999  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
23000  * Tlag = max(Tlag)
23001  * Tstart = Tstart - Tlag # <<<<<<<<<<<<<<
23002  * Np = int(old_div((Tend - Tstart),dt))
23003  * time = np.linspace(Tstart,Tend,Np )
23004  */
23005  __pyx_t_7 = PyNumber_Subtract(__pyx_v_Tstart, __pyx_v_Tlag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1381, __pyx_L1_error)
23006  __Pyx_GOTREF(__pyx_t_7);
23007  __Pyx_DECREF_SET(__pyx_v_Tstart, __pyx_t_7);
23008  __pyx_t_7 = 0;
23009 
23010  /* "WaveTools.py":1382
23011  * Tlag = max(Tlag)
23012  * Tstart = Tstart - Tlag
23013  * Np = int(old_div((Tend - Tstart),dt)) # <<<<<<<<<<<<<<
23014  * time = np.linspace(Tstart,Tend,Np )
23015  * etaR = np.zeros(len(time), )
23016  */
23017  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __pyx_L1_error)
23018  __Pyx_GOTREF(__pyx_t_3);
23019  __pyx_t_1 = PyNumber_Subtract(__pyx_v_Tend, __pyx_v_Tstart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
23020  __Pyx_GOTREF(__pyx_t_1);
23021  __pyx_t_11 = NULL;
23022  __pyx_t_6 = 0;
23023  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
23024  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
23025  if (likely(__pyx_t_11)) {
23026  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
23027  __Pyx_INCREF(__pyx_t_11);
23028  __Pyx_INCREF(function);
23029  __Pyx_DECREF_SET(__pyx_t_3, function);
23030  __pyx_t_6 = 1;
23031  }
23032  }
23033  #if CYTHON_FAST_PYCALL
23034  if (PyFunction_Check(__pyx_t_3)) {
23035  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_dt};
23036  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1382, __pyx_L1_error)
23037  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23038  __Pyx_GOTREF(__pyx_t_7);
23039  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23040  } else
23041  #endif
23042  #if CYTHON_FAST_PYCCALL
23043  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
23044  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_dt};
23045  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1382, __pyx_L1_error)
23046  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23047  __Pyx_GOTREF(__pyx_t_7);
23048  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23049  } else
23050  #endif
23051  {
23052  __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1382, __pyx_L1_error)
23053  __Pyx_GOTREF(__pyx_t_10);
23054  if (__pyx_t_11) {
23055  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
23056  }
23057  __Pyx_GIVEREF(__pyx_t_1);
23058  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_1);
23059  __Pyx_INCREF(__pyx_v_dt);
23060  __Pyx_GIVEREF(__pyx_v_dt);
23061  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_v_dt);
23062  __pyx_t_1 = 0;
23063  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1382, __pyx_L1_error)
23064  __Pyx_GOTREF(__pyx_t_7);
23065  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23066  }
23067  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23068  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __pyx_L1_error)
23069  __Pyx_GOTREF(__pyx_t_3);
23070  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23071  __pyx_v_Np = __pyx_t_3;
23072  __pyx_t_3 = 0;
23073 
23074  /* "WaveTools.py":1383
23075  * Tstart = Tstart - Tlag
23076  * Np = int(old_div((Tend - Tstart),dt))
23077  * time = np.linspace(Tstart,Tend,Np ) # <<<<<<<<<<<<<<
23078  * etaR = np.zeros(len(time), )
23079  * for jj in range(len(time)):
23080  */
23081  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1383, __pyx_L1_error)
23082  __Pyx_GOTREF(__pyx_t_7);
23083  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_linspace); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1383, __pyx_L1_error)
23084  __Pyx_GOTREF(__pyx_t_10);
23085  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23086  __pyx_t_7 = NULL;
23087  __pyx_t_6 = 0;
23088  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
23089  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
23090  if (likely(__pyx_t_7)) {
23091  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
23092  __Pyx_INCREF(__pyx_t_7);
23093  __Pyx_INCREF(function);
23094  __Pyx_DECREF_SET(__pyx_t_10, function);
23095  __pyx_t_6 = 1;
23096  }
23097  }
23098  #if CYTHON_FAST_PYCALL
23099  if (PyFunction_Check(__pyx_t_10)) {
23100  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Np};
23101  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
23102  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23103  __Pyx_GOTREF(__pyx_t_3);
23104  } else
23105  #endif
23106  #if CYTHON_FAST_PYCCALL
23107  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
23108  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Np};
23109  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
23110  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23111  __Pyx_GOTREF(__pyx_t_3);
23112  } else
23113  #endif
23114  {
23115  __pyx_t_1 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error)
23116  __Pyx_GOTREF(__pyx_t_1);
23117  if (__pyx_t_7) {
23118  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
23119  }
23120  __Pyx_INCREF(__pyx_v_Tstart);
23121  __Pyx_GIVEREF(__pyx_v_Tstart);
23122  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_Tstart);
23123  __Pyx_INCREF(__pyx_v_Tend);
23124  __Pyx_GIVEREF(__pyx_v_Tend);
23125  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_Tend);
23126  __Pyx_INCREF(__pyx_v_Np);
23127  __Pyx_GIVEREF(__pyx_v_Np);
23128  PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_6, __pyx_v_Np);
23129  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
23130  __Pyx_GOTREF(__pyx_t_3);
23131  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23132  }
23133  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23134  __pyx_v_time = __pyx_t_3;
23135  __pyx_t_3 = 0;
23136 
23137  /* "WaveTools.py":1384
23138  * Np = int(old_div((Tend - Tstart),dt))
23139  * time = np.linspace(Tstart,Tend,Np )
23140  * etaR = np.zeros(len(time), ) # <<<<<<<<<<<<<<
23141  * for jj in range(len(time)):
23142  * etaR[jj] = self.eta(x0,time[jj])
23143  */
23144  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1384, __pyx_L1_error)
23145  __Pyx_GOTREF(__pyx_t_10);
23146  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error)
23147  __Pyx_GOTREF(__pyx_t_1);
23148  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23149  __pyx_t_8 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1384, __pyx_L1_error)
23150  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1384, __pyx_L1_error)
23151  __Pyx_GOTREF(__pyx_t_10);
23152  __pyx_t_7 = NULL;
23153  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
23154  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
23155  if (likely(__pyx_t_7)) {
23156  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23157  __Pyx_INCREF(__pyx_t_7);
23158  __Pyx_INCREF(function);
23159  __Pyx_DECREF_SET(__pyx_t_1, function);
23160  }
23161  }
23162  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
23163  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23164  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23165  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error)
23166  __Pyx_GOTREF(__pyx_t_3);
23167  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23168  __pyx_v_etaR = __pyx_t_3;
23169  __pyx_t_3 = 0;
23170 
23171  /* "WaveTools.py":1385
23172  * time = np.linspace(Tstart,Tend,Np )
23173  * etaR = np.zeros(len(time), )
23174  * for jj in range(len(time)): # <<<<<<<<<<<<<<
23175  * etaR[jj] = self.eta(x0,time[jj])
23176  * np.savetxt(fname,list(zip(time,etaR)))
23177  */
23178  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
23179  __Pyx_GOTREF(__pyx_t_1);
23180  __pyx_t_8 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1385, __pyx_L1_error)
23181  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1385, __pyx_L1_error)
23182  __Pyx_GOTREF(__pyx_t_10);
23183  __pyx_t_7 = NULL;
23184  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
23185  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
23186  if (likely(__pyx_t_7)) {
23187  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23188  __Pyx_INCREF(__pyx_t_7);
23189  __Pyx_INCREF(function);
23190  __Pyx_DECREF_SET(__pyx_t_1, function);
23191  }
23192  }
23193  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
23194  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23195  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23196  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
23197  __Pyx_GOTREF(__pyx_t_3);
23198  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23199  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
23200  __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
23201  __pyx_t_9 = NULL;
23202  } else {
23203  __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
23204  __Pyx_GOTREF(__pyx_t_1);
23205  __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1385, __pyx_L1_error)
23206  }
23207  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23208  for (;;) {
23209  if (likely(!__pyx_t_9)) {
23210  if (likely(PyList_CheckExact(__pyx_t_1))) {
23211  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
23212  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23213  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1385, __pyx_L1_error)
23214  #else
23215  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
23216  __Pyx_GOTREF(__pyx_t_3);
23217  #endif
23218  } else {
23219  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
23220  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23221  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1385, __pyx_L1_error)
23222  #else
23223  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
23224  __Pyx_GOTREF(__pyx_t_3);
23225  #endif
23226  }
23227  } else {
23228  __pyx_t_3 = __pyx_t_9(__pyx_t_1);
23229  if (unlikely(!__pyx_t_3)) {
23230  PyObject* exc_type = PyErr_Occurred();
23231  if (exc_type) {
23232  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
23233  else __PYX_ERR(0, 1385, __pyx_L1_error)
23234  }
23235  break;
23236  }
23237  __Pyx_GOTREF(__pyx_t_3);
23238  }
23239  __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_3);
23240  __pyx_t_3 = 0;
23241 
23242  /* "WaveTools.py":1386
23243  * etaR = np.zeros(len(time), )
23244  * for jj in range(len(time)):
23245  * etaR[jj] = self.eta(x0,time[jj]) # <<<<<<<<<<<<<<
23246  * np.savetxt(fname,list(zip(time,etaR)))
23247  * series = np.zeros((len(time),2),)
23248  */
23249  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1386, __pyx_L1_error)
23250  __Pyx_GOTREF(__pyx_t_10);
23251  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_time, __pyx_v_jj); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1386, __pyx_L1_error)
23252  __Pyx_GOTREF(__pyx_t_7);
23253  __pyx_t_11 = NULL;
23254  __pyx_t_6 = 0;
23255  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
23256  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
23257  if (likely(__pyx_t_11)) {
23258  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
23259  __Pyx_INCREF(__pyx_t_11);
23260  __Pyx_INCREF(function);
23261  __Pyx_DECREF_SET(__pyx_t_10, function);
23262  __pyx_t_6 = 1;
23263  }
23264  }
23265  #if CYTHON_FAST_PYCALL
23266  if (PyFunction_Check(__pyx_t_10)) {
23267  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_x0, __pyx_t_7};
23268  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
23269  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23270  __Pyx_GOTREF(__pyx_t_3);
23271  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23272  } else
23273  #endif
23274  #if CYTHON_FAST_PYCCALL
23275  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
23276  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_x0, __pyx_t_7};
23277  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
23278  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23279  __Pyx_GOTREF(__pyx_t_3);
23280  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23281  } else
23282  #endif
23283  {
23284  __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1386, __pyx_L1_error)
23285  __Pyx_GOTREF(__pyx_t_2);
23286  if (__pyx_t_11) {
23287  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL;
23288  }
23289  __Pyx_INCREF(__pyx_v_x0);
23290  __Pyx_GIVEREF(__pyx_v_x0);
23291  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_v_x0);
23292  __Pyx_GIVEREF(__pyx_t_7);
23293  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_7);
23294  __pyx_t_7 = 0;
23295  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error)
23296  __Pyx_GOTREF(__pyx_t_3);
23297  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23298  }
23299  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23300  if (unlikely(PyObject_SetItem(__pyx_v_etaR, __pyx_v_jj, __pyx_t_3) < 0)) __PYX_ERR(0, 1386, __pyx_L1_error)
23301  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23302 
23303  /* "WaveTools.py":1385
23304  * time = np.linspace(Tstart,Tend,Np )
23305  * etaR = np.zeros(len(time), )
23306  * for jj in range(len(time)): # <<<<<<<<<<<<<<
23307  * etaR[jj] = self.eta(x0,time[jj])
23308  * np.savetxt(fname,list(zip(time,etaR)))
23309  */
23310  }
23311  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23312 
23313  /* "WaveTools.py":1387
23314  * for jj in range(len(time)):
23315  * etaR[jj] = self.eta(x0,time[jj])
23316  * np.savetxt(fname,list(zip(time,etaR))) # <<<<<<<<<<<<<<
23317  * series = np.zeros((len(time),2),)
23318  * series[:,0] = time
23319  */
23320  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
23321  __Pyx_GOTREF(__pyx_t_3);
23322  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_savetxt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1387, __pyx_L1_error)
23323  __Pyx_GOTREF(__pyx_t_10);
23324  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23325  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_zip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
23326  __Pyx_GOTREF(__pyx_t_2);
23327  __pyx_t_7 = NULL;
23328  __pyx_t_6 = 0;
23329  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
23330  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
23331  if (likely(__pyx_t_7)) {
23332  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
23333  __Pyx_INCREF(__pyx_t_7);
23334  __Pyx_INCREF(function);
23335  __Pyx_DECREF_SET(__pyx_t_2, function);
23336  __pyx_t_6 = 1;
23337  }
23338  }
23339  #if CYTHON_FAST_PYCALL
23340  if (PyFunction_Check(__pyx_t_2)) {
23341  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_time, __pyx_v_etaR};
23342  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
23343  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23344  __Pyx_GOTREF(__pyx_t_3);
23345  } else
23346  #endif
23347  #if CYTHON_FAST_PYCCALL
23348  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
23349  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_time, __pyx_v_etaR};
23350  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
23351  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23352  __Pyx_GOTREF(__pyx_t_3);
23353  } else
23354  #endif
23355  {
23356  __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1387, __pyx_L1_error)
23357  __Pyx_GOTREF(__pyx_t_11);
23358  if (__pyx_t_7) {
23359  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
23360  }
23361  __Pyx_INCREF(__pyx_v_time);
23362  __Pyx_GIVEREF(__pyx_v_time);
23363  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_v_time);
23364  __Pyx_INCREF(__pyx_v_etaR);
23365  __Pyx_GIVEREF(__pyx_v_etaR);
23366  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_v_etaR);
23367  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error)
23368  __Pyx_GOTREF(__pyx_t_3);
23369  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23370  }
23371  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23372  __pyx_t_2 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1387, __pyx_L1_error)
23373  __Pyx_GOTREF(__pyx_t_2);
23374  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23375  __pyx_t_3 = NULL;
23376  __pyx_t_6 = 0;
23377  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
23378  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
23379  if (likely(__pyx_t_3)) {
23380  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
23381  __Pyx_INCREF(__pyx_t_3);
23382  __Pyx_INCREF(function);
23383  __Pyx_DECREF_SET(__pyx_t_10, function);
23384  __pyx_t_6 = 1;
23385  }
23386  }
23387  #if CYTHON_FAST_PYCALL
23388  if (PyFunction_Check(__pyx_t_10)) {
23389  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fname, __pyx_t_2};
23390  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
23391  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23392  __Pyx_GOTREF(__pyx_t_1);
23393  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23394  } else
23395  #endif
23396  #if CYTHON_FAST_PYCCALL
23397  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
23398  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fname, __pyx_t_2};
23399  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
23400  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
23401  __Pyx_GOTREF(__pyx_t_1);
23402  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23403  } else
23404  #endif
23405  {
23406  __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1387, __pyx_L1_error)
23407  __Pyx_GOTREF(__pyx_t_11);
23408  if (__pyx_t_3) {
23409  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
23410  }
23411  __Pyx_INCREF(__pyx_v_fname);
23412  __Pyx_GIVEREF(__pyx_v_fname);
23413  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_v_fname);
23414  __Pyx_GIVEREF(__pyx_t_2);
23415  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_2);
23416  __pyx_t_2 = 0;
23417  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
23418  __Pyx_GOTREF(__pyx_t_1);
23419  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23420  }
23421  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23422  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23423 
23424  /* "WaveTools.py":1388
23425  * etaR[jj] = self.eta(x0,time[jj])
23426  * np.savetxt(fname,list(zip(time,etaR)))
23427  * series = np.zeros((len(time),2),) # <<<<<<<<<<<<<<
23428  * series[:,0] = time
23429  * series[:,1] = etaR
23430  */
23431  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1388, __pyx_L1_error)
23432  __Pyx_GOTREF(__pyx_t_10);
23433  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1388, __pyx_L1_error)
23434  __Pyx_GOTREF(__pyx_t_11);
23435  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23436  __pyx_t_8 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1388, __pyx_L1_error)
23437  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1388, __pyx_L1_error)
23438  __Pyx_GOTREF(__pyx_t_10);
23439  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error)
23440  __Pyx_GOTREF(__pyx_t_2);
23441  __Pyx_GIVEREF(__pyx_t_10);
23442  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
23443  __Pyx_INCREF(__pyx_int_2);
23444  __Pyx_GIVEREF(__pyx_int_2);
23445  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_2);
23446  __pyx_t_10 = 0;
23447  __pyx_t_10 = NULL;
23448  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
23449  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
23450  if (likely(__pyx_t_10)) {
23451  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
23452  __Pyx_INCREF(__pyx_t_10);
23453  __Pyx_INCREF(function);
23454  __Pyx_DECREF_SET(__pyx_t_11, function);
23455  }
23456  }
23457  __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2);
23458  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
23459  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23460  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
23461  __Pyx_GOTREF(__pyx_t_1);
23462  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23463  __pyx_v_series = __pyx_t_1;
23464  __pyx_t_1 = 0;
23465 
23466  /* "WaveTools.py":1389
23467  * np.savetxt(fname,list(zip(time,etaR)))
23468  * series = np.zeros((len(time),2),)
23469  * series[:,0] = time # <<<<<<<<<<<<<<
23470  * series[:,1] = etaR
23471  *
23472  */
23473  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_tuple__25, __pyx_v_time) < 0)) __PYX_ERR(0, 1389, __pyx_L1_error)
23474 
23475  /* "WaveTools.py":1390
23476  * series = np.zeros((len(time),2),)
23477  * series[:,0] = time
23478  * series[:,1] = etaR # <<<<<<<<<<<<<<
23479  *
23480  * return series
23481  */
23482  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_tuple__26, __pyx_v_etaR) < 0)) __PYX_ERR(0, 1390, __pyx_L1_error)
23483 
23484  /* "WaveTools.py":1392
23485  * series[:,1] = etaR
23486  *
23487  * return series # <<<<<<<<<<<<<<
23488  *
23489  * class RandomWaves(object):
23490  */
23491  __Pyx_XDECREF(__pyx_r);
23492  __Pyx_INCREF(__pyx_v_series);
23493  __pyx_r = __pyx_v_series;
23494  goto __pyx_L0;
23495 
23496  /* "WaveTools.py":1347
23497  *
23498  * return U
23499  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
23500  * """Writes a timeseries of the free-surface elevation
23501  *
23502  */
23503 
23504  /* function exit code */
23505  __pyx_L1_error:;
23506  __Pyx_XDECREF(__pyx_t_1);
23507  __Pyx_XDECREF(__pyx_t_2);
23508  __Pyx_XDECREF(__pyx_t_3);
23509  __Pyx_XDECREF(__pyx_t_5);
23510  __Pyx_XDECREF(__pyx_t_7);
23511  __Pyx_XDECREF(__pyx_t_10);
23512  __Pyx_XDECREF(__pyx_t_11);
23513  __Pyx_AddTraceback("WaveTools.NewWave.writeEtaSeries", __pyx_clineno, __pyx_lineno, __pyx_filename);
23514  __pyx_r = NULL;
23515  __pyx_L0:;
23516  __Pyx_XDECREF(__pyx_v_dt);
23517  __Pyx_XDECREF(__pyx_v_Tlag);
23518  __Pyx_XDECREF(__pyx_v_j);
23519  __Pyx_XDECREF(__pyx_v_Np);
23520  __Pyx_XDECREF(__pyx_v_time);
23521  __Pyx_XDECREF(__pyx_v_etaR);
23522  __Pyx_XDECREF(__pyx_v_jj);
23523  __Pyx_XDECREF(__pyx_v_series);
23524  __Pyx_XDECREF(__pyx_v_Tstart);
23525  __Pyx_XGIVEREF(__pyx_r);
23526  __Pyx_RefNannyFinishContext();
23527  return __pyx_r;
23528 }
23529 
23530 /* "WaveTools.pxd":98
23531  * cdef double[10000] phi_c
23532  * cdef public:
23533  * double mwl,depth,gAbs,Tlag,Hs,Tp,fp,bandFactor,df,focus,tfocus # <<<<<<<<<<<<<<
23534  * int N
23535  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai
23536  */
23537 
23538 /* Python wrapper */
23539 static PyObject *__pyx_pw_9WaveTools_7NewWave_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
23540 static PyObject *__pyx_pw_9WaveTools_7NewWave_3mwl_1__get__(PyObject *__pyx_v_self) {
23541  PyObject *__pyx_r = 0;
23542  __Pyx_RefNannyDeclarations
23543  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23544  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3mwl___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23545 
23546  /* function exit code */
23547  __Pyx_RefNannyFinishContext();
23548  return __pyx_r;
23549 }
23550 
23551 static PyObject *__pyx_pf_9WaveTools_7NewWave_3mwl___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23552  PyObject *__pyx_r = NULL;
23553  __Pyx_RefNannyDeclarations
23554  PyObject *__pyx_t_1 = NULL;
23555  __Pyx_RefNannySetupContext("__get__", 0);
23556  __Pyx_XDECREF(__pyx_r);
23557  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23558  __Pyx_GOTREF(__pyx_t_1);
23559  __pyx_r = __pyx_t_1;
23560  __pyx_t_1 = 0;
23561  goto __pyx_L0;
23562 
23563  /* function exit code */
23564  __pyx_L1_error:;
23565  __Pyx_XDECREF(__pyx_t_1);
23566  __Pyx_AddTraceback("WaveTools.NewWave.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23567  __pyx_r = NULL;
23568  __pyx_L0:;
23569  __Pyx_XGIVEREF(__pyx_r);
23570  __Pyx_RefNannyFinishContext();
23571  return __pyx_r;
23572 }
23573 
23574 /* Python wrapper */
23575 static int __pyx_pw_9WaveTools_7NewWave_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23576 static int __pyx_pw_9WaveTools_7NewWave_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23577  int __pyx_r;
23578  __Pyx_RefNannyDeclarations
23579  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23580  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3mwl_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23581 
23582  /* function exit code */
23583  __Pyx_RefNannyFinishContext();
23584  return __pyx_r;
23585 }
23586 
23587 static int __pyx_pf_9WaveTools_7NewWave_3mwl_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23588  int __pyx_r;
23589  __Pyx_RefNannyDeclarations
23590  double __pyx_t_1;
23591  __Pyx_RefNannySetupContext("__set__", 0);
23592  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
23593  __pyx_v_self->mwl = __pyx_t_1;
23594 
23595  /* function exit code */
23596  __pyx_r = 0;
23597  goto __pyx_L0;
23598  __pyx_L1_error:;
23599  __Pyx_AddTraceback("WaveTools.NewWave.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23600  __pyx_r = -1;
23601  __pyx_L0:;
23602  __Pyx_RefNannyFinishContext();
23603  return __pyx_r;
23604 }
23605 
23606 /* Python wrapper */
23607 static PyObject *__pyx_pw_9WaveTools_7NewWave_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
23608 static PyObject *__pyx_pw_9WaveTools_7NewWave_5depth_1__get__(PyObject *__pyx_v_self) {
23609  PyObject *__pyx_r = 0;
23610  __Pyx_RefNannyDeclarations
23611  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23612  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5depth___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23613 
23614  /* function exit code */
23615  __Pyx_RefNannyFinishContext();
23616  return __pyx_r;
23617 }
23618 
23619 static PyObject *__pyx_pf_9WaveTools_7NewWave_5depth___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23620  PyObject *__pyx_r = NULL;
23621  __Pyx_RefNannyDeclarations
23622  PyObject *__pyx_t_1 = NULL;
23623  __Pyx_RefNannySetupContext("__get__", 0);
23624  __Pyx_XDECREF(__pyx_r);
23625  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23626  __Pyx_GOTREF(__pyx_t_1);
23627  __pyx_r = __pyx_t_1;
23628  __pyx_t_1 = 0;
23629  goto __pyx_L0;
23630 
23631  /* function exit code */
23632  __pyx_L1_error:;
23633  __Pyx_XDECREF(__pyx_t_1);
23634  __Pyx_AddTraceback("WaveTools.NewWave.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23635  __pyx_r = NULL;
23636  __pyx_L0:;
23637  __Pyx_XGIVEREF(__pyx_r);
23638  __Pyx_RefNannyFinishContext();
23639  return __pyx_r;
23640 }
23641 
23642 /* Python wrapper */
23643 static int __pyx_pw_9WaveTools_7NewWave_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23644 static int __pyx_pw_9WaveTools_7NewWave_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23645  int __pyx_r;
23646  __Pyx_RefNannyDeclarations
23647  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23648  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5depth_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23649 
23650  /* function exit code */
23651  __Pyx_RefNannyFinishContext();
23652  return __pyx_r;
23653 }
23654 
23655 static int __pyx_pf_9WaveTools_7NewWave_5depth_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23656  int __pyx_r;
23657  __Pyx_RefNannyDeclarations
23658  double __pyx_t_1;
23659  __Pyx_RefNannySetupContext("__set__", 0);
23660  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
23661  __pyx_v_self->depth = __pyx_t_1;
23662 
23663  /* function exit code */
23664  __pyx_r = 0;
23665  goto __pyx_L0;
23666  __pyx_L1_error:;
23667  __Pyx_AddTraceback("WaveTools.NewWave.depth.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23668  __pyx_r = -1;
23669  __pyx_L0:;
23670  __Pyx_RefNannyFinishContext();
23671  return __pyx_r;
23672 }
23673 
23674 /* Python wrapper */
23675 static PyObject *__pyx_pw_9WaveTools_7NewWave_4gAbs_1__get__(PyObject *__pyx_v_self); /*proto*/
23676 static PyObject *__pyx_pw_9WaveTools_7NewWave_4gAbs_1__get__(PyObject *__pyx_v_self) {
23677  PyObject *__pyx_r = 0;
23678  __Pyx_RefNannyDeclarations
23679  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23680  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4gAbs___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23681 
23682  /* function exit code */
23683  __Pyx_RefNannyFinishContext();
23684  return __pyx_r;
23685 }
23686 
23687 static PyObject *__pyx_pf_9WaveTools_7NewWave_4gAbs___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23688  PyObject *__pyx_r = NULL;
23689  __Pyx_RefNannyDeclarations
23690  PyObject *__pyx_t_1 = NULL;
23691  __Pyx_RefNannySetupContext("__get__", 0);
23692  __Pyx_XDECREF(__pyx_r);
23693  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23694  __Pyx_GOTREF(__pyx_t_1);
23695  __pyx_r = __pyx_t_1;
23696  __pyx_t_1 = 0;
23697  goto __pyx_L0;
23698 
23699  /* function exit code */
23700  __pyx_L1_error:;
23701  __Pyx_XDECREF(__pyx_t_1);
23702  __Pyx_AddTraceback("WaveTools.NewWave.gAbs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23703  __pyx_r = NULL;
23704  __pyx_L0:;
23705  __Pyx_XGIVEREF(__pyx_r);
23706  __Pyx_RefNannyFinishContext();
23707  return __pyx_r;
23708 }
23709 
23710 /* Python wrapper */
23711 static int __pyx_pw_9WaveTools_7NewWave_4gAbs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23712 static int __pyx_pw_9WaveTools_7NewWave_4gAbs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23713  int __pyx_r;
23714  __Pyx_RefNannyDeclarations
23715  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23716  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4gAbs_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23717 
23718  /* function exit code */
23719  __Pyx_RefNannyFinishContext();
23720  return __pyx_r;
23721 }
23722 
23723 static int __pyx_pf_9WaveTools_7NewWave_4gAbs_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23724  int __pyx_r;
23725  __Pyx_RefNannyDeclarations
23726  double __pyx_t_1;
23727  __Pyx_RefNannySetupContext("__set__", 0);
23728  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
23729  __pyx_v_self->gAbs = __pyx_t_1;
23730 
23731  /* function exit code */
23732  __pyx_r = 0;
23733  goto __pyx_L0;
23734  __pyx_L1_error:;
23735  __Pyx_AddTraceback("WaveTools.NewWave.gAbs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23736  __pyx_r = -1;
23737  __pyx_L0:;
23738  __Pyx_RefNannyFinishContext();
23739  return __pyx_r;
23740 }
23741 
23742 /* Python wrapper */
23743 static PyObject *__pyx_pw_9WaveTools_7NewWave_4Tlag_1__get__(PyObject *__pyx_v_self); /*proto*/
23744 static PyObject *__pyx_pw_9WaveTools_7NewWave_4Tlag_1__get__(PyObject *__pyx_v_self) {
23745  PyObject *__pyx_r = 0;
23746  __Pyx_RefNannyDeclarations
23747  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23748  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4Tlag___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23749 
23750  /* function exit code */
23751  __Pyx_RefNannyFinishContext();
23752  return __pyx_r;
23753 }
23754 
23755 static PyObject *__pyx_pf_9WaveTools_7NewWave_4Tlag___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23756  PyObject *__pyx_r = NULL;
23757  __Pyx_RefNannyDeclarations
23758  PyObject *__pyx_t_1 = NULL;
23759  __Pyx_RefNannySetupContext("__get__", 0);
23760  __Pyx_XDECREF(__pyx_r);
23761  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Tlag); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23762  __Pyx_GOTREF(__pyx_t_1);
23763  __pyx_r = __pyx_t_1;
23764  __pyx_t_1 = 0;
23765  goto __pyx_L0;
23766 
23767  /* function exit code */
23768  __pyx_L1_error:;
23769  __Pyx_XDECREF(__pyx_t_1);
23770  __Pyx_AddTraceback("WaveTools.NewWave.Tlag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23771  __pyx_r = NULL;
23772  __pyx_L0:;
23773  __Pyx_XGIVEREF(__pyx_r);
23774  __Pyx_RefNannyFinishContext();
23775  return __pyx_r;
23776 }
23777 
23778 /* Python wrapper */
23779 static int __pyx_pw_9WaveTools_7NewWave_4Tlag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23780 static int __pyx_pw_9WaveTools_7NewWave_4Tlag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23781  int __pyx_r;
23782  __Pyx_RefNannyDeclarations
23783  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23784  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4Tlag_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23785 
23786  /* function exit code */
23787  __Pyx_RefNannyFinishContext();
23788  return __pyx_r;
23789 }
23790 
23791 static int __pyx_pf_9WaveTools_7NewWave_4Tlag_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23792  int __pyx_r;
23793  __Pyx_RefNannyDeclarations
23794  double __pyx_t_1;
23795  __Pyx_RefNannySetupContext("__set__", 0);
23796  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
23797  __pyx_v_self->Tlag = __pyx_t_1;
23798 
23799  /* function exit code */
23800  __pyx_r = 0;
23801  goto __pyx_L0;
23802  __pyx_L1_error:;
23803  __Pyx_AddTraceback("WaveTools.NewWave.Tlag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23804  __pyx_r = -1;
23805  __pyx_L0:;
23806  __Pyx_RefNannyFinishContext();
23807  return __pyx_r;
23808 }
23809 
23810 /* Python wrapper */
23811 static PyObject *__pyx_pw_9WaveTools_7NewWave_2Hs_1__get__(PyObject *__pyx_v_self); /*proto*/
23812 static PyObject *__pyx_pw_9WaveTools_7NewWave_2Hs_1__get__(PyObject *__pyx_v_self) {
23813  PyObject *__pyx_r = 0;
23814  __Pyx_RefNannyDeclarations
23815  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23816  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2Hs___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23817 
23818  /* function exit code */
23819  __Pyx_RefNannyFinishContext();
23820  return __pyx_r;
23821 }
23822 
23823 static PyObject *__pyx_pf_9WaveTools_7NewWave_2Hs___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23824  PyObject *__pyx_r = NULL;
23825  __Pyx_RefNannyDeclarations
23826  PyObject *__pyx_t_1 = NULL;
23827  __Pyx_RefNannySetupContext("__get__", 0);
23828  __Pyx_XDECREF(__pyx_r);
23829  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Hs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23830  __Pyx_GOTREF(__pyx_t_1);
23831  __pyx_r = __pyx_t_1;
23832  __pyx_t_1 = 0;
23833  goto __pyx_L0;
23834 
23835  /* function exit code */
23836  __pyx_L1_error:;
23837  __Pyx_XDECREF(__pyx_t_1);
23838  __Pyx_AddTraceback("WaveTools.NewWave.Hs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23839  __pyx_r = NULL;
23840  __pyx_L0:;
23841  __Pyx_XGIVEREF(__pyx_r);
23842  __Pyx_RefNannyFinishContext();
23843  return __pyx_r;
23844 }
23845 
23846 /* Python wrapper */
23847 static int __pyx_pw_9WaveTools_7NewWave_2Hs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23848 static int __pyx_pw_9WaveTools_7NewWave_2Hs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23849  int __pyx_r;
23850  __Pyx_RefNannyDeclarations
23851  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23852  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2Hs_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23853 
23854  /* function exit code */
23855  __Pyx_RefNannyFinishContext();
23856  return __pyx_r;
23857 }
23858 
23859 static int __pyx_pf_9WaveTools_7NewWave_2Hs_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23860  int __pyx_r;
23861  __Pyx_RefNannyDeclarations
23862  double __pyx_t_1;
23863  __Pyx_RefNannySetupContext("__set__", 0);
23864  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
23865  __pyx_v_self->Hs = __pyx_t_1;
23866 
23867  /* function exit code */
23868  __pyx_r = 0;
23869  goto __pyx_L0;
23870  __pyx_L1_error:;
23871  __Pyx_AddTraceback("WaveTools.NewWave.Hs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23872  __pyx_r = -1;
23873  __pyx_L0:;
23874  __Pyx_RefNannyFinishContext();
23875  return __pyx_r;
23876 }
23877 
23878 /* Python wrapper */
23879 static PyObject *__pyx_pw_9WaveTools_7NewWave_2Tp_1__get__(PyObject *__pyx_v_self); /*proto*/
23880 static PyObject *__pyx_pw_9WaveTools_7NewWave_2Tp_1__get__(PyObject *__pyx_v_self) {
23881  PyObject *__pyx_r = 0;
23882  __Pyx_RefNannyDeclarations
23883  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23884  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2Tp___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23885 
23886  /* function exit code */
23887  __Pyx_RefNannyFinishContext();
23888  return __pyx_r;
23889 }
23890 
23891 static PyObject *__pyx_pf_9WaveTools_7NewWave_2Tp___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23892  PyObject *__pyx_r = NULL;
23893  __Pyx_RefNannyDeclarations
23894  PyObject *__pyx_t_1 = NULL;
23895  __Pyx_RefNannySetupContext("__get__", 0);
23896  __Pyx_XDECREF(__pyx_r);
23897  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Tp); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23898  __Pyx_GOTREF(__pyx_t_1);
23899  __pyx_r = __pyx_t_1;
23900  __pyx_t_1 = 0;
23901  goto __pyx_L0;
23902 
23903  /* function exit code */
23904  __pyx_L1_error:;
23905  __Pyx_XDECREF(__pyx_t_1);
23906  __Pyx_AddTraceback("WaveTools.NewWave.Tp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23907  __pyx_r = NULL;
23908  __pyx_L0:;
23909  __Pyx_XGIVEREF(__pyx_r);
23910  __Pyx_RefNannyFinishContext();
23911  return __pyx_r;
23912 }
23913 
23914 /* Python wrapper */
23915 static int __pyx_pw_9WaveTools_7NewWave_2Tp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23916 static int __pyx_pw_9WaveTools_7NewWave_2Tp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23917  int __pyx_r;
23918  __Pyx_RefNannyDeclarations
23919  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23920  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2Tp_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23921 
23922  /* function exit code */
23923  __Pyx_RefNannyFinishContext();
23924  return __pyx_r;
23925 }
23926 
23927 static int __pyx_pf_9WaveTools_7NewWave_2Tp_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23928  int __pyx_r;
23929  __Pyx_RefNannyDeclarations
23930  double __pyx_t_1;
23931  __Pyx_RefNannySetupContext("__set__", 0);
23932  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
23933  __pyx_v_self->Tp = __pyx_t_1;
23934 
23935  /* function exit code */
23936  __pyx_r = 0;
23937  goto __pyx_L0;
23938  __pyx_L1_error:;
23939  __Pyx_AddTraceback("WaveTools.NewWave.Tp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23940  __pyx_r = -1;
23941  __pyx_L0:;
23942  __Pyx_RefNannyFinishContext();
23943  return __pyx_r;
23944 }
23945 
23946 /* Python wrapper */
23947 static PyObject *__pyx_pw_9WaveTools_7NewWave_2fp_1__get__(PyObject *__pyx_v_self); /*proto*/
23948 static PyObject *__pyx_pw_9WaveTools_7NewWave_2fp_1__get__(PyObject *__pyx_v_self) {
23949  PyObject *__pyx_r = 0;
23950  __Pyx_RefNannyDeclarations
23951  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
23952  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2fp___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
23953 
23954  /* function exit code */
23955  __Pyx_RefNannyFinishContext();
23956  return __pyx_r;
23957 }
23958 
23959 static PyObject *__pyx_pf_9WaveTools_7NewWave_2fp___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
23960  PyObject *__pyx_r = NULL;
23961  __Pyx_RefNannyDeclarations
23962  PyObject *__pyx_t_1 = NULL;
23963  __Pyx_RefNannySetupContext("__get__", 0);
23964  __Pyx_XDECREF(__pyx_r);
23965  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->fp); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
23966  __Pyx_GOTREF(__pyx_t_1);
23967  __pyx_r = __pyx_t_1;
23968  __pyx_t_1 = 0;
23969  goto __pyx_L0;
23970 
23971  /* function exit code */
23972  __pyx_L1_error:;
23973  __Pyx_XDECREF(__pyx_t_1);
23974  __Pyx_AddTraceback("WaveTools.NewWave.fp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
23975  __pyx_r = NULL;
23976  __pyx_L0:;
23977  __Pyx_XGIVEREF(__pyx_r);
23978  __Pyx_RefNannyFinishContext();
23979  return __pyx_r;
23980 }
23981 
23982 /* Python wrapper */
23983 static int __pyx_pw_9WaveTools_7NewWave_2fp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
23984 static int __pyx_pw_9WaveTools_7NewWave_2fp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
23985  int __pyx_r;
23986  __Pyx_RefNannyDeclarations
23987  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
23988  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2fp_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
23989 
23990  /* function exit code */
23991  __Pyx_RefNannyFinishContext();
23992  return __pyx_r;
23993 }
23994 
23995 static int __pyx_pf_9WaveTools_7NewWave_2fp_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
23996  int __pyx_r;
23997  __Pyx_RefNannyDeclarations
23998  double __pyx_t_1;
23999  __Pyx_RefNannySetupContext("__set__", 0);
24000  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
24001  __pyx_v_self->fp = __pyx_t_1;
24002 
24003  /* function exit code */
24004  __pyx_r = 0;
24005  goto __pyx_L0;
24006  __pyx_L1_error:;
24007  __Pyx_AddTraceback("WaveTools.NewWave.fp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24008  __pyx_r = -1;
24009  __pyx_L0:;
24010  __Pyx_RefNannyFinishContext();
24011  return __pyx_r;
24012 }
24013 
24014 /* Python wrapper */
24015 static PyObject *__pyx_pw_9WaveTools_7NewWave_10bandFactor_1__get__(PyObject *__pyx_v_self); /*proto*/
24016 static PyObject *__pyx_pw_9WaveTools_7NewWave_10bandFactor_1__get__(PyObject *__pyx_v_self) {
24017  PyObject *__pyx_r = 0;
24018  __Pyx_RefNannyDeclarations
24019  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24020  __pyx_r = __pyx_pf_9WaveTools_7NewWave_10bandFactor___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24021 
24022  /* function exit code */
24023  __Pyx_RefNannyFinishContext();
24024  return __pyx_r;
24025 }
24026 
24027 static PyObject *__pyx_pf_9WaveTools_7NewWave_10bandFactor___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24028  PyObject *__pyx_r = NULL;
24029  __Pyx_RefNannyDeclarations
24030  PyObject *__pyx_t_1 = NULL;
24031  __Pyx_RefNannySetupContext("__get__", 0);
24032  __Pyx_XDECREF(__pyx_r);
24033  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->bandFactor); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
24034  __Pyx_GOTREF(__pyx_t_1);
24035  __pyx_r = __pyx_t_1;
24036  __pyx_t_1 = 0;
24037  goto __pyx_L0;
24038 
24039  /* function exit code */
24040  __pyx_L1_error:;
24041  __Pyx_XDECREF(__pyx_t_1);
24042  __Pyx_AddTraceback("WaveTools.NewWave.bandFactor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24043  __pyx_r = NULL;
24044  __pyx_L0:;
24045  __Pyx_XGIVEREF(__pyx_r);
24046  __Pyx_RefNannyFinishContext();
24047  return __pyx_r;
24048 }
24049 
24050 /* Python wrapper */
24051 static int __pyx_pw_9WaveTools_7NewWave_10bandFactor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24052 static int __pyx_pw_9WaveTools_7NewWave_10bandFactor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24053  int __pyx_r;
24054  __Pyx_RefNannyDeclarations
24055  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24056  __pyx_r = __pyx_pf_9WaveTools_7NewWave_10bandFactor_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24057 
24058  /* function exit code */
24059  __Pyx_RefNannyFinishContext();
24060  return __pyx_r;
24061 }
24062 
24063 static int __pyx_pf_9WaveTools_7NewWave_10bandFactor_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24064  int __pyx_r;
24065  __Pyx_RefNannyDeclarations
24066  double __pyx_t_1;
24067  __Pyx_RefNannySetupContext("__set__", 0);
24068  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
24069  __pyx_v_self->bandFactor = __pyx_t_1;
24070 
24071  /* function exit code */
24072  __pyx_r = 0;
24073  goto __pyx_L0;
24074  __pyx_L1_error:;
24075  __Pyx_AddTraceback("WaveTools.NewWave.bandFactor.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24076  __pyx_r = -1;
24077  __pyx_L0:;
24078  __Pyx_RefNannyFinishContext();
24079  return __pyx_r;
24080 }
24081 
24082 /* Python wrapper */
24083 static PyObject *__pyx_pw_9WaveTools_7NewWave_2df_1__get__(PyObject *__pyx_v_self); /*proto*/
24084 static PyObject *__pyx_pw_9WaveTools_7NewWave_2df_1__get__(PyObject *__pyx_v_self) {
24085  PyObject *__pyx_r = 0;
24086  __Pyx_RefNannyDeclarations
24087  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24088  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2df___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24089 
24090  /* function exit code */
24091  __Pyx_RefNannyFinishContext();
24092  return __pyx_r;
24093 }
24094 
24095 static PyObject *__pyx_pf_9WaveTools_7NewWave_2df___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24096  PyObject *__pyx_r = NULL;
24097  __Pyx_RefNannyDeclarations
24098  PyObject *__pyx_t_1 = NULL;
24099  __Pyx_RefNannySetupContext("__get__", 0);
24100  __Pyx_XDECREF(__pyx_r);
24101  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->df); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
24102  __Pyx_GOTREF(__pyx_t_1);
24103  __pyx_r = __pyx_t_1;
24104  __pyx_t_1 = 0;
24105  goto __pyx_L0;
24106 
24107  /* function exit code */
24108  __pyx_L1_error:;
24109  __Pyx_XDECREF(__pyx_t_1);
24110  __Pyx_AddTraceback("WaveTools.NewWave.df.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24111  __pyx_r = NULL;
24112  __pyx_L0:;
24113  __Pyx_XGIVEREF(__pyx_r);
24114  __Pyx_RefNannyFinishContext();
24115  return __pyx_r;
24116 }
24117 
24118 /* Python wrapper */
24119 static int __pyx_pw_9WaveTools_7NewWave_2df_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24120 static int __pyx_pw_9WaveTools_7NewWave_2df_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24121  int __pyx_r;
24122  __Pyx_RefNannyDeclarations
24123  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24124  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2df_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24125 
24126  /* function exit code */
24127  __Pyx_RefNannyFinishContext();
24128  return __pyx_r;
24129 }
24130 
24131 static int __pyx_pf_9WaveTools_7NewWave_2df_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24132  int __pyx_r;
24133  __Pyx_RefNannyDeclarations
24134  double __pyx_t_1;
24135  __Pyx_RefNannySetupContext("__set__", 0);
24136  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
24137  __pyx_v_self->df = __pyx_t_1;
24138 
24139  /* function exit code */
24140  __pyx_r = 0;
24141  goto __pyx_L0;
24142  __pyx_L1_error:;
24143  __Pyx_AddTraceback("WaveTools.NewWave.df.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24144  __pyx_r = -1;
24145  __pyx_L0:;
24146  __Pyx_RefNannyFinishContext();
24147  return __pyx_r;
24148 }
24149 
24150 /* Python wrapper */
24151 static PyObject *__pyx_pw_9WaveTools_7NewWave_5focus_1__get__(PyObject *__pyx_v_self); /*proto*/
24152 static PyObject *__pyx_pw_9WaveTools_7NewWave_5focus_1__get__(PyObject *__pyx_v_self) {
24153  PyObject *__pyx_r = 0;
24154  __Pyx_RefNannyDeclarations
24155  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24156  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5focus___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24157 
24158  /* function exit code */
24159  __Pyx_RefNannyFinishContext();
24160  return __pyx_r;
24161 }
24162 
24163 static PyObject *__pyx_pf_9WaveTools_7NewWave_5focus___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24164  PyObject *__pyx_r = NULL;
24165  __Pyx_RefNannyDeclarations
24166  PyObject *__pyx_t_1 = NULL;
24167  __Pyx_RefNannySetupContext("__get__", 0);
24168  __Pyx_XDECREF(__pyx_r);
24169  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->focus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
24170  __Pyx_GOTREF(__pyx_t_1);
24171  __pyx_r = __pyx_t_1;
24172  __pyx_t_1 = 0;
24173  goto __pyx_L0;
24174 
24175  /* function exit code */
24176  __pyx_L1_error:;
24177  __Pyx_XDECREF(__pyx_t_1);
24178  __Pyx_AddTraceback("WaveTools.NewWave.focus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24179  __pyx_r = NULL;
24180  __pyx_L0:;
24181  __Pyx_XGIVEREF(__pyx_r);
24182  __Pyx_RefNannyFinishContext();
24183  return __pyx_r;
24184 }
24185 
24186 /* Python wrapper */
24187 static int __pyx_pw_9WaveTools_7NewWave_5focus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24188 static int __pyx_pw_9WaveTools_7NewWave_5focus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24189  int __pyx_r;
24190  __Pyx_RefNannyDeclarations
24191  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24192  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5focus_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24193 
24194  /* function exit code */
24195  __Pyx_RefNannyFinishContext();
24196  return __pyx_r;
24197 }
24198 
24199 static int __pyx_pf_9WaveTools_7NewWave_5focus_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24200  int __pyx_r;
24201  __Pyx_RefNannyDeclarations
24202  double __pyx_t_1;
24203  __Pyx_RefNannySetupContext("__set__", 0);
24204  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
24205  __pyx_v_self->focus = __pyx_t_1;
24206 
24207  /* function exit code */
24208  __pyx_r = 0;
24209  goto __pyx_L0;
24210  __pyx_L1_error:;
24211  __Pyx_AddTraceback("WaveTools.NewWave.focus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24212  __pyx_r = -1;
24213  __pyx_L0:;
24214  __Pyx_RefNannyFinishContext();
24215  return __pyx_r;
24216 }
24217 
24218 /* Python wrapper */
24219 static PyObject *__pyx_pw_9WaveTools_7NewWave_6tfocus_1__get__(PyObject *__pyx_v_self); /*proto*/
24220 static PyObject *__pyx_pw_9WaveTools_7NewWave_6tfocus_1__get__(PyObject *__pyx_v_self) {
24221  PyObject *__pyx_r = 0;
24222  __Pyx_RefNannyDeclarations
24223  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24224  __pyx_r = __pyx_pf_9WaveTools_7NewWave_6tfocus___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24225 
24226  /* function exit code */
24227  __Pyx_RefNannyFinishContext();
24228  return __pyx_r;
24229 }
24230 
24231 static PyObject *__pyx_pf_9WaveTools_7NewWave_6tfocus___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24232  PyObject *__pyx_r = NULL;
24233  __Pyx_RefNannyDeclarations
24234  PyObject *__pyx_t_1 = NULL;
24235  __Pyx_RefNannySetupContext("__get__", 0);
24236  __Pyx_XDECREF(__pyx_r);
24237  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->tfocus); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 98, __pyx_L1_error)
24238  __Pyx_GOTREF(__pyx_t_1);
24239  __pyx_r = __pyx_t_1;
24240  __pyx_t_1 = 0;
24241  goto __pyx_L0;
24242 
24243  /* function exit code */
24244  __pyx_L1_error:;
24245  __Pyx_XDECREF(__pyx_t_1);
24246  __Pyx_AddTraceback("WaveTools.NewWave.tfocus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24247  __pyx_r = NULL;
24248  __pyx_L0:;
24249  __Pyx_XGIVEREF(__pyx_r);
24250  __Pyx_RefNannyFinishContext();
24251  return __pyx_r;
24252 }
24253 
24254 /* Python wrapper */
24255 static int __pyx_pw_9WaveTools_7NewWave_6tfocus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24256 static int __pyx_pw_9WaveTools_7NewWave_6tfocus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24257  int __pyx_r;
24258  __Pyx_RefNannyDeclarations
24259  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24260  __pyx_r = __pyx_pf_9WaveTools_7NewWave_6tfocus_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24261 
24262  /* function exit code */
24263  __Pyx_RefNannyFinishContext();
24264  return __pyx_r;
24265 }
24266 
24267 static int __pyx_pf_9WaveTools_7NewWave_6tfocus_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24268  int __pyx_r;
24269  __Pyx_RefNannyDeclarations
24270  double __pyx_t_1;
24271  __Pyx_RefNannySetupContext("__set__", 0);
24272  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 98, __pyx_L1_error)
24273  __pyx_v_self->tfocus = __pyx_t_1;
24274 
24275  /* function exit code */
24276  __pyx_r = 0;
24277  goto __pyx_L0;
24278  __pyx_L1_error:;
24279  __Pyx_AddTraceback("WaveTools.NewWave.tfocus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24280  __pyx_r = -1;
24281  __pyx_L0:;
24282  __Pyx_RefNannyFinishContext();
24283  return __pyx_r;
24284 }
24285 
24286 /* "WaveTools.pxd":99
24287  * cdef public:
24288  * double mwl,depth,gAbs,Tlag,Hs,Tp,fp,bandFactor,df,focus,tfocus
24289  * int N # <<<<<<<<<<<<<<
24290  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai
24291  * cdef object phi
24292  */
24293 
24294 /* Python wrapper */
24295 static PyObject *__pyx_pw_9WaveTools_7NewWave_1N_1__get__(PyObject *__pyx_v_self); /*proto*/
24296 static PyObject *__pyx_pw_9WaveTools_7NewWave_1N_1__get__(PyObject *__pyx_v_self) {
24297  PyObject *__pyx_r = 0;
24298  __Pyx_RefNannyDeclarations
24299  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24300  __pyx_r = __pyx_pf_9WaveTools_7NewWave_1N___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24301 
24302  /* function exit code */
24303  __Pyx_RefNannyFinishContext();
24304  return __pyx_r;
24305 }
24306 
24307 static PyObject *__pyx_pf_9WaveTools_7NewWave_1N___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24308  PyObject *__pyx_r = NULL;
24309  __Pyx_RefNannyDeclarations
24310  PyObject *__pyx_t_1 = NULL;
24311  __Pyx_RefNannySetupContext("__get__", 0);
24312  __Pyx_XDECREF(__pyx_r);
24313  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 99, __pyx_L1_error)
24314  __Pyx_GOTREF(__pyx_t_1);
24315  __pyx_r = __pyx_t_1;
24316  __pyx_t_1 = 0;
24317  goto __pyx_L0;
24318 
24319  /* function exit code */
24320  __pyx_L1_error:;
24321  __Pyx_XDECREF(__pyx_t_1);
24322  __Pyx_AddTraceback("WaveTools.NewWave.N.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24323  __pyx_r = NULL;
24324  __pyx_L0:;
24325  __Pyx_XGIVEREF(__pyx_r);
24326  __Pyx_RefNannyFinishContext();
24327  return __pyx_r;
24328 }
24329 
24330 /* Python wrapper */
24331 static int __pyx_pw_9WaveTools_7NewWave_1N_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24332 static int __pyx_pw_9WaveTools_7NewWave_1N_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24333  int __pyx_r;
24334  __Pyx_RefNannyDeclarations
24335  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24336  __pyx_r = __pyx_pf_9WaveTools_7NewWave_1N_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24337 
24338  /* function exit code */
24339  __Pyx_RefNannyFinishContext();
24340  return __pyx_r;
24341 }
24342 
24343 static int __pyx_pf_9WaveTools_7NewWave_1N_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24344  int __pyx_r;
24345  __Pyx_RefNannyDeclarations
24346  int __pyx_t_1;
24347  __Pyx_RefNannySetupContext("__set__", 0);
24348  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 99, __pyx_L1_error)
24349  __pyx_v_self->N = __pyx_t_1;
24350 
24351  /* function exit code */
24352  __pyx_r = 0;
24353  goto __pyx_L0;
24354  __pyx_L1_error:;
24355  __Pyx_AddTraceback("WaveTools.NewWave.N.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24356  __pyx_r = -1;
24357  __pyx_L0:;
24358  __Pyx_RefNannyFinishContext();
24359  return __pyx_r;
24360 }
24361 
24362 /* "WaveTools.pxd":100
24363  * double mwl,depth,gAbs,Tlag,Hs,Tp,fp,bandFactor,df,focus,tfocus
24364  * int N
24365  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai # <<<<<<<<<<<<<<
24366  * cdef object phi
24367  * cdef double _cpp_eta(self , double* x, double t)
24368  */
24369 
24370 /* Python wrapper */
24371 static PyObject *__pyx_pw_9WaveTools_7NewWave_2fi_1__get__(PyObject *__pyx_v_self); /*proto*/
24372 static PyObject *__pyx_pw_9WaveTools_7NewWave_2fi_1__get__(PyObject *__pyx_v_self) {
24373  PyObject *__pyx_r = 0;
24374  __Pyx_RefNannyDeclarations
24375  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24376  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2fi___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24377 
24378  /* function exit code */
24379  __Pyx_RefNannyFinishContext();
24380  return __pyx_r;
24381 }
24382 
24383 static PyObject *__pyx_pf_9WaveTools_7NewWave_2fi___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24384  PyObject *__pyx_r = NULL;
24385  __Pyx_RefNannyDeclarations
24386  __Pyx_RefNannySetupContext("__get__", 0);
24387  __Pyx_XDECREF(__pyx_r);
24388  __Pyx_INCREF(((PyObject *)__pyx_v_self->fi));
24389  __pyx_r = ((PyObject *)__pyx_v_self->fi);
24390  goto __pyx_L0;
24391 
24392  /* function exit code */
24393  __pyx_L0:;
24394  __Pyx_XGIVEREF(__pyx_r);
24395  __Pyx_RefNannyFinishContext();
24396  return __pyx_r;
24397 }
24398 
24399 /* Python wrapper */
24400 static int __pyx_pw_9WaveTools_7NewWave_2fi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24401 static int __pyx_pw_9WaveTools_7NewWave_2fi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24402  int __pyx_r;
24403  __Pyx_RefNannyDeclarations
24404  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24405  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2fi_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24406 
24407  /* function exit code */
24408  __Pyx_RefNannyFinishContext();
24409  return __pyx_r;
24410 }
24411 
24412 static int __pyx_pf_9WaveTools_7NewWave_2fi_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24413  int __pyx_r;
24414  __Pyx_RefNannyDeclarations
24415  PyObject *__pyx_t_1 = NULL;
24416  __Pyx_RefNannySetupContext("__set__", 0);
24417  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
24418  __pyx_t_1 = __pyx_v_value;
24419  __Pyx_INCREF(__pyx_t_1);
24420  __Pyx_GIVEREF(__pyx_t_1);
24421  __Pyx_GOTREF(__pyx_v_self->fi);
24422  __Pyx_DECREF(((PyObject *)__pyx_v_self->fi));
24423  __pyx_v_self->fi = ((PyArrayObject *)__pyx_t_1);
24424  __pyx_t_1 = 0;
24425 
24426  /* function exit code */
24427  __pyx_r = 0;
24428  goto __pyx_L0;
24429  __pyx_L1_error:;
24430  __Pyx_XDECREF(__pyx_t_1);
24431  __Pyx_AddTraceback("WaveTools.NewWave.fi.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24432  __pyx_r = -1;
24433  __pyx_L0:;
24434  __Pyx_RefNannyFinishContext();
24435  return __pyx_r;
24436 }
24437 
24438 /* Python wrapper */
24439 static int __pyx_pw_9WaveTools_7NewWave_2fi_5__del__(PyObject *__pyx_v_self); /*proto*/
24440 static int __pyx_pw_9WaveTools_7NewWave_2fi_5__del__(PyObject *__pyx_v_self) {
24441  int __pyx_r;
24442  __Pyx_RefNannyDeclarations
24443  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
24444  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2fi_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24445 
24446  /* function exit code */
24447  __Pyx_RefNannyFinishContext();
24448  return __pyx_r;
24449 }
24450 
24451 static int __pyx_pf_9WaveTools_7NewWave_2fi_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24452  int __pyx_r;
24453  __Pyx_RefNannyDeclarations
24454  __Pyx_RefNannySetupContext("__del__", 0);
24455  __Pyx_INCREF(Py_None);
24456  __Pyx_GIVEREF(Py_None);
24457  __Pyx_GOTREF(__pyx_v_self->fi);
24458  __Pyx_DECREF(((PyObject *)__pyx_v_self->fi));
24459  __pyx_v_self->fi = ((PyArrayObject *)Py_None);
24460 
24461  /* function exit code */
24462  __pyx_r = 0;
24463  __Pyx_RefNannyFinishContext();
24464  return __pyx_r;
24465 }
24466 
24467 /* Python wrapper */
24468 static PyObject *__pyx_pw_9WaveTools_7NewWave_3fim_1__get__(PyObject *__pyx_v_self); /*proto*/
24469 static PyObject *__pyx_pw_9WaveTools_7NewWave_3fim_1__get__(PyObject *__pyx_v_self) {
24470  PyObject *__pyx_r = 0;
24471  __Pyx_RefNannyDeclarations
24472  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24473  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3fim___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24474 
24475  /* function exit code */
24476  __Pyx_RefNannyFinishContext();
24477  return __pyx_r;
24478 }
24479 
24480 static PyObject *__pyx_pf_9WaveTools_7NewWave_3fim___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24481  PyObject *__pyx_r = NULL;
24482  __Pyx_RefNannyDeclarations
24483  __Pyx_RefNannySetupContext("__get__", 0);
24484  __Pyx_XDECREF(__pyx_r);
24485  __Pyx_INCREF(((PyObject *)__pyx_v_self->fim));
24486  __pyx_r = ((PyObject *)__pyx_v_self->fim);
24487  goto __pyx_L0;
24488 
24489  /* function exit code */
24490  __pyx_L0:;
24491  __Pyx_XGIVEREF(__pyx_r);
24492  __Pyx_RefNannyFinishContext();
24493  return __pyx_r;
24494 }
24495 
24496 /* Python wrapper */
24497 static int __pyx_pw_9WaveTools_7NewWave_3fim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24498 static int __pyx_pw_9WaveTools_7NewWave_3fim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24499  int __pyx_r;
24500  __Pyx_RefNannyDeclarations
24501  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24502  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3fim_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24503 
24504  /* function exit code */
24505  __Pyx_RefNannyFinishContext();
24506  return __pyx_r;
24507 }
24508 
24509 static int __pyx_pf_9WaveTools_7NewWave_3fim_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24510  int __pyx_r;
24511  __Pyx_RefNannyDeclarations
24512  PyObject *__pyx_t_1 = NULL;
24513  __Pyx_RefNannySetupContext("__set__", 0);
24514  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
24515  __pyx_t_1 = __pyx_v_value;
24516  __Pyx_INCREF(__pyx_t_1);
24517  __Pyx_GIVEREF(__pyx_t_1);
24518  __Pyx_GOTREF(__pyx_v_self->fim);
24519  __Pyx_DECREF(((PyObject *)__pyx_v_self->fim));
24520  __pyx_v_self->fim = ((PyArrayObject *)__pyx_t_1);
24521  __pyx_t_1 = 0;
24522 
24523  /* function exit code */
24524  __pyx_r = 0;
24525  goto __pyx_L0;
24526  __pyx_L1_error:;
24527  __Pyx_XDECREF(__pyx_t_1);
24528  __Pyx_AddTraceback("WaveTools.NewWave.fim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24529  __pyx_r = -1;
24530  __pyx_L0:;
24531  __Pyx_RefNannyFinishContext();
24532  return __pyx_r;
24533 }
24534 
24535 /* Python wrapper */
24536 static int __pyx_pw_9WaveTools_7NewWave_3fim_5__del__(PyObject *__pyx_v_self); /*proto*/
24537 static int __pyx_pw_9WaveTools_7NewWave_3fim_5__del__(PyObject *__pyx_v_self) {
24538  int __pyx_r;
24539  __Pyx_RefNannyDeclarations
24540  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
24541  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3fim_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24542 
24543  /* function exit code */
24544  __Pyx_RefNannyFinishContext();
24545  return __pyx_r;
24546 }
24547 
24548 static int __pyx_pf_9WaveTools_7NewWave_3fim_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24549  int __pyx_r;
24550  __Pyx_RefNannyDeclarations
24551  __Pyx_RefNannySetupContext("__del__", 0);
24552  __Pyx_INCREF(Py_None);
24553  __Pyx_GIVEREF(Py_None);
24554  __Pyx_GOTREF(__pyx_v_self->fim);
24555  __Pyx_DECREF(((PyObject *)__pyx_v_self->fim));
24556  __pyx_v_self->fim = ((PyArrayObject *)Py_None);
24557 
24558  /* function exit code */
24559  __pyx_r = 0;
24560  __Pyx_RefNannyFinishContext();
24561  return __pyx_r;
24562 }
24563 
24564 /* Python wrapper */
24565 static PyObject *__pyx_pw_9WaveTools_7NewWave_5Si_Jm_1__get__(PyObject *__pyx_v_self); /*proto*/
24566 static PyObject *__pyx_pw_9WaveTools_7NewWave_5Si_Jm_1__get__(PyObject *__pyx_v_self) {
24567  PyObject *__pyx_r = 0;
24568  __Pyx_RefNannyDeclarations
24569  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24570  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5Si_Jm___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24571 
24572  /* function exit code */
24573  __Pyx_RefNannyFinishContext();
24574  return __pyx_r;
24575 }
24576 
24577 static PyObject *__pyx_pf_9WaveTools_7NewWave_5Si_Jm___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24578  PyObject *__pyx_r = NULL;
24579  __Pyx_RefNannyDeclarations
24580  __Pyx_RefNannySetupContext("__get__", 0);
24581  __Pyx_XDECREF(__pyx_r);
24582  __Pyx_INCREF(((PyObject *)__pyx_v_self->Si_Jm));
24583  __pyx_r = ((PyObject *)__pyx_v_self->Si_Jm);
24584  goto __pyx_L0;
24585 
24586  /* function exit code */
24587  __pyx_L0:;
24588  __Pyx_XGIVEREF(__pyx_r);
24589  __Pyx_RefNannyFinishContext();
24590  return __pyx_r;
24591 }
24592 
24593 /* Python wrapper */
24594 static int __pyx_pw_9WaveTools_7NewWave_5Si_Jm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24595 static int __pyx_pw_9WaveTools_7NewWave_5Si_Jm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24596  int __pyx_r;
24597  __Pyx_RefNannyDeclarations
24598  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24599  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5Si_Jm_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24600 
24601  /* function exit code */
24602  __Pyx_RefNannyFinishContext();
24603  return __pyx_r;
24604 }
24605 
24606 static int __pyx_pf_9WaveTools_7NewWave_5Si_Jm_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24607  int __pyx_r;
24608  __Pyx_RefNannyDeclarations
24609  PyObject *__pyx_t_1 = NULL;
24610  __Pyx_RefNannySetupContext("__set__", 0);
24611  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
24612  __pyx_t_1 = __pyx_v_value;
24613  __Pyx_INCREF(__pyx_t_1);
24614  __Pyx_GIVEREF(__pyx_t_1);
24615  __Pyx_GOTREF(__pyx_v_self->Si_Jm);
24616  __Pyx_DECREF(((PyObject *)__pyx_v_self->Si_Jm));
24617  __pyx_v_self->Si_Jm = ((PyArrayObject *)__pyx_t_1);
24618  __pyx_t_1 = 0;
24619 
24620  /* function exit code */
24621  __pyx_r = 0;
24622  goto __pyx_L0;
24623  __pyx_L1_error:;
24624  __Pyx_XDECREF(__pyx_t_1);
24625  __Pyx_AddTraceback("WaveTools.NewWave.Si_Jm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24626  __pyx_r = -1;
24627  __pyx_L0:;
24628  __Pyx_RefNannyFinishContext();
24629  return __pyx_r;
24630 }
24631 
24632 /* Python wrapper */
24633 static int __pyx_pw_9WaveTools_7NewWave_5Si_Jm_5__del__(PyObject *__pyx_v_self); /*proto*/
24634 static int __pyx_pw_9WaveTools_7NewWave_5Si_Jm_5__del__(PyObject *__pyx_v_self) {
24635  int __pyx_r;
24636  __Pyx_RefNannyDeclarations
24637  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
24638  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5Si_Jm_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24639 
24640  /* function exit code */
24641  __Pyx_RefNannyFinishContext();
24642  return __pyx_r;
24643 }
24644 
24645 static int __pyx_pf_9WaveTools_7NewWave_5Si_Jm_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24646  int __pyx_r;
24647  __Pyx_RefNannyDeclarations
24648  __Pyx_RefNannySetupContext("__del__", 0);
24649  __Pyx_INCREF(Py_None);
24650  __Pyx_GIVEREF(Py_None);
24651  __Pyx_GOTREF(__pyx_v_self->Si_Jm);
24652  __Pyx_DECREF(((PyObject *)__pyx_v_self->Si_Jm));
24653  __pyx_v_self->Si_Jm = ((PyArrayObject *)Py_None);
24654 
24655  /* function exit code */
24656  __pyx_r = 0;
24657  __Pyx_RefNannyFinishContext();
24658  return __pyx_r;
24659 }
24660 
24661 /* Python wrapper */
24662 static PyObject *__pyx_pw_9WaveTools_7NewWave_2ki_1__get__(PyObject *__pyx_v_self); /*proto*/
24663 static PyObject *__pyx_pw_9WaveTools_7NewWave_2ki_1__get__(PyObject *__pyx_v_self) {
24664  PyObject *__pyx_r = 0;
24665  __Pyx_RefNannyDeclarations
24666  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24667  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2ki___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24668 
24669  /* function exit code */
24670  __Pyx_RefNannyFinishContext();
24671  return __pyx_r;
24672 }
24673 
24674 static PyObject *__pyx_pf_9WaveTools_7NewWave_2ki___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24675  PyObject *__pyx_r = NULL;
24676  __Pyx_RefNannyDeclarations
24677  __Pyx_RefNannySetupContext("__get__", 0);
24678  __Pyx_XDECREF(__pyx_r);
24679  __Pyx_INCREF(((PyObject *)__pyx_v_self->ki));
24680  __pyx_r = ((PyObject *)__pyx_v_self->ki);
24681  goto __pyx_L0;
24682 
24683  /* function exit code */
24684  __pyx_L0:;
24685  __Pyx_XGIVEREF(__pyx_r);
24686  __Pyx_RefNannyFinishContext();
24687  return __pyx_r;
24688 }
24689 
24690 /* Python wrapper */
24691 static int __pyx_pw_9WaveTools_7NewWave_2ki_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24692 static int __pyx_pw_9WaveTools_7NewWave_2ki_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24693  int __pyx_r;
24694  __Pyx_RefNannyDeclarations
24695  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24696  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2ki_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24697 
24698  /* function exit code */
24699  __Pyx_RefNannyFinishContext();
24700  return __pyx_r;
24701 }
24702 
24703 static int __pyx_pf_9WaveTools_7NewWave_2ki_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24704  int __pyx_r;
24705  __Pyx_RefNannyDeclarations
24706  PyObject *__pyx_t_1 = NULL;
24707  __Pyx_RefNannySetupContext("__set__", 0);
24708  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
24709  __pyx_t_1 = __pyx_v_value;
24710  __Pyx_INCREF(__pyx_t_1);
24711  __Pyx_GIVEREF(__pyx_t_1);
24712  __Pyx_GOTREF(__pyx_v_self->ki);
24713  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
24714  __pyx_v_self->ki = ((PyArrayObject *)__pyx_t_1);
24715  __pyx_t_1 = 0;
24716 
24717  /* function exit code */
24718  __pyx_r = 0;
24719  goto __pyx_L0;
24720  __pyx_L1_error:;
24721  __Pyx_XDECREF(__pyx_t_1);
24722  __Pyx_AddTraceback("WaveTools.NewWave.ki.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24723  __pyx_r = -1;
24724  __pyx_L0:;
24725  __Pyx_RefNannyFinishContext();
24726  return __pyx_r;
24727 }
24728 
24729 /* Python wrapper */
24730 static int __pyx_pw_9WaveTools_7NewWave_2ki_5__del__(PyObject *__pyx_v_self); /*proto*/
24731 static int __pyx_pw_9WaveTools_7NewWave_2ki_5__del__(PyObject *__pyx_v_self) {
24732  int __pyx_r;
24733  __Pyx_RefNannyDeclarations
24734  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
24735  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2ki_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24736 
24737  /* function exit code */
24738  __Pyx_RefNannyFinishContext();
24739  return __pyx_r;
24740 }
24741 
24742 static int __pyx_pf_9WaveTools_7NewWave_2ki_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24743  int __pyx_r;
24744  __Pyx_RefNannyDeclarations
24745  __Pyx_RefNannySetupContext("__del__", 0);
24746  __Pyx_INCREF(Py_None);
24747  __Pyx_GIVEREF(Py_None);
24748  __Pyx_GOTREF(__pyx_v_self->ki);
24749  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
24750  __pyx_v_self->ki = ((PyArrayObject *)Py_None);
24751 
24752  /* function exit code */
24753  __pyx_r = 0;
24754  __Pyx_RefNannyFinishContext();
24755  return __pyx_r;
24756 }
24757 
24758 /* Python wrapper */
24759 static PyObject *__pyx_pw_9WaveTools_7NewWave_5omega_1__get__(PyObject *__pyx_v_self); /*proto*/
24760 static PyObject *__pyx_pw_9WaveTools_7NewWave_5omega_1__get__(PyObject *__pyx_v_self) {
24761  PyObject *__pyx_r = 0;
24762  __Pyx_RefNannyDeclarations
24763  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24764  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5omega___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24765 
24766  /* function exit code */
24767  __Pyx_RefNannyFinishContext();
24768  return __pyx_r;
24769 }
24770 
24771 static PyObject *__pyx_pf_9WaveTools_7NewWave_5omega___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24772  PyObject *__pyx_r = NULL;
24773  __Pyx_RefNannyDeclarations
24774  __Pyx_RefNannySetupContext("__get__", 0);
24775  __Pyx_XDECREF(__pyx_r);
24776  __Pyx_INCREF(((PyObject *)__pyx_v_self->omega));
24777  __pyx_r = ((PyObject *)__pyx_v_self->omega);
24778  goto __pyx_L0;
24779 
24780  /* function exit code */
24781  __pyx_L0:;
24782  __Pyx_XGIVEREF(__pyx_r);
24783  __Pyx_RefNannyFinishContext();
24784  return __pyx_r;
24785 }
24786 
24787 /* Python wrapper */
24788 static int __pyx_pw_9WaveTools_7NewWave_5omega_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24789 static int __pyx_pw_9WaveTools_7NewWave_5omega_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24790  int __pyx_r;
24791  __Pyx_RefNannyDeclarations
24792  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24793  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5omega_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24794 
24795  /* function exit code */
24796  __Pyx_RefNannyFinishContext();
24797  return __pyx_r;
24798 }
24799 
24800 static int __pyx_pf_9WaveTools_7NewWave_5omega_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24801  int __pyx_r;
24802  __Pyx_RefNannyDeclarations
24803  PyObject *__pyx_t_1 = NULL;
24804  __Pyx_RefNannySetupContext("__set__", 0);
24805  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
24806  __pyx_t_1 = __pyx_v_value;
24807  __Pyx_INCREF(__pyx_t_1);
24808  __Pyx_GIVEREF(__pyx_t_1);
24809  __Pyx_GOTREF(__pyx_v_self->omega);
24810  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
24811  __pyx_v_self->omega = ((PyArrayObject *)__pyx_t_1);
24812  __pyx_t_1 = 0;
24813 
24814  /* function exit code */
24815  __pyx_r = 0;
24816  goto __pyx_L0;
24817  __pyx_L1_error:;
24818  __Pyx_XDECREF(__pyx_t_1);
24819  __Pyx_AddTraceback("WaveTools.NewWave.omega.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24820  __pyx_r = -1;
24821  __pyx_L0:;
24822  __Pyx_RefNannyFinishContext();
24823  return __pyx_r;
24824 }
24825 
24826 /* Python wrapper */
24827 static int __pyx_pw_9WaveTools_7NewWave_5omega_5__del__(PyObject *__pyx_v_self); /*proto*/
24828 static int __pyx_pw_9WaveTools_7NewWave_5omega_5__del__(PyObject *__pyx_v_self) {
24829  int __pyx_r;
24830  __Pyx_RefNannyDeclarations
24831  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
24832  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5omega_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24833 
24834  /* function exit code */
24835  __Pyx_RefNannyFinishContext();
24836  return __pyx_r;
24837 }
24838 
24839 static int __pyx_pf_9WaveTools_7NewWave_5omega_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24840  int __pyx_r;
24841  __Pyx_RefNannyDeclarations
24842  __Pyx_RefNannySetupContext("__del__", 0);
24843  __Pyx_INCREF(Py_None);
24844  __Pyx_GIVEREF(Py_None);
24845  __Pyx_GOTREF(__pyx_v_self->omega);
24846  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
24847  __pyx_v_self->omega = ((PyArrayObject *)Py_None);
24848 
24849  /* function exit code */
24850  __pyx_r = 0;
24851  __Pyx_RefNannyFinishContext();
24852  return __pyx_r;
24853 }
24854 
24855 /* Python wrapper */
24856 static PyObject *__pyx_pw_9WaveTools_7NewWave_5tanhF_1__get__(PyObject *__pyx_v_self); /*proto*/
24857 static PyObject *__pyx_pw_9WaveTools_7NewWave_5tanhF_1__get__(PyObject *__pyx_v_self) {
24858  PyObject *__pyx_r = 0;
24859  __Pyx_RefNannyDeclarations
24860  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24861  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5tanhF___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24862 
24863  /* function exit code */
24864  __Pyx_RefNannyFinishContext();
24865  return __pyx_r;
24866 }
24867 
24868 static PyObject *__pyx_pf_9WaveTools_7NewWave_5tanhF___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24869  PyObject *__pyx_r = NULL;
24870  __Pyx_RefNannyDeclarations
24871  __Pyx_RefNannySetupContext("__get__", 0);
24872  __Pyx_XDECREF(__pyx_r);
24873  __Pyx_INCREF(((PyObject *)__pyx_v_self->tanhF));
24874  __pyx_r = ((PyObject *)__pyx_v_self->tanhF);
24875  goto __pyx_L0;
24876 
24877  /* function exit code */
24878  __pyx_L0:;
24879  __Pyx_XGIVEREF(__pyx_r);
24880  __Pyx_RefNannyFinishContext();
24881  return __pyx_r;
24882 }
24883 
24884 /* Python wrapper */
24885 static int __pyx_pw_9WaveTools_7NewWave_5tanhF_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24886 static int __pyx_pw_9WaveTools_7NewWave_5tanhF_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24887  int __pyx_r;
24888  __Pyx_RefNannyDeclarations
24889  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24890  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5tanhF_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24891 
24892  /* function exit code */
24893  __Pyx_RefNannyFinishContext();
24894  return __pyx_r;
24895 }
24896 
24897 static int __pyx_pf_9WaveTools_7NewWave_5tanhF_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24898  int __pyx_r;
24899  __Pyx_RefNannyDeclarations
24900  PyObject *__pyx_t_1 = NULL;
24901  __Pyx_RefNannySetupContext("__set__", 0);
24902  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
24903  __pyx_t_1 = __pyx_v_value;
24904  __Pyx_INCREF(__pyx_t_1);
24905  __Pyx_GIVEREF(__pyx_t_1);
24906  __Pyx_GOTREF(__pyx_v_self->tanhF);
24907  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
24908  __pyx_v_self->tanhF = ((PyArrayObject *)__pyx_t_1);
24909  __pyx_t_1 = 0;
24910 
24911  /* function exit code */
24912  __pyx_r = 0;
24913  goto __pyx_L0;
24914  __pyx_L1_error:;
24915  __Pyx_XDECREF(__pyx_t_1);
24916  __Pyx_AddTraceback("WaveTools.NewWave.tanhF.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
24917  __pyx_r = -1;
24918  __pyx_L0:;
24919  __Pyx_RefNannyFinishContext();
24920  return __pyx_r;
24921 }
24922 
24923 /* Python wrapper */
24924 static int __pyx_pw_9WaveTools_7NewWave_5tanhF_5__del__(PyObject *__pyx_v_self); /*proto*/
24925 static int __pyx_pw_9WaveTools_7NewWave_5tanhF_5__del__(PyObject *__pyx_v_self) {
24926  int __pyx_r;
24927  __Pyx_RefNannyDeclarations
24928  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
24929  __pyx_r = __pyx_pf_9WaveTools_7NewWave_5tanhF_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24930 
24931  /* function exit code */
24932  __Pyx_RefNannyFinishContext();
24933  return __pyx_r;
24934 }
24935 
24936 static int __pyx_pf_9WaveTools_7NewWave_5tanhF_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24937  int __pyx_r;
24938  __Pyx_RefNannyDeclarations
24939  __Pyx_RefNannySetupContext("__del__", 0);
24940  __Pyx_INCREF(Py_None);
24941  __Pyx_GIVEREF(Py_None);
24942  __Pyx_GOTREF(__pyx_v_self->tanhF);
24943  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
24944  __pyx_v_self->tanhF = ((PyArrayObject *)Py_None);
24945 
24946  /* function exit code */
24947  __pyx_r = 0;
24948  __Pyx_RefNannyFinishContext();
24949  return __pyx_r;
24950 }
24951 
24952 /* Python wrapper */
24953 static PyObject *__pyx_pw_9WaveTools_7NewWave_1g_1__get__(PyObject *__pyx_v_self); /*proto*/
24954 static PyObject *__pyx_pw_9WaveTools_7NewWave_1g_1__get__(PyObject *__pyx_v_self) {
24955  PyObject *__pyx_r = 0;
24956  __Pyx_RefNannyDeclarations
24957  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
24958  __pyx_r = __pyx_pf_9WaveTools_7NewWave_1g___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
24959 
24960  /* function exit code */
24961  __Pyx_RefNannyFinishContext();
24962  return __pyx_r;
24963 }
24964 
24965 static PyObject *__pyx_pf_9WaveTools_7NewWave_1g___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
24966  PyObject *__pyx_r = NULL;
24967  __Pyx_RefNannyDeclarations
24968  __Pyx_RefNannySetupContext("__get__", 0);
24969  __Pyx_XDECREF(__pyx_r);
24970  __Pyx_INCREF(((PyObject *)__pyx_v_self->g));
24971  __pyx_r = ((PyObject *)__pyx_v_self->g);
24972  goto __pyx_L0;
24973 
24974  /* function exit code */
24975  __pyx_L0:;
24976  __Pyx_XGIVEREF(__pyx_r);
24977  __Pyx_RefNannyFinishContext();
24978  return __pyx_r;
24979 }
24980 
24981 /* Python wrapper */
24982 static int __pyx_pw_9WaveTools_7NewWave_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
24983 static int __pyx_pw_9WaveTools_7NewWave_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
24984  int __pyx_r;
24985  __Pyx_RefNannyDeclarations
24986  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
24987  __pyx_r = __pyx_pf_9WaveTools_7NewWave_1g_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
24988 
24989  /* function exit code */
24990  __Pyx_RefNannyFinishContext();
24991  return __pyx_r;
24992 }
24993 
24994 static int __pyx_pf_9WaveTools_7NewWave_1g_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
24995  int __pyx_r;
24996  __Pyx_RefNannyDeclarations
24997  PyObject *__pyx_t_1 = NULL;
24998  __Pyx_RefNannySetupContext("__set__", 0);
24999  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
25000  __pyx_t_1 = __pyx_v_value;
25001  __Pyx_INCREF(__pyx_t_1);
25002  __Pyx_GIVEREF(__pyx_t_1);
25003  __Pyx_GOTREF(__pyx_v_self->g);
25004  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
25005  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_1);
25006  __pyx_t_1 = 0;
25007 
25008  /* function exit code */
25009  __pyx_r = 0;
25010  goto __pyx_L0;
25011  __pyx_L1_error:;
25012  __Pyx_XDECREF(__pyx_t_1);
25013  __Pyx_AddTraceback("WaveTools.NewWave.g.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25014  __pyx_r = -1;
25015  __pyx_L0:;
25016  __Pyx_RefNannyFinishContext();
25017  return __pyx_r;
25018 }
25019 
25020 /* Python wrapper */
25021 static int __pyx_pw_9WaveTools_7NewWave_1g_5__del__(PyObject *__pyx_v_self); /*proto*/
25022 static int __pyx_pw_9WaveTools_7NewWave_1g_5__del__(PyObject *__pyx_v_self) {
25023  int __pyx_r;
25024  __Pyx_RefNannyDeclarations
25025  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
25026  __pyx_r = __pyx_pf_9WaveTools_7NewWave_1g_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25027 
25028  /* function exit code */
25029  __Pyx_RefNannyFinishContext();
25030  return __pyx_r;
25031 }
25032 
25033 static int __pyx_pf_9WaveTools_7NewWave_1g_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25034  int __pyx_r;
25035  __Pyx_RefNannyDeclarations
25036  __Pyx_RefNannySetupContext("__del__", 0);
25037  __Pyx_INCREF(Py_None);
25038  __Pyx_GIVEREF(Py_None);
25039  __Pyx_GOTREF(__pyx_v_self->g);
25040  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
25041  __pyx_v_self->g = ((PyArrayObject *)Py_None);
25042 
25043  /* function exit code */
25044  __pyx_r = 0;
25045  __Pyx_RefNannyFinishContext();
25046  return __pyx_r;
25047 }
25048 
25049 /* Python wrapper */
25050 static PyObject *__pyx_pw_9WaveTools_7NewWave_7waveDir_1__get__(PyObject *__pyx_v_self); /*proto*/
25051 static PyObject *__pyx_pw_9WaveTools_7NewWave_7waveDir_1__get__(PyObject *__pyx_v_self) {
25052  PyObject *__pyx_r = 0;
25053  __Pyx_RefNannyDeclarations
25054  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25055  __pyx_r = __pyx_pf_9WaveTools_7NewWave_7waveDir___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25056 
25057  /* function exit code */
25058  __Pyx_RefNannyFinishContext();
25059  return __pyx_r;
25060 }
25061 
25062 static PyObject *__pyx_pf_9WaveTools_7NewWave_7waveDir___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25063  PyObject *__pyx_r = NULL;
25064  __Pyx_RefNannyDeclarations
25065  __Pyx_RefNannySetupContext("__get__", 0);
25066  __Pyx_XDECREF(__pyx_r);
25067  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
25068  __pyx_r = ((PyObject *)__pyx_v_self->waveDir);
25069  goto __pyx_L0;
25070 
25071  /* function exit code */
25072  __pyx_L0:;
25073  __Pyx_XGIVEREF(__pyx_r);
25074  __Pyx_RefNannyFinishContext();
25075  return __pyx_r;
25076 }
25077 
25078 /* Python wrapper */
25079 static int __pyx_pw_9WaveTools_7NewWave_7waveDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
25080 static int __pyx_pw_9WaveTools_7NewWave_7waveDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
25081  int __pyx_r;
25082  __Pyx_RefNannyDeclarations
25083  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
25084  __pyx_r = __pyx_pf_9WaveTools_7NewWave_7waveDir_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
25085 
25086  /* function exit code */
25087  __Pyx_RefNannyFinishContext();
25088  return __pyx_r;
25089 }
25090 
25091 static int __pyx_pf_9WaveTools_7NewWave_7waveDir_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
25092  int __pyx_r;
25093  __Pyx_RefNannyDeclarations
25094  PyObject *__pyx_t_1 = NULL;
25095  __Pyx_RefNannySetupContext("__set__", 0);
25096  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
25097  __pyx_t_1 = __pyx_v_value;
25098  __Pyx_INCREF(__pyx_t_1);
25099  __Pyx_GIVEREF(__pyx_t_1);
25100  __Pyx_GOTREF(__pyx_v_self->waveDir);
25101  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
25102  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_1);
25103  __pyx_t_1 = 0;
25104 
25105  /* function exit code */
25106  __pyx_r = 0;
25107  goto __pyx_L0;
25108  __pyx_L1_error:;
25109  __Pyx_XDECREF(__pyx_t_1);
25110  __Pyx_AddTraceback("WaveTools.NewWave.waveDir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25111  __pyx_r = -1;
25112  __pyx_L0:;
25113  __Pyx_RefNannyFinishContext();
25114  return __pyx_r;
25115 }
25116 
25117 /* Python wrapper */
25118 static int __pyx_pw_9WaveTools_7NewWave_7waveDir_5__del__(PyObject *__pyx_v_self); /*proto*/
25119 static int __pyx_pw_9WaveTools_7NewWave_7waveDir_5__del__(PyObject *__pyx_v_self) {
25120  int __pyx_r;
25121  __Pyx_RefNannyDeclarations
25122  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
25123  __pyx_r = __pyx_pf_9WaveTools_7NewWave_7waveDir_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25124 
25125  /* function exit code */
25126  __Pyx_RefNannyFinishContext();
25127  return __pyx_r;
25128 }
25129 
25130 static int __pyx_pf_9WaveTools_7NewWave_7waveDir_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25131  int __pyx_r;
25132  __Pyx_RefNannyDeclarations
25133  __Pyx_RefNannySetupContext("__del__", 0);
25134  __Pyx_INCREF(Py_None);
25135  __Pyx_GIVEREF(Py_None);
25136  __Pyx_GOTREF(__pyx_v_self->waveDir);
25137  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
25138  __pyx_v_self->waveDir = ((PyArrayObject *)Py_None);
25139 
25140  /* function exit code */
25141  __pyx_r = 0;
25142  __Pyx_RefNannyFinishContext();
25143  return __pyx_r;
25144 }
25145 
25146 /* Python wrapper */
25147 static PyObject *__pyx_pw_9WaveTools_7NewWave_4vDir_1__get__(PyObject *__pyx_v_self); /*proto*/
25148 static PyObject *__pyx_pw_9WaveTools_7NewWave_4vDir_1__get__(PyObject *__pyx_v_self) {
25149  PyObject *__pyx_r = 0;
25150  __Pyx_RefNannyDeclarations
25151  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25152  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4vDir___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25153 
25154  /* function exit code */
25155  __Pyx_RefNannyFinishContext();
25156  return __pyx_r;
25157 }
25158 
25159 static PyObject *__pyx_pf_9WaveTools_7NewWave_4vDir___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25160  PyObject *__pyx_r = NULL;
25161  __Pyx_RefNannyDeclarations
25162  __Pyx_RefNannySetupContext("__get__", 0);
25163  __Pyx_XDECREF(__pyx_r);
25164  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
25165  __pyx_r = ((PyObject *)__pyx_v_self->vDir);
25166  goto __pyx_L0;
25167 
25168  /* function exit code */
25169  __pyx_L0:;
25170  __Pyx_XGIVEREF(__pyx_r);
25171  __Pyx_RefNannyFinishContext();
25172  return __pyx_r;
25173 }
25174 
25175 /* Python wrapper */
25176 static int __pyx_pw_9WaveTools_7NewWave_4vDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
25177 static int __pyx_pw_9WaveTools_7NewWave_4vDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
25178  int __pyx_r;
25179  __Pyx_RefNannyDeclarations
25180  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
25181  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4vDir_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
25182 
25183  /* function exit code */
25184  __Pyx_RefNannyFinishContext();
25185  return __pyx_r;
25186 }
25187 
25188 static int __pyx_pf_9WaveTools_7NewWave_4vDir_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
25189  int __pyx_r;
25190  __Pyx_RefNannyDeclarations
25191  PyObject *__pyx_t_1 = NULL;
25192  __Pyx_RefNannySetupContext("__set__", 0);
25193  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
25194  __pyx_t_1 = __pyx_v_value;
25195  __Pyx_INCREF(__pyx_t_1);
25196  __Pyx_GIVEREF(__pyx_t_1);
25197  __Pyx_GOTREF(__pyx_v_self->vDir);
25198  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
25199  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_1);
25200  __pyx_t_1 = 0;
25201 
25202  /* function exit code */
25203  __pyx_r = 0;
25204  goto __pyx_L0;
25205  __pyx_L1_error:;
25206  __Pyx_XDECREF(__pyx_t_1);
25207  __Pyx_AddTraceback("WaveTools.NewWave.vDir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25208  __pyx_r = -1;
25209  __pyx_L0:;
25210  __Pyx_RefNannyFinishContext();
25211  return __pyx_r;
25212 }
25213 
25214 /* Python wrapper */
25215 static int __pyx_pw_9WaveTools_7NewWave_4vDir_5__del__(PyObject *__pyx_v_self); /*proto*/
25216 static int __pyx_pw_9WaveTools_7NewWave_4vDir_5__del__(PyObject *__pyx_v_self) {
25217  int __pyx_r;
25218  __Pyx_RefNannyDeclarations
25219  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
25220  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4vDir_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25221 
25222  /* function exit code */
25223  __Pyx_RefNannyFinishContext();
25224  return __pyx_r;
25225 }
25226 
25227 static int __pyx_pf_9WaveTools_7NewWave_4vDir_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25228  int __pyx_r;
25229  __Pyx_RefNannyDeclarations
25230  __Pyx_RefNannySetupContext("__del__", 0);
25231  __Pyx_INCREF(Py_None);
25232  __Pyx_GIVEREF(Py_None);
25233  __Pyx_GOTREF(__pyx_v_self->vDir);
25234  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
25235  __pyx_v_self->vDir = ((PyArrayObject *)Py_None);
25236 
25237  /* function exit code */
25238  __pyx_r = 0;
25239  __Pyx_RefNannyFinishContext();
25240  return __pyx_r;
25241 }
25242 
25243 /* Python wrapper */
25244 static PyObject *__pyx_pw_9WaveTools_7NewWave_4kDir_1__get__(PyObject *__pyx_v_self); /*proto*/
25245 static PyObject *__pyx_pw_9WaveTools_7NewWave_4kDir_1__get__(PyObject *__pyx_v_self) {
25246  PyObject *__pyx_r = 0;
25247  __Pyx_RefNannyDeclarations
25248  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25249  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4kDir___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25250 
25251  /* function exit code */
25252  __Pyx_RefNannyFinishContext();
25253  return __pyx_r;
25254 }
25255 
25256 static PyObject *__pyx_pf_9WaveTools_7NewWave_4kDir___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25257  PyObject *__pyx_r = NULL;
25258  __Pyx_RefNannyDeclarations
25259  __Pyx_RefNannySetupContext("__get__", 0);
25260  __Pyx_XDECREF(__pyx_r);
25261  __Pyx_INCREF(((PyObject *)__pyx_v_self->kDir));
25262  __pyx_r = ((PyObject *)__pyx_v_self->kDir);
25263  goto __pyx_L0;
25264 
25265  /* function exit code */
25266  __pyx_L0:;
25267  __Pyx_XGIVEREF(__pyx_r);
25268  __Pyx_RefNannyFinishContext();
25269  return __pyx_r;
25270 }
25271 
25272 /* Python wrapper */
25273 static int __pyx_pw_9WaveTools_7NewWave_4kDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
25274 static int __pyx_pw_9WaveTools_7NewWave_4kDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
25275  int __pyx_r;
25276  __Pyx_RefNannyDeclarations
25277  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
25278  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4kDir_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
25279 
25280  /* function exit code */
25281  __Pyx_RefNannyFinishContext();
25282  return __pyx_r;
25283 }
25284 
25285 static int __pyx_pf_9WaveTools_7NewWave_4kDir_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
25286  int __pyx_r;
25287  __Pyx_RefNannyDeclarations
25288  PyObject *__pyx_t_1 = NULL;
25289  __Pyx_RefNannySetupContext("__set__", 0);
25290  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
25291  __pyx_t_1 = __pyx_v_value;
25292  __Pyx_INCREF(__pyx_t_1);
25293  __Pyx_GIVEREF(__pyx_t_1);
25294  __Pyx_GOTREF(__pyx_v_self->kDir);
25295  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
25296  __pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_1);
25297  __pyx_t_1 = 0;
25298 
25299  /* function exit code */
25300  __pyx_r = 0;
25301  goto __pyx_L0;
25302  __pyx_L1_error:;
25303  __Pyx_XDECREF(__pyx_t_1);
25304  __Pyx_AddTraceback("WaveTools.NewWave.kDir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25305  __pyx_r = -1;
25306  __pyx_L0:;
25307  __Pyx_RefNannyFinishContext();
25308  return __pyx_r;
25309 }
25310 
25311 /* Python wrapper */
25312 static int __pyx_pw_9WaveTools_7NewWave_4kDir_5__del__(PyObject *__pyx_v_self); /*proto*/
25313 static int __pyx_pw_9WaveTools_7NewWave_4kDir_5__del__(PyObject *__pyx_v_self) {
25314  int __pyx_r;
25315  __Pyx_RefNannyDeclarations
25316  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
25317  __pyx_r = __pyx_pf_9WaveTools_7NewWave_4kDir_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25318 
25319  /* function exit code */
25320  __Pyx_RefNannyFinishContext();
25321  return __pyx_r;
25322 }
25323 
25324 static int __pyx_pf_9WaveTools_7NewWave_4kDir_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25325  int __pyx_r;
25326  __Pyx_RefNannyDeclarations
25327  __Pyx_RefNannySetupContext("__del__", 0);
25328  __Pyx_INCREF(Py_None);
25329  __Pyx_GIVEREF(Py_None);
25330  __Pyx_GOTREF(__pyx_v_self->kDir);
25331  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
25332  __pyx_v_self->kDir = ((PyArrayObject *)Py_None);
25333 
25334  /* function exit code */
25335  __pyx_r = 0;
25336  __Pyx_RefNannyFinishContext();
25337  return __pyx_r;
25338 }
25339 
25340 /* Python wrapper */
25341 static PyObject *__pyx_pw_9WaveTools_7NewWave_2ai_1__get__(PyObject *__pyx_v_self); /*proto*/
25342 static PyObject *__pyx_pw_9WaveTools_7NewWave_2ai_1__get__(PyObject *__pyx_v_self) {
25343  PyObject *__pyx_r = 0;
25344  __Pyx_RefNannyDeclarations
25345  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25346  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2ai___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25347 
25348  /* function exit code */
25349  __Pyx_RefNannyFinishContext();
25350  return __pyx_r;
25351 }
25352 
25353 static PyObject *__pyx_pf_9WaveTools_7NewWave_2ai___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25354  PyObject *__pyx_r = NULL;
25355  __Pyx_RefNannyDeclarations
25356  __Pyx_RefNannySetupContext("__get__", 0);
25357  __Pyx_XDECREF(__pyx_r);
25358  __Pyx_INCREF(((PyObject *)__pyx_v_self->ai));
25359  __pyx_r = ((PyObject *)__pyx_v_self->ai);
25360  goto __pyx_L0;
25361 
25362  /* function exit code */
25363  __pyx_L0:;
25364  __Pyx_XGIVEREF(__pyx_r);
25365  __Pyx_RefNannyFinishContext();
25366  return __pyx_r;
25367 }
25368 
25369 /* Python wrapper */
25370 static int __pyx_pw_9WaveTools_7NewWave_2ai_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
25371 static int __pyx_pw_9WaveTools_7NewWave_2ai_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
25372  int __pyx_r;
25373  __Pyx_RefNannyDeclarations
25374  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
25375  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2ai_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
25376 
25377  /* function exit code */
25378  __Pyx_RefNannyFinishContext();
25379  return __pyx_r;
25380 }
25381 
25382 static int __pyx_pf_9WaveTools_7NewWave_2ai_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
25383  int __pyx_r;
25384  __Pyx_RefNannyDeclarations
25385  PyObject *__pyx_t_1 = NULL;
25386  __Pyx_RefNannySetupContext("__set__", 0);
25387  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 100, __pyx_L1_error)
25388  __pyx_t_1 = __pyx_v_value;
25389  __Pyx_INCREF(__pyx_t_1);
25390  __Pyx_GIVEREF(__pyx_t_1);
25391  __Pyx_GOTREF(__pyx_v_self->ai);
25392  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
25393  __pyx_v_self->ai = ((PyArrayObject *)__pyx_t_1);
25394  __pyx_t_1 = 0;
25395 
25396  /* function exit code */
25397  __pyx_r = 0;
25398  goto __pyx_L0;
25399  __pyx_L1_error:;
25400  __Pyx_XDECREF(__pyx_t_1);
25401  __Pyx_AddTraceback("WaveTools.NewWave.ai.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25402  __pyx_r = -1;
25403  __pyx_L0:;
25404  __Pyx_RefNannyFinishContext();
25405  return __pyx_r;
25406 }
25407 
25408 /* Python wrapper */
25409 static int __pyx_pw_9WaveTools_7NewWave_2ai_5__del__(PyObject *__pyx_v_self); /*proto*/
25410 static int __pyx_pw_9WaveTools_7NewWave_2ai_5__del__(PyObject *__pyx_v_self) {
25411  int __pyx_r;
25412  __Pyx_RefNannyDeclarations
25413  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
25414  __pyx_r = __pyx_pf_9WaveTools_7NewWave_2ai_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25415 
25416  /* function exit code */
25417  __Pyx_RefNannyFinishContext();
25418  return __pyx_r;
25419 }
25420 
25421 static int __pyx_pf_9WaveTools_7NewWave_2ai_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25422  int __pyx_r;
25423  __Pyx_RefNannyDeclarations
25424  __Pyx_RefNannySetupContext("__del__", 0);
25425  __Pyx_INCREF(Py_None);
25426  __Pyx_GIVEREF(Py_None);
25427  __Pyx_GOTREF(__pyx_v_self->ai);
25428  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
25429  __pyx_v_self->ai = ((PyArrayObject *)Py_None);
25430 
25431  /* function exit code */
25432  __pyx_r = 0;
25433  __Pyx_RefNannyFinishContext();
25434  return __pyx_r;
25435 }
25436 
25437 /* "WaveTools.pxd":101
25438  * int N
25439  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai
25440  * cdef object phi # <<<<<<<<<<<<<<
25441  * cdef double _cpp_eta(self , double* x, double t)
25442  * cdef void _cpp_u(self, double *U, double* x, double t)
25443  */
25444 
25445 /* Python wrapper */
25446 static PyObject *__pyx_pw_9WaveTools_7NewWave_3phi_1__get__(PyObject *__pyx_v_self); /*proto*/
25447 static PyObject *__pyx_pw_9WaveTools_7NewWave_3phi_1__get__(PyObject *__pyx_v_self) {
25448  PyObject *__pyx_r = 0;
25449  __Pyx_RefNannyDeclarations
25450  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
25451  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3phi___get__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25452 
25453  /* function exit code */
25454  __Pyx_RefNannyFinishContext();
25455  return __pyx_r;
25456 }
25457 
25458 static PyObject *__pyx_pf_9WaveTools_7NewWave_3phi___get__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25459  PyObject *__pyx_r = NULL;
25460  __Pyx_RefNannyDeclarations
25461  __Pyx_RefNannySetupContext("__get__", 0);
25462  __Pyx_XDECREF(__pyx_r);
25463  __Pyx_INCREF(__pyx_v_self->phi);
25464  __pyx_r = __pyx_v_self->phi;
25465  goto __pyx_L0;
25466 
25467  /* function exit code */
25468  __pyx_L0:;
25469  __Pyx_XGIVEREF(__pyx_r);
25470  __Pyx_RefNannyFinishContext();
25471  return __pyx_r;
25472 }
25473 
25474 /* Python wrapper */
25475 static int __pyx_pw_9WaveTools_7NewWave_3phi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
25476 static int __pyx_pw_9WaveTools_7NewWave_3phi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
25477  int __pyx_r;
25478  __Pyx_RefNannyDeclarations
25479  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
25480  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3phi_2__set__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v_value));
25481 
25482  /* function exit code */
25483  __Pyx_RefNannyFinishContext();
25484  return __pyx_r;
25485 }
25486 
25487 static int __pyx_pf_9WaveTools_7NewWave_3phi_2__set__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, PyObject *__pyx_v_value) {
25488  int __pyx_r;
25489  __Pyx_RefNannyDeclarations
25490  __Pyx_RefNannySetupContext("__set__", 0);
25491  __Pyx_INCREF(__pyx_v_value);
25492  __Pyx_GIVEREF(__pyx_v_value);
25493  __Pyx_GOTREF(__pyx_v_self->phi);
25494  __Pyx_DECREF(__pyx_v_self->phi);
25495  __pyx_v_self->phi = __pyx_v_value;
25496 
25497  /* function exit code */
25498  __pyx_r = 0;
25499  __Pyx_RefNannyFinishContext();
25500  return __pyx_r;
25501 }
25502 
25503 /* Python wrapper */
25504 static int __pyx_pw_9WaveTools_7NewWave_3phi_5__del__(PyObject *__pyx_v_self); /*proto*/
25505 static int __pyx_pw_9WaveTools_7NewWave_3phi_5__del__(PyObject *__pyx_v_self) {
25506  int __pyx_r;
25507  __Pyx_RefNannyDeclarations
25508  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
25509  __pyx_r = __pyx_pf_9WaveTools_7NewWave_3phi_4__del__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25510 
25511  /* function exit code */
25512  __Pyx_RefNannyFinishContext();
25513  return __pyx_r;
25514 }
25515 
25516 static int __pyx_pf_9WaveTools_7NewWave_3phi_4__del__(struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25517  int __pyx_r;
25518  __Pyx_RefNannyDeclarations
25519  __Pyx_RefNannySetupContext("__del__", 0);
25520  __Pyx_INCREF(Py_None);
25521  __Pyx_GIVEREF(Py_None);
25522  __Pyx_GOTREF(__pyx_v_self->phi);
25523  __Pyx_DECREF(__pyx_v_self->phi);
25524  __pyx_v_self->phi = Py_None;
25525 
25526  /* function exit code */
25527  __pyx_r = 0;
25528  __Pyx_RefNannyFinishContext();
25529  return __pyx_r;
25530 }
25531 
25532 /* "(tree fragment)":1
25533  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
25534  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25535  * def __setstate_cython__(self, __pyx_state):
25536  */
25537 
25538 /* Python wrapper */
25539 static PyObject *__pyx_pw_9WaveTools_7NewWave_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
25540 static PyMethodDef __pyx_mdef_9WaveTools_7NewWave_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_7NewWave_9__reduce_cython__, METH_NOARGS, 0};
25541 static PyObject *__pyx_pw_9WaveTools_7NewWave_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
25542  PyObject *__pyx_r = 0;
25543  __Pyx_RefNannyDeclarations
25544  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
25545  __pyx_r = __pyx_pf_9WaveTools_7NewWave_8__reduce_cython__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self));
25546 
25547  /* function exit code */
25548  __Pyx_RefNannyFinishContext();
25549  return __pyx_r;
25550 }
25551 
25552 static PyObject *__pyx_pf_9WaveTools_7NewWave_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self) {
25553  PyObject *__pyx_r = NULL;
25554  __Pyx_RefNannyDeclarations
25555  PyObject *__pyx_t_1 = NULL;
25556  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
25557 
25558  /* "(tree fragment)":2
25559  * def __reduce_cython__(self):
25560  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25561  * def __setstate_cython__(self, __pyx_state):
25562  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25563  */
25564  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
25565  __Pyx_GOTREF(__pyx_t_1);
25566  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25567  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25568  __PYX_ERR(1, 2, __pyx_L1_error)
25569 
25570  /* "(tree fragment)":1
25571  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
25572  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25573  * def __setstate_cython__(self, __pyx_state):
25574  */
25575 
25576  /* function exit code */
25577  __pyx_L1_error:;
25578  __Pyx_XDECREF(__pyx_t_1);
25579  __Pyx_AddTraceback("WaveTools.NewWave.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25580  __pyx_r = NULL;
25581  __Pyx_XGIVEREF(__pyx_r);
25582  __Pyx_RefNannyFinishContext();
25583  return __pyx_r;
25584 }
25585 
25586 /* "(tree fragment)":3
25587  * def __reduce_cython__(self):
25588  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25589  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
25590  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25591  */
25592 
25593 /* Python wrapper */
25594 static PyObject *__pyx_pw_9WaveTools_7NewWave_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
25595 static PyMethodDef __pyx_mdef_9WaveTools_7NewWave_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_7NewWave_11__setstate_cython__, METH_O, 0};
25596 static PyObject *__pyx_pw_9WaveTools_7NewWave_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
25597  PyObject *__pyx_r = 0;
25598  __Pyx_RefNannyDeclarations
25599  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
25600  __pyx_r = __pyx_pf_9WaveTools_7NewWave_10__setstate_cython__(((struct __pyx_obj_9WaveTools_NewWave *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
25601 
25602  /* function exit code */
25603  __Pyx_RefNannyFinishContext();
25604  return __pyx_r;
25605 }
25606 
25607 static PyObject *__pyx_pf_9WaveTools_7NewWave_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_NewWave *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
25608  PyObject *__pyx_r = NULL;
25609  __Pyx_RefNannyDeclarations
25610  PyObject *__pyx_t_1 = NULL;
25611  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
25612 
25613  /* "(tree fragment)":4
25614  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25615  * def __setstate_cython__(self, __pyx_state):
25616  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
25617  */
25618  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
25619  __Pyx_GOTREF(__pyx_t_1);
25620  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
25621  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25622  __PYX_ERR(1, 4, __pyx_L1_error)
25623 
25624  /* "(tree fragment)":3
25625  * def __reduce_cython__(self):
25626  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25627  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
25628  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
25629  */
25630 
25631  /* function exit code */
25632  __pyx_L1_error:;
25633  __Pyx_XDECREF(__pyx_t_1);
25634  __Pyx_AddTraceback("WaveTools.NewWave.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25635  __pyx_r = NULL;
25636  __Pyx_XGIVEREF(__pyx_r);
25637  __Pyx_RefNannyFinishContext();
25638  return __pyx_r;
25639 }
25640 
25641 /* "WaveTools.py":1428
25642  * Switch for optimised functions
25643  * """
25644  * def __cinit__(self, # <<<<<<<<<<<<<<
25645  * Tp,
25646  * Hs,
25647  */
25648 
25649 /* Python wrapper */
25650 static int __pyx_pw_9WaveTools_11RandomWaves_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25651 static int __pyx_pw_9WaveTools_11RandomWaves_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25652  PyObject *__pyx_v_Tp = 0;
25653  PyObject *__pyx_v_Hs = 0;
25654  PyObject *__pyx_v_mwl = 0;
25655  PyObject *__pyx_v_depth = 0;
25656  PyObject *__pyx_v_waveDir = 0;
25657  PyObject *__pyx_v_g = 0;
25658  PyObject *__pyx_v_N = 0;
25659  PyObject *__pyx_v_bandFactor = 0;
25660  PyObject *__pyx_v_spectName = 0;
25661  PyObject *__pyx_v_spectral_params = 0;
25662  PyObject *__pyx_v_phi = 0;
25663  PyObject *__pyx_v_fast = 0;
25664  int __pyx_r;
25665  __Pyx_RefNannyDeclarations
25666  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
25667  {
25668  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spectral_params,&__pyx_n_s_phi,&__pyx_n_s_fast,0};
25669  PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
25670 
25671  /* "WaveTools.py":1438
25672  * bandFactor, #accelerationof gravity
25673  * spectName ,# random words will result in error and return the available spectra
25674  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth} # <<<<<<<<<<<<<<
25675  * phi=None,
25676  * fast = True
25677  */
25678  values[9] = ((PyObject *)Py_None);
25679 
25680  /* "WaveTools.py":1439
25681  * spectName ,# random words will result in error and return the available spectra
25682  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
25683  * phi=None, # <<<<<<<<<<<<<<
25684  * fast = True
25685  * ):
25686  */
25687  values[10] = ((PyObject *)Py_None);
25688 
25689  /* "WaveTools.py":1440
25690  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
25691  * phi=None,
25692  * fast = True # <<<<<<<<<<<<<<
25693  * ):
25694  * self.fast= fast
25695  */
25696  values[11] = ((PyObject *)Py_True);
25697  if (unlikely(__pyx_kwds)) {
25698  Py_ssize_t kw_args;
25699  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
25700  switch (pos_args) {
25701  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
25702  CYTHON_FALLTHROUGH;
25703  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
25704  CYTHON_FALLTHROUGH;
25705  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
25706  CYTHON_FALLTHROUGH;
25707  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
25708  CYTHON_FALLTHROUGH;
25709  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
25710  CYTHON_FALLTHROUGH;
25711  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
25712  CYTHON_FALLTHROUGH;
25713  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
25714  CYTHON_FALLTHROUGH;
25715  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
25716  CYTHON_FALLTHROUGH;
25717  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
25718  CYTHON_FALLTHROUGH;
25719  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25720  CYTHON_FALLTHROUGH;
25721  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25722  CYTHON_FALLTHROUGH;
25723  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25724  CYTHON_FALLTHROUGH;
25725  case 0: break;
25726  default: goto __pyx_L5_argtuple_error;
25727  }
25728  kw_args = PyDict_Size(__pyx_kwds);
25729  switch (pos_args) {
25730  case 0:
25731  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
25732  else goto __pyx_L5_argtuple_error;
25733  CYTHON_FALLTHROUGH;
25734  case 1:
25735  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
25736  else {
25737  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 1); __PYX_ERR(0, 1428, __pyx_L3_error)
25738  }
25739  CYTHON_FALLTHROUGH;
25740  case 2:
25741  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
25742  else {
25743  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 2); __PYX_ERR(0, 1428, __pyx_L3_error)
25744  }
25745  CYTHON_FALLTHROUGH;
25746  case 3:
25747  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
25748  else {
25749  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 3); __PYX_ERR(0, 1428, __pyx_L3_error)
25750  }
25751  CYTHON_FALLTHROUGH;
25752  case 4:
25753  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
25754  else {
25755  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 4); __PYX_ERR(0, 1428, __pyx_L3_error)
25756  }
25757  CYTHON_FALLTHROUGH;
25758  case 5:
25759  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
25760  else {
25761  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 5); __PYX_ERR(0, 1428, __pyx_L3_error)
25762  }
25763  CYTHON_FALLTHROUGH;
25764  case 6:
25765  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
25766  else {
25767  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 6); __PYX_ERR(0, 1428, __pyx_L3_error)
25768  }
25769  CYTHON_FALLTHROUGH;
25770  case 7:
25771  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
25772  else {
25773  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 7); __PYX_ERR(0, 1428, __pyx_L3_error)
25774  }
25775  CYTHON_FALLTHROUGH;
25776  case 8:
25777  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
25778  else {
25779  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, 8); __PYX_ERR(0, 1428, __pyx_L3_error)
25780  }
25781  CYTHON_FALLTHROUGH;
25782  case 9:
25783  if (kw_args > 0) {
25784  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params);
25785  if (value) { values[9] = value; kw_args--; }
25786  }
25787  CYTHON_FALLTHROUGH;
25788  case 10:
25789  if (kw_args > 0) {
25790  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi);
25791  if (value) { values[10] = value; kw_args--; }
25792  }
25793  CYTHON_FALLTHROUGH;
25794  case 11:
25795  if (kw_args > 0) {
25796  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
25797  if (value) { values[11] = value; kw_args--; }
25798  }
25799  }
25800  if (unlikely(kw_args > 0)) {
25801  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1428, __pyx_L3_error)
25802  }
25803  } else {
25804  switch (PyTuple_GET_SIZE(__pyx_args)) {
25805  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
25806  CYTHON_FALLTHROUGH;
25807  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
25808  CYTHON_FALLTHROUGH;
25809  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
25810  CYTHON_FALLTHROUGH;
25811  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
25812  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
25813  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
25814  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
25815  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
25816  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
25817  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
25818  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
25819  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25820  break;
25821  default: goto __pyx_L5_argtuple_error;
25822  }
25823  }
25824  __pyx_v_Tp = values[0];
25825  __pyx_v_Hs = values[1];
25826  __pyx_v_mwl = values[2];
25827  __pyx_v_depth = values[3];
25828  __pyx_v_waveDir = values[4];
25829  __pyx_v_g = values[5];
25830  __pyx_v_N = values[6];
25831  __pyx_v_bandFactor = values[7];
25832  __pyx_v_spectName = values[8];
25833  __pyx_v_spectral_params = values[9];
25834  __pyx_v_phi = values[10];
25835  __pyx_v_fast = values[11];
25836  }
25837  goto __pyx_L4_argument_unpacking_done;
25838  __pyx_L5_argtuple_error:;
25839  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 9, 12, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1428, __pyx_L3_error)
25840  __pyx_L3_error:;
25841  __Pyx_AddTraceback("WaveTools.RandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
25842  __Pyx_RefNannyFinishContext();
25843  return -1;
25844  __pyx_L4_argument_unpacking_done:;
25845  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves___cinit__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spectral_params, __pyx_v_phi, __pyx_v_fast);
25846 
25847  /* "WaveTools.py":1428
25848  * Switch for optimised functions
25849  * """
25850  * def __cinit__(self, # <<<<<<<<<<<<<<
25851  * Tp,
25852  * Hs,
25853  */
25854 
25855  /* function exit code */
25856  __Pyx_RefNannyFinishContext();
25857  return __pyx_r;
25858 }
25859 
25860 static int __pyx_pf_9WaveTools_11RandomWaves___cinit__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_fast) {
25861  PyObject *__pyx_v_validSpectra = NULL;
25862  PyObject *__pyx_v_spec_fun = NULL;
25863  double __pyx_v_fmax;
25864  PyObject *__pyx_v_fmin = NULL;
25865  PyObject *__pyx_v_omega_p = NULL;
25866  PyObject *__pyx_v_fim = NULL;
25867  PyObject *__pyx_v_ii = NULL;
25868  PyObject *__pyx_v_ij = NULL;
25869  PyObject *__pyx_v_kk = NULL;
25870  int __pyx_r;
25871  __Pyx_RefNannyDeclarations
25872  bool __pyx_t_1;
25873  PyObject *__pyx_t_2 = NULL;
25874  PyObject *__pyx_t_3 = NULL;
25875  PyObject *__pyx_t_4 = NULL;
25876  int __pyx_t_5;
25877  PyObject *__pyx_t_6 = NULL;
25878  PyObject *__pyx_t_7 = NULL;
25879  double __pyx_t_8;
25880  PyObject *__pyx_t_9 = NULL;
25881  int __pyx_t_10;
25882  int __pyx_t_11;
25883  PyObject *__pyx_t_12 = NULL;
25884  PyObject *__pyx_t_13 = NULL;
25885  PyObject *__pyx_t_14 = NULL;
25886  PyObject *__pyx_t_15 = NULL;
25887  Py_ssize_t __pyx_t_16;
25888  PyObject *(*__pyx_t_17)(PyObject *);
25889  Py_ssize_t __pyx_t_18;
25890  double *__pyx_t_19;
25891  PyObject *(*__pyx_t_20)(PyObject *);
25892  Py_ssize_t __pyx_t_21;
25893  __Pyx_RefNannySetupContext("__cinit__", 0);
25894  __Pyx_INCREF(__pyx_v_waveDir);
25895 
25896  /* "WaveTools.py":1442
25897  * fast = True
25898  * ):
25899  * self.fast= fast # <<<<<<<<<<<<<<
25900  * validSpectra = [JONSWAP,PM_mod]
25901  * spec_fun =loadExistingFunction(spectName, validSpectra)
25902  */
25903  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1442, __pyx_L1_error)
25904  __pyx_v_self->fast = __pyx_t_1;
25905 
25906  /* "WaveTools.py":1443
25907  * ):
25908  * self.fast= fast
25909  * validSpectra = [JONSWAP,PM_mod] # <<<<<<<<<<<<<<
25910  * spec_fun =loadExistingFunction(spectName, validSpectra)
25911  * self.g = np.array(g)
25912  */
25913  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_JONSWAP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1443, __pyx_L1_error)
25914  __Pyx_GOTREF(__pyx_t_2);
25915  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PM_mod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1443, __pyx_L1_error)
25916  __Pyx_GOTREF(__pyx_t_3);
25917  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1443, __pyx_L1_error)
25918  __Pyx_GOTREF(__pyx_t_4);
25919  __Pyx_GIVEREF(__pyx_t_2);
25920  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
25921  __Pyx_GIVEREF(__pyx_t_3);
25922  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
25923  __pyx_t_2 = 0;
25924  __pyx_t_3 = 0;
25925  __pyx_v_validSpectra = ((PyObject*)__pyx_t_4);
25926  __pyx_t_4 = 0;
25927 
25928  /* "WaveTools.py":1444
25929  * self.fast= fast
25930  * validSpectra = [JONSWAP,PM_mod]
25931  * spec_fun =loadExistingFunction(spectName, validSpectra) # <<<<<<<<<<<<<<
25932  * self.g = np.array(g)
25933  * waveDir = setDirVector(np.array(waveDir))
25934  */
25935  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_loadExistingFunction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error)
25936  __Pyx_GOTREF(__pyx_t_3);
25937  __pyx_t_2 = NULL;
25938  __pyx_t_5 = 0;
25939  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
25940  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
25941  if (likely(__pyx_t_2)) {
25942  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
25943  __Pyx_INCREF(__pyx_t_2);
25944  __Pyx_INCREF(function);
25945  __Pyx_DECREF_SET(__pyx_t_3, function);
25946  __pyx_t_5 = 1;
25947  }
25948  }
25949  #if CYTHON_FAST_PYCALL
25950  if (PyFunction_Check(__pyx_t_3)) {
25951  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_spectName, __pyx_v_validSpectra};
25952  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1444, __pyx_L1_error)
25953  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25954  __Pyx_GOTREF(__pyx_t_4);
25955  } else
25956  #endif
25957  #if CYTHON_FAST_PYCCALL
25958  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
25959  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_spectName, __pyx_v_validSpectra};
25960  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1444, __pyx_L1_error)
25961  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25962  __Pyx_GOTREF(__pyx_t_4);
25963  } else
25964  #endif
25965  {
25966  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1444, __pyx_L1_error)
25967  __Pyx_GOTREF(__pyx_t_6);
25968  if (__pyx_t_2) {
25969  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
25970  }
25971  __Pyx_INCREF(__pyx_v_spectName);
25972  __Pyx_GIVEREF(__pyx_v_spectName);
25973  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_spectName);
25974  __Pyx_INCREF(__pyx_v_validSpectra);
25975  __Pyx_GIVEREF(__pyx_v_validSpectra);
25976  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_validSpectra);
25977  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1444, __pyx_L1_error)
25978  __Pyx_GOTREF(__pyx_t_4);
25979  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25980  }
25981  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25982  __pyx_v_spec_fun = __pyx_t_4;
25983  __pyx_t_4 = 0;
25984 
25985  /* "WaveTools.py":1445
25986  * validSpectra = [JONSWAP,PM_mod]
25987  * spec_fun =loadExistingFunction(spectName, validSpectra)
25988  * self.g = np.array(g) # <<<<<<<<<<<<<<
25989  * waveDir = setDirVector(np.array(waveDir))
25990  * self.waveDir = waveDir
25991  */
25992  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error)
25993  __Pyx_GOTREF(__pyx_t_3);
25994  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1445, __pyx_L1_error)
25995  __Pyx_GOTREF(__pyx_t_6);
25996  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25997  __pyx_t_3 = NULL;
25998  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
25999  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
26000  if (likely(__pyx_t_3)) {
26001  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26002  __Pyx_INCREF(__pyx_t_3);
26003  __Pyx_INCREF(function);
26004  __Pyx_DECREF_SET(__pyx_t_6, function);
26005  }
26006  }
26007  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_g);
26008  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26009  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1445, __pyx_L1_error)
26010  __Pyx_GOTREF(__pyx_t_4);
26011  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26012  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1445, __pyx_L1_error)
26013  __Pyx_GIVEREF(__pyx_t_4);
26014  __Pyx_GOTREF(__pyx_v_self->g);
26015  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
26016  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_4);
26017  __pyx_t_4 = 0;
26018 
26019  /* "WaveTools.py":1446
26020  * spec_fun =loadExistingFunction(spectName, validSpectra)
26021  * self.g = np.array(g)
26022  * waveDir = setDirVector(np.array(waveDir)) # <<<<<<<<<<<<<<
26023  * self.waveDir = waveDir
26024  * self.vDir = setVertDir(g)
26025  */
26026  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1446, __pyx_L1_error)
26027  __Pyx_GOTREF(__pyx_t_6);
26028  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1446, __pyx_L1_error)
26029  __Pyx_GOTREF(__pyx_t_2);
26030  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1446, __pyx_L1_error)
26031  __Pyx_GOTREF(__pyx_t_7);
26032  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26033  __pyx_t_2 = NULL;
26034  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
26035  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
26036  if (likely(__pyx_t_2)) {
26037  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
26038  __Pyx_INCREF(__pyx_t_2);
26039  __Pyx_INCREF(function);
26040  __Pyx_DECREF_SET(__pyx_t_7, function);
26041  }
26042  }
26043  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_v_waveDir) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_waveDir);
26044  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26045  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1446, __pyx_L1_error)
26046  __Pyx_GOTREF(__pyx_t_3);
26047  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26048  __pyx_t_7 = NULL;
26049  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26050  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
26051  if (likely(__pyx_t_7)) {
26052  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26053  __Pyx_INCREF(__pyx_t_7);
26054  __Pyx_INCREF(function);
26055  __Pyx_DECREF_SET(__pyx_t_6, function);
26056  }
26057  }
26058  __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
26059  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26060  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26061  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __pyx_L1_error)
26062  __Pyx_GOTREF(__pyx_t_4);
26063  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26064  __Pyx_DECREF_SET(__pyx_v_waveDir, __pyx_t_4);
26065  __pyx_t_4 = 0;
26066 
26067  /* "WaveTools.py":1447
26068  * self.g = np.array(g)
26069  * waveDir = setDirVector(np.array(waveDir))
26070  * self.waveDir = waveDir # <<<<<<<<<<<<<<
26071  * self.vDir = setVertDir(g)
26072  * dirCheck(self.waveDir,self.vDir)
26073  */
26074  if (!(likely(((__pyx_v_waveDir) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_waveDir, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1447, __pyx_L1_error)
26075  __pyx_t_4 = __pyx_v_waveDir;
26076  __Pyx_INCREF(__pyx_t_4);
26077  __Pyx_GIVEREF(__pyx_t_4);
26078  __Pyx_GOTREF(__pyx_v_self->waveDir);
26079  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
26080  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_4);
26081  __pyx_t_4 = 0;
26082 
26083  /* "WaveTools.py":1448
26084  * waveDir = setDirVector(np.array(waveDir))
26085  * self.waveDir = waveDir
26086  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
26087  * dirCheck(self.waveDir,self.vDir)
26088  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
26089  */
26090  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1448, __pyx_L1_error)
26091  __Pyx_GOTREF(__pyx_t_6);
26092  __pyx_t_3 = NULL;
26093  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26094  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
26095  if (likely(__pyx_t_3)) {
26096  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26097  __Pyx_INCREF(__pyx_t_3);
26098  __Pyx_INCREF(function);
26099  __Pyx_DECREF_SET(__pyx_t_6, function);
26100  }
26101  }
26102  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_g);
26103  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26104  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1448, __pyx_L1_error)
26105  __Pyx_GOTREF(__pyx_t_4);
26106  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26107  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1448, __pyx_L1_error)
26108  __Pyx_GIVEREF(__pyx_t_4);
26109  __Pyx_GOTREF(__pyx_v_self->vDir);
26110  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
26111  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_4);
26112  __pyx_t_4 = 0;
26113 
26114  /* "WaveTools.py":1449
26115  * self.waveDir = waveDir
26116  * self.vDir = setVertDir(g)
26117  * dirCheck(self.waveDir,self.vDir) # <<<<<<<<<<<<<<
26118  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
26119  * self.Hs = Hs
26120  */
26121  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_dirCheck); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1449, __pyx_L1_error)
26122  __Pyx_GOTREF(__pyx_t_6);
26123  __pyx_t_3 = NULL;
26124  __pyx_t_5 = 0;
26125  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26126  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
26127  if (likely(__pyx_t_3)) {
26128  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26129  __Pyx_INCREF(__pyx_t_3);
26130  __Pyx_INCREF(function);
26131  __Pyx_DECREF_SET(__pyx_t_6, function);
26132  __pyx_t_5 = 1;
26133  }
26134  }
26135  #if CYTHON_FAST_PYCALL
26136  if (PyFunction_Check(__pyx_t_6)) {
26137  PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
26138  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
26139  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26140  __Pyx_GOTREF(__pyx_t_4);
26141  } else
26142  #endif
26143  #if CYTHON_FAST_PYCCALL
26144  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
26145  PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
26146  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
26147  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26148  __Pyx_GOTREF(__pyx_t_4);
26149  } else
26150  #endif
26151  {
26152  __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1449, __pyx_L1_error)
26153  __Pyx_GOTREF(__pyx_t_7);
26154  if (__pyx_t_3) {
26155  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
26156  }
26157  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
26158  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->waveDir));
26159  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, ((PyObject *)__pyx_v_self->waveDir));
26160  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
26161  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->vDir));
26162  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, ((PyObject *)__pyx_v_self->vDir));
26163  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error)
26164  __Pyx_GOTREF(__pyx_t_4);
26165  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26166  }
26167  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26168  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26169 
26170  /* "WaveTools.py":1450
26171  * self.vDir = setVertDir(g)
26172  * dirCheck(self.waveDir,self.vDir)
26173  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2]) # <<<<<<<<<<<<<<
26174  * self.Hs = Hs
26175  * self.depth = depth
26176  */
26177  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
26178  __Pyx_GOTREF(__pyx_t_4);
26179  __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1450, __pyx_L1_error)
26180  __Pyx_GOTREF(__pyx_t_6);
26181  __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1450, __pyx_L1_error)
26182  __Pyx_GOTREF(__pyx_t_7);
26183  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26184  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26185  __pyx_t_6 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1450, __pyx_L1_error)
26186  __Pyx_GOTREF(__pyx_t_6);
26187  __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
26188  __Pyx_GOTREF(__pyx_t_4);
26189  __pyx_t_3 = PyNumber_Multiply(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
26190  __Pyx_GOTREF(__pyx_t_3);
26191  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26192  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26193  __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error)
26194  __Pyx_GOTREF(__pyx_t_4);
26195  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26196  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26197  __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error)
26198  __Pyx_GOTREF(__pyx_t_3);
26199  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->g), 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1450, __pyx_L1_error)
26200  __Pyx_GOTREF(__pyx_t_7);
26201  __pyx_t_6 = PyNumber_Multiply(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1450, __pyx_L1_error)
26202  __Pyx_GOTREF(__pyx_t_6);
26203  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26204  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26205  __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1450, __pyx_L1_error)
26206  __Pyx_GOTREF(__pyx_t_7);
26207  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26208  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26209  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1450, __pyx_L1_error)
26210  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26211  __pyx_v_self->gAbs = sqrt(__pyx_t_8);
26212 
26213  /* "WaveTools.py":1451
26214  * dirCheck(self.waveDir,self.vDir)
26215  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
26216  * self.Hs = Hs # <<<<<<<<<<<<<<
26217  * self.depth = depth
26218  * self.Tp = Tp
26219  */
26220  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_Hs); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1451, __pyx_L1_error)
26221  __pyx_v_self->Hs = __pyx_t_8;
26222 
26223  /* "WaveTools.py":1452
26224  * self.gAbs = sqrt(self.g[0]*self.g[0]+self.g[1]*self.g[1]+self.g[2]*self.g[2])
26225  * self.Hs = Hs
26226  * self.depth = depth # <<<<<<<<<<<<<<
26227  * self.Tp = Tp
26228  * self.fp = old_div(1.,Tp)
26229  */
26230  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1452, __pyx_L1_error)
26231  __pyx_v_self->depth = __pyx_t_8;
26232 
26233  /* "WaveTools.py":1453
26234  * self.Hs = Hs
26235  * self.depth = depth
26236  * self.Tp = Tp # <<<<<<<<<<<<<<
26237  * self.fp = old_div(1.,Tp)
26238  * self.bandFactor = bandFactor
26239  */
26240  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_Tp); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1453, __pyx_L1_error)
26241  __pyx_v_self->Tp = __pyx_t_8;
26242 
26243  /* "WaveTools.py":1454
26244  * self.depth = depth
26245  * self.Tp = Tp
26246  * self.fp = old_div(1.,Tp) # <<<<<<<<<<<<<<
26247  * self.bandFactor = bandFactor
26248  * self.N = N
26249  */
26250  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1454, __pyx_L1_error)
26251  __Pyx_GOTREF(__pyx_t_6);
26252  __pyx_t_4 = NULL;
26253  __pyx_t_5 = 0;
26254  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26255  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
26256  if (likely(__pyx_t_4)) {
26257  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26258  __Pyx_INCREF(__pyx_t_4);
26259  __Pyx_INCREF(function);
26260  __Pyx_DECREF_SET(__pyx_t_6, function);
26261  __pyx_t_5 = 1;
26262  }
26263  }
26264  #if CYTHON_FAST_PYCALL
26265  if (PyFunction_Check(__pyx_t_6)) {
26266  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_float_1_, __pyx_v_Tp};
26267  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1454, __pyx_L1_error)
26268  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26269  __Pyx_GOTREF(__pyx_t_7);
26270  } else
26271  #endif
26272  #if CYTHON_FAST_PYCCALL
26273  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
26274  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_float_1_, __pyx_v_Tp};
26275  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1454, __pyx_L1_error)
26276  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26277  __Pyx_GOTREF(__pyx_t_7);
26278  } else
26279  #endif
26280  {
26281  __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error)
26282  __Pyx_GOTREF(__pyx_t_3);
26283  if (__pyx_t_4) {
26284  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
26285  }
26286  __Pyx_INCREF(__pyx_float_1_);
26287  __Pyx_GIVEREF(__pyx_float_1_);
26288  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_float_1_);
26289  __Pyx_INCREF(__pyx_v_Tp);
26290  __Pyx_GIVEREF(__pyx_v_Tp);
26291  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_Tp);
26292  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1454, __pyx_L1_error)
26293  __Pyx_GOTREF(__pyx_t_7);
26294  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26295  }
26296  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26297  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1454, __pyx_L1_error)
26298  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26299  __pyx_v_self->fp = __pyx_t_8;
26300 
26301  /* "WaveTools.py":1455
26302  * self.Tp = Tp
26303  * self.fp = old_div(1.,Tp)
26304  * self.bandFactor = bandFactor # <<<<<<<<<<<<<<
26305  * self.N = N
26306  * self.mwl = mwl
26307  */
26308  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_bandFactor); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1455, __pyx_L1_error)
26309  __pyx_v_self->bandFactor = __pyx_t_8;
26310 
26311  /* "WaveTools.py":1456
26312  * self.fp = old_div(1.,Tp)
26313  * self.bandFactor = bandFactor
26314  * self.N = N # <<<<<<<<<<<<<<
26315  * self.mwl = mwl
26316  * fmax = self.bandFactor*self.fp
26317  */
26318  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1456, __pyx_L1_error)
26319  __pyx_v_self->N = __pyx_t_5;
26320 
26321  /* "WaveTools.py":1457
26322  * self.bandFactor = bandFactor
26323  * self.N = N
26324  * self.mwl = mwl # <<<<<<<<<<<<<<
26325  * fmax = self.bandFactor*self.fp
26326  * fmin = old_div(self.fp,self.bandFactor)
26327  */
26328  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1457, __pyx_L1_error)
26329  __pyx_v_self->mwl = __pyx_t_8;
26330 
26331  /* "WaveTools.py":1458
26332  * self.N = N
26333  * self.mwl = mwl
26334  * fmax = self.bandFactor*self.fp # <<<<<<<<<<<<<<
26335  * fmin = old_div(self.fp,self.bandFactor)
26336  * self.df = old_div((fmax-fmin),float(self.N-1))
26337  */
26338  __pyx_v_fmax = (__pyx_v_self->bandFactor * __pyx_v_self->fp);
26339 
26340  /* "WaveTools.py":1459
26341  * self.mwl = mwl
26342  * fmax = self.bandFactor*self.fp
26343  * fmin = old_div(self.fp,self.bandFactor) # <<<<<<<<<<<<<<
26344  * self.df = old_div((fmax-fmin),float(self.N-1))
26345  * self.fi = np.linspace(fmin,fmax,self.N)
26346  */
26347  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1459, __pyx_L1_error)
26348  __Pyx_GOTREF(__pyx_t_6);
26349  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->fp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
26350  __Pyx_GOTREF(__pyx_t_3);
26351  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->bandFactor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1459, __pyx_L1_error)
26352  __Pyx_GOTREF(__pyx_t_4);
26353  __pyx_t_2 = NULL;
26354  __pyx_t_5 = 0;
26355  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26356  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
26357  if (likely(__pyx_t_2)) {
26358  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26359  __Pyx_INCREF(__pyx_t_2);
26360  __Pyx_INCREF(function);
26361  __Pyx_DECREF_SET(__pyx_t_6, function);
26362  __pyx_t_5 = 1;
26363  }
26364  }
26365  #if CYTHON_FAST_PYCALL
26366  if (PyFunction_Check(__pyx_t_6)) {
26367  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_4};
26368  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1459, __pyx_L1_error)
26369  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26370  __Pyx_GOTREF(__pyx_t_7);
26371  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26372  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26373  } else
26374  #endif
26375  #if CYTHON_FAST_PYCCALL
26376  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
26377  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_4};
26378  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1459, __pyx_L1_error)
26379  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26380  __Pyx_GOTREF(__pyx_t_7);
26381  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26382  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26383  } else
26384  #endif
26385  {
26386  __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1459, __pyx_L1_error)
26387  __Pyx_GOTREF(__pyx_t_9);
26388  if (__pyx_t_2) {
26389  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
26390  }
26391  __Pyx_GIVEREF(__pyx_t_3);
26392  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_3);
26393  __Pyx_GIVEREF(__pyx_t_4);
26394  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_4);
26395  __pyx_t_3 = 0;
26396  __pyx_t_4 = 0;
26397  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1459, __pyx_L1_error)
26398  __Pyx_GOTREF(__pyx_t_7);
26399  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26400  }
26401  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26402  __pyx_v_fmin = __pyx_t_7;
26403  __pyx_t_7 = 0;
26404 
26405  /* "WaveTools.py":1460
26406  * fmax = self.bandFactor*self.fp
26407  * fmin = old_div(self.fp,self.bandFactor)
26408  * self.df = old_div((fmax-fmin),float(self.N-1)) # <<<<<<<<<<<<<<
26409  * self.fi = np.linspace(fmin,fmax,self.N)
26410  * self.omega = 2.*M_PI*self.fi
26411  */
26412  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1460, __pyx_L1_error)
26413  __Pyx_GOTREF(__pyx_t_6);
26414  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_fmax); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1460, __pyx_L1_error)
26415  __Pyx_GOTREF(__pyx_t_9);
26416  __pyx_t_4 = PyNumber_Subtract(__pyx_t_9, __pyx_v_fmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
26417  __Pyx_GOTREF(__pyx_t_4);
26418  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26419  __pyx_t_9 = PyFloat_FromDouble(((double)(__pyx_v_self->N - 1))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1460, __pyx_L1_error)
26420  __Pyx_GOTREF(__pyx_t_9);
26421  __pyx_t_3 = NULL;
26422  __pyx_t_5 = 0;
26423  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26424  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
26425  if (likely(__pyx_t_3)) {
26426  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26427  __Pyx_INCREF(__pyx_t_3);
26428  __Pyx_INCREF(function);
26429  __Pyx_DECREF_SET(__pyx_t_6, function);
26430  __pyx_t_5 = 1;
26431  }
26432  }
26433  #if CYTHON_FAST_PYCALL
26434  if (PyFunction_Check(__pyx_t_6)) {
26435  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_9};
26436  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error)
26437  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26438  __Pyx_GOTREF(__pyx_t_7);
26439  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26440  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26441  } else
26442  #endif
26443  #if CYTHON_FAST_PYCCALL
26444  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
26445  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_9};
26446  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error)
26447  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26448  __Pyx_GOTREF(__pyx_t_7);
26449  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26450  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26451  } else
26452  #endif
26453  {
26454  __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
26455  __Pyx_GOTREF(__pyx_t_2);
26456  if (__pyx_t_3) {
26457  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
26458  }
26459  __Pyx_GIVEREF(__pyx_t_4);
26460  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_t_4);
26461  __Pyx_GIVEREF(__pyx_t_9);
26462  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_t_9);
26463  __pyx_t_4 = 0;
26464  __pyx_t_9 = 0;
26465  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error)
26466  __Pyx_GOTREF(__pyx_t_7);
26467  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26468  }
26469  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26470  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L1_error)
26471  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26472  __pyx_v_self->df = __pyx_t_8;
26473 
26474  /* "WaveTools.py":1461
26475  * fmin = old_div(self.fp,self.bandFactor)
26476  * self.df = old_div((fmax-fmin),float(self.N-1))
26477  * self.fi = np.linspace(fmin,fmax,self.N) # <<<<<<<<<<<<<<
26478  * self.omega = 2.*M_PI*self.fi
26479  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
26480  */
26481  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1461, __pyx_L1_error)
26482  __Pyx_GOTREF(__pyx_t_6);
26483  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_linspace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error)
26484  __Pyx_GOTREF(__pyx_t_2);
26485  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26486  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_fmax); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1461, __pyx_L1_error)
26487  __Pyx_GOTREF(__pyx_t_6);
26488  __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1461, __pyx_L1_error)
26489  __Pyx_GOTREF(__pyx_t_9);
26490  __pyx_t_4 = NULL;
26491  __pyx_t_5 = 0;
26492  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
26493  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
26494  if (likely(__pyx_t_4)) {
26495  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26496  __Pyx_INCREF(__pyx_t_4);
26497  __Pyx_INCREF(function);
26498  __Pyx_DECREF_SET(__pyx_t_2, function);
26499  __pyx_t_5 = 1;
26500  }
26501  }
26502  #if CYTHON_FAST_PYCALL
26503  if (PyFunction_Check(__pyx_t_2)) {
26504  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_fmin, __pyx_t_6, __pyx_t_9};
26505  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1461, __pyx_L1_error)
26506  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26507  __Pyx_GOTREF(__pyx_t_7);
26508  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26509  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26510  } else
26511  #endif
26512  #if CYTHON_FAST_PYCCALL
26513  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
26514  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_fmin, __pyx_t_6, __pyx_t_9};
26515  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1461, __pyx_L1_error)
26516  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26517  __Pyx_GOTREF(__pyx_t_7);
26518  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26519  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26520  } else
26521  #endif
26522  {
26523  __pyx_t_3 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error)
26524  __Pyx_GOTREF(__pyx_t_3);
26525  if (__pyx_t_4) {
26526  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
26527  }
26528  __Pyx_INCREF(__pyx_v_fmin);
26529  __Pyx_GIVEREF(__pyx_v_fmin);
26530  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_fmin);
26531  __Pyx_GIVEREF(__pyx_t_6);
26532  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_t_6);
26533  __Pyx_GIVEREF(__pyx_t_9);
26534  PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_5, __pyx_t_9);
26535  __pyx_t_6 = 0;
26536  __pyx_t_9 = 0;
26537  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1461, __pyx_L1_error)
26538  __Pyx_GOTREF(__pyx_t_7);
26539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26540  }
26541  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26542  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1461, __pyx_L1_error)
26543  __Pyx_GIVEREF(__pyx_t_7);
26544  __Pyx_GOTREF(__pyx_v_self->fi);
26545  __Pyx_DECREF(((PyObject *)__pyx_v_self->fi));
26546  __pyx_v_self->fi = ((PyArrayObject *)__pyx_t_7);
26547  __pyx_t_7 = 0;
26548 
26549  /* "WaveTools.py":1462
26550  * self.df = old_div((fmax-fmin),float(self.N-1))
26551  * self.fi = np.linspace(fmin,fmax,self.N)
26552  * self.omega = 2.*M_PI*self.fi # <<<<<<<<<<<<<<
26553  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
26554  * omega_p = 2.*M_PI/Tp
26555  */
26556  __pyx_t_7 = PyFloat_FromDouble((2. * M_PI)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1462, __pyx_L1_error)
26557  __Pyx_GOTREF(__pyx_t_7);
26558  __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, ((PyObject *)__pyx_v_self->fi)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error)
26559  __Pyx_GOTREF(__pyx_t_2);
26560  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26561  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1462, __pyx_L1_error)
26562  __Pyx_GIVEREF(__pyx_t_2);
26563  __Pyx_GOTREF(__pyx_v_self->omega);
26564  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
26565  __pyx_v_self->omega = ((PyArrayObject *)__pyx_t_2);
26566  __pyx_t_2 = 0;
26567 
26568  /* "WaveTools.py":1463
26569  * self.fi = np.linspace(fmin,fmax,self.N)
26570  * self.omega = 2.*M_PI*self.fi
26571  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs) # <<<<<<<<<<<<<<
26572  * omega_p = 2.*M_PI/Tp
26573  * self.wavelength = 2.*M_PI/dispersion(omega_p,self.depth,g=self.gAbs)
26574  */
26575  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error)
26576  __Pyx_GOTREF(__pyx_t_2);
26577  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1463, __pyx_L1_error)
26578  __Pyx_GOTREF(__pyx_t_7);
26579  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
26580  __Pyx_GOTREF(__pyx_t_3);
26581  __Pyx_INCREF(((PyObject *)__pyx_v_self->omega));
26582  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->omega));
26583  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->omega));
26584  __Pyx_GIVEREF(__pyx_t_7);
26585  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
26586  __pyx_t_7 = 0;
26587  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1463, __pyx_L1_error)
26588  __Pyx_GOTREF(__pyx_t_7);
26589  __pyx_t_9 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1463, __pyx_L1_error)
26590  __Pyx_GOTREF(__pyx_t_9);
26591  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_g, __pyx_t_9) < 0) __PYX_ERR(0, 1463, __pyx_L1_error)
26592  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26593  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1463, __pyx_L1_error)
26594  __Pyx_GOTREF(__pyx_t_9);
26595  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26596  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26597  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26598  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1463, __pyx_L1_error)
26599  __Pyx_GIVEREF(__pyx_t_9);
26600  __Pyx_GOTREF(__pyx_v_self->ki);
26601  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
26602  __pyx_v_self->ki = ((PyArrayObject *)__pyx_t_9);
26603  __pyx_t_9 = 0;
26604 
26605  /* "WaveTools.py":1464
26606  * self.omega = 2.*M_PI*self.fi
26607  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
26608  * omega_p = 2.*M_PI/Tp # <<<<<<<<<<<<<<
26609  * self.wavelength = 2.*M_PI/dispersion(omega_p,self.depth,g=self.gAbs)
26610  * if phi is None:
26611  */
26612  __pyx_t_9 = PyFloat_FromDouble((2. * M_PI)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1464, __pyx_L1_error)
26613  __Pyx_GOTREF(__pyx_t_9);
26614  __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_Tp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1464, __pyx_L1_error)
26615  __Pyx_GOTREF(__pyx_t_7);
26616  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26617  __pyx_v_omega_p = __pyx_t_7;
26618  __pyx_t_7 = 0;
26619 
26620  /* "WaveTools.py":1465
26621  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
26622  * omega_p = 2.*M_PI/Tp
26623  * self.wavelength = 2.*M_PI/dispersion(omega_p,self.depth,g=self.gAbs) # <<<<<<<<<<<<<<
26624  * if phi is None:
26625  * self.phi = 2.0*M_PI*np.random.random(self.fi.shape[0])
26626  */
26627  __pyx_t_7 = PyFloat_FromDouble((2. * M_PI)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1465, __pyx_L1_error)
26628  __Pyx_GOTREF(__pyx_t_7);
26629  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1465, __pyx_L1_error)
26630  __Pyx_GOTREF(__pyx_t_9);
26631  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1465, __pyx_L1_error)
26632  __Pyx_GOTREF(__pyx_t_3);
26633  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error)
26634  __Pyx_GOTREF(__pyx_t_2);
26635  __Pyx_INCREF(__pyx_v_omega_p);
26636  __Pyx_GIVEREF(__pyx_v_omega_p);
26637  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_omega_p);
26638  __Pyx_GIVEREF(__pyx_t_3);
26639  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
26640  __pyx_t_3 = 0;
26641  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1465, __pyx_L1_error)
26642  __Pyx_GOTREF(__pyx_t_3);
26643  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1465, __pyx_L1_error)
26644  __Pyx_GOTREF(__pyx_t_6);
26645  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_g, __pyx_t_6) < 0) __PYX_ERR(0, 1465, __pyx_L1_error)
26646  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26647  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1465, __pyx_L1_error)
26648  __Pyx_GOTREF(__pyx_t_6);
26649  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26650  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26651  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26652  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1465, __pyx_L1_error)
26653  __Pyx_GOTREF(__pyx_t_3);
26654  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26655  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26656  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L1_error)
26657  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26658  __pyx_v_self->wavelength = __pyx_t_8;
26659 
26660  /* "WaveTools.py":1466
26661  * omega_p = 2.*M_PI/Tp
26662  * self.wavelength = 2.*M_PI/dispersion(omega_p,self.depth,g=self.gAbs)
26663  * if phi is None: # <<<<<<<<<<<<<<
26664  * self.phi = 2.0*M_PI*np.random.random(self.fi.shape[0])
26665  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves')
26666  */
26667  __pyx_t_10 = (__pyx_v_phi == Py_None);
26668  __pyx_t_11 = (__pyx_t_10 != 0);
26669  if (__pyx_t_11) {
26670 
26671  /* "WaveTools.py":1467
26672  * self.wavelength = 2.*M_PI/dispersion(omega_p,self.depth,g=self.gAbs)
26673  * if phi is None:
26674  * self.phi = 2.0*M_PI*np.random.random(self.fi.shape[0]) # <<<<<<<<<<<<<<
26675  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves')
26676  * else:
26677  */
26678  __pyx_t_3 = PyFloat_FromDouble((2.0 * M_PI)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1467, __pyx_L1_error)
26679  __Pyx_GOTREF(__pyx_t_3);
26680  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1467, __pyx_L1_error)
26681  __Pyx_GOTREF(__pyx_t_7);
26682  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error)
26683  __Pyx_GOTREF(__pyx_t_2);
26684  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26685  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1467, __pyx_L1_error)
26686  __Pyx_GOTREF(__pyx_t_7);
26687  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26688  __pyx_t_2 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->fi->dimensions[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error)
26689  __Pyx_GOTREF(__pyx_t_2);
26690  __pyx_t_9 = NULL;
26691  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
26692  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
26693  if (likely(__pyx_t_9)) {
26694  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
26695  __Pyx_INCREF(__pyx_t_9);
26696  __Pyx_INCREF(function);
26697  __Pyx_DECREF_SET(__pyx_t_7, function);
26698  }
26699  }
26700  __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2);
26701  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
26702  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26703  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1467, __pyx_L1_error)
26704  __Pyx_GOTREF(__pyx_t_6);
26705  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26706  __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1467, __pyx_L1_error)
26707  __Pyx_GOTREF(__pyx_t_7);
26708  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26709  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26710  __Pyx_GIVEREF(__pyx_t_7);
26711  __Pyx_GOTREF(__pyx_v_self->phi);
26712  __Pyx_DECREF(__pyx_v_self->phi);
26713  __pyx_v_self->phi = __pyx_t_7;
26714  __pyx_t_7 = 0;
26715 
26716  /* "WaveTools.py":1468
26717  * if phi is None:
26718  * self.phi = 2.0*M_PI*np.random.random(self.fi.shape[0])
26719  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves') # <<<<<<<<<<<<<<
26720  * else:
26721  * try:
26722  */
26723  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1468, __pyx_L1_error)
26724  __Pyx_GOTREF(__pyx_t_6);
26725  __pyx_t_3 = NULL;
26726  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
26727  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
26728  if (likely(__pyx_t_3)) {
26729  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
26730  __Pyx_INCREF(__pyx_t_3);
26731  __Pyx_INCREF(function);
26732  __Pyx_DECREF_SET(__pyx_t_6, function);
26733  }
26734  }
26735  __pyx_t_7 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_kp_s_INFO_Wavetools_py_No_phase_array) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_INFO_Wavetools_py_No_phase_array);
26736  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26737  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1468, __pyx_L1_error)
26738  __Pyx_GOTREF(__pyx_t_7);
26739  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26740  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26741 
26742  /* "WaveTools.py":1466
26743  * omega_p = 2.*M_PI/Tp
26744  * self.wavelength = 2.*M_PI/dispersion(omega_p,self.depth,g=self.gAbs)
26745  * if phi is None: # <<<<<<<<<<<<<<
26746  * self.phi = 2.0*M_PI*np.random.random(self.fi.shape[0])
26747  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves')
26748  */
26749  goto __pyx_L3;
26750  }
26751 
26752  /* "WaveTools.py":1470
26753  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves')
26754  * else:
26755  * try: # <<<<<<<<<<<<<<
26756  * self.phi = np.array(phi)
26757  * if self.phi.shape[0] != self.fi.shape[0]:
26758  */
26759  /*else*/ {
26760  {
26761  __Pyx_PyThreadState_declare
26762  __Pyx_PyThreadState_assign
26763  __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
26764  __Pyx_XGOTREF(__pyx_t_12);
26765  __Pyx_XGOTREF(__pyx_t_13);
26766  __Pyx_XGOTREF(__pyx_t_14);
26767  /*try:*/ {
26768 
26769  /* "WaveTools.py":1471
26770  * else:
26771  * try:
26772  * self.phi = np.array(phi) # <<<<<<<<<<<<<<
26773  * if self.phi.shape[0] != self.fi.shape[0]:
26774  * logEvent('ERROR! Wavetools.py: Phase array must have N elements')
26775  */
26776  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1471, __pyx_L4_error)
26777  __Pyx_GOTREF(__pyx_t_6);
26778  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L4_error)
26779  __Pyx_GOTREF(__pyx_t_3);
26780  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26781  __pyx_t_6 = NULL;
26782  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
26783  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
26784  if (likely(__pyx_t_6)) {
26785  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
26786  __Pyx_INCREF(__pyx_t_6);
26787  __Pyx_INCREF(function);
26788  __Pyx_DECREF_SET(__pyx_t_3, function);
26789  }
26790  }
26791  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_phi);
26792  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
26793  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1471, __pyx_L4_error)
26794  __Pyx_GOTREF(__pyx_t_7);
26795  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26796  __Pyx_GIVEREF(__pyx_t_7);
26797  __Pyx_GOTREF(__pyx_v_self->phi);
26798  __Pyx_DECREF(__pyx_v_self->phi);
26799  __pyx_v_self->phi = __pyx_t_7;
26800  __pyx_t_7 = 0;
26801 
26802  /* "WaveTools.py":1472
26803  * try:
26804  * self.phi = np.array(phi)
26805  * if self.phi.shape[0] != self.fi.shape[0]: # <<<<<<<<<<<<<<
26806  * logEvent('ERROR! Wavetools.py: Phase array must have N elements')
26807  * sys.exit(1)
26808  */
26809  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->phi, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L4_error)
26810  __Pyx_GOTREF(__pyx_t_7);
26811  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1472, __pyx_L4_error)
26812  __Pyx_GOTREF(__pyx_t_3);
26813  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26814  __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_self->fi->dimensions[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L4_error)
26815  __Pyx_GOTREF(__pyx_t_7);
26816  __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1472, __pyx_L4_error)
26817  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26818  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26819  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 1472, __pyx_L4_error)
26820  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26821  if (__pyx_t_11) {
26822 
26823  /* "WaveTools.py":1473
26824  * self.phi = np.array(phi)
26825  * if self.phi.shape[0] != self.fi.shape[0]:
26826  * logEvent('ERROR! Wavetools.py: Phase array must have N elements') # <<<<<<<<<<<<<<
26827  * sys.exit(1)
26828  *
26829  */
26830  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1473, __pyx_L4_error)
26831  __Pyx_GOTREF(__pyx_t_7);
26832  __pyx_t_3 = NULL;
26833  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
26834  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
26835  if (likely(__pyx_t_3)) {
26836  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
26837  __Pyx_INCREF(__pyx_t_3);
26838  __Pyx_INCREF(function);
26839  __Pyx_DECREF_SET(__pyx_t_7, function);
26840  }
26841  }
26842  __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_3, __pyx_kp_s_ERROR_Wavetools_py_Phase_array_m) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_ERROR_Wavetools_py_Phase_array_m);
26843  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26844  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1473, __pyx_L4_error)
26845  __Pyx_GOTREF(__pyx_t_6);
26846  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26847  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26848 
26849  /* "WaveTools.py":1474
26850  * if self.phi.shape[0] != self.fi.shape[0]:
26851  * logEvent('ERROR! Wavetools.py: Phase array must have N elements')
26852  * sys.exit(1) # <<<<<<<<<<<<<<
26853  *
26854  * except:
26855  */
26856  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1474, __pyx_L4_error)
26857  __Pyx_GOTREF(__pyx_t_7);
26858  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1474, __pyx_L4_error)
26859  __Pyx_GOTREF(__pyx_t_3);
26860  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26861  __pyx_t_7 = NULL;
26862  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
26863  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
26864  if (likely(__pyx_t_7)) {
26865  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
26866  __Pyx_INCREF(__pyx_t_7);
26867  __Pyx_INCREF(function);
26868  __Pyx_DECREF_SET(__pyx_t_3, function);
26869  }
26870  }
26871  __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_1);
26872  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26873  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1474, __pyx_L4_error)
26874  __Pyx_GOTREF(__pyx_t_6);
26875  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26876  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26877 
26878  /* "WaveTools.py":1472
26879  * try:
26880  * self.phi = np.array(phi)
26881  * if self.phi.shape[0] != self.fi.shape[0]: # <<<<<<<<<<<<<<
26882  * logEvent('ERROR! Wavetools.py: Phase array must have N elements')
26883  * sys.exit(1)
26884  */
26885  }
26886 
26887  /* "WaveTools.py":1470
26888  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves')
26889  * else:
26890  * try: # <<<<<<<<<<<<<<
26891  * self.phi = np.array(phi)
26892  * if self.phi.shape[0] != self.fi.shape[0]:
26893  */
26894  }
26895  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
26896  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
26897  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
26898  goto __pyx_L9_try_end;
26899  __pyx_L4_error:;
26900  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26901  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
26902  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
26903  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26904  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26905  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
26906 
26907  /* "WaveTools.py":1476
26908  * sys.exit(1)
26909  *
26910  * except: # <<<<<<<<<<<<<<
26911  * logEvent('ERROR! Wavetools.py: phi argument must be an array with N elements')
26912  * sys.exit(1)
26913  */
26914  /*except:*/ {
26915  __Pyx_AddTraceback("WaveTools.RandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
26916  if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_7) < 0) __PYX_ERR(0, 1476, __pyx_L6_except_error)
26917  __Pyx_GOTREF(__pyx_t_6);
26918  __Pyx_GOTREF(__pyx_t_3);
26919  __Pyx_GOTREF(__pyx_t_7);
26920 
26921  /* "WaveTools.py":1477
26922  *
26923  * except:
26924  * logEvent('ERROR! Wavetools.py: phi argument must be an array with N elements') # <<<<<<<<<<<<<<
26925  * sys.exit(1)
26926  *
26927  */
26928  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1477, __pyx_L6_except_error)
26929  __Pyx_GOTREF(__pyx_t_9);
26930  __pyx_t_4 = NULL;
26931  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
26932  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
26933  if (likely(__pyx_t_4)) {
26934  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
26935  __Pyx_INCREF(__pyx_t_4);
26936  __Pyx_INCREF(function);
26937  __Pyx_DECREF_SET(__pyx_t_9, function);
26938  }
26939  }
26940  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_4, __pyx_kp_s_ERROR_Wavetools_py_phi_argument) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_kp_s_ERROR_Wavetools_py_phi_argument);
26941  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26942  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L6_except_error)
26943  __Pyx_GOTREF(__pyx_t_2);
26944  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26945  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26946 
26947  /* "WaveTools.py":1478
26948  * except:
26949  * logEvent('ERROR! Wavetools.py: phi argument must be an array with N elements')
26950  * sys.exit(1) # <<<<<<<<<<<<<<
26951  *
26952  * #ai = np.sqrt((Si_J[1:]+Si_J[:-1])*(fi[1:]-fi[:-1]))
26953  */
26954  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sys); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1478, __pyx_L6_except_error)
26955  __Pyx_GOTREF(__pyx_t_9);
26956  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L6_except_error)
26957  __Pyx_GOTREF(__pyx_t_4);
26958  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
26959  __pyx_t_9 = NULL;
26960  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
26961  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
26962  if (likely(__pyx_t_9)) {
26963  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
26964  __Pyx_INCREF(__pyx_t_9);
26965  __Pyx_INCREF(function);
26966  __Pyx_DECREF_SET(__pyx_t_4, function);
26967  }
26968  }
26969  __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_1);
26970  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
26971  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1478, __pyx_L6_except_error)
26972  __Pyx_GOTREF(__pyx_t_2);
26973  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26974  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26975  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
26976  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
26977  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
26978  goto __pyx_L5_exception_handled;
26979  }
26980  __pyx_L6_except_error:;
26981 
26982  /* "WaveTools.py":1470
26983  * logEvent('INFO Wavetools.py: No phase array is given. Assigning random phases. Outputing the phasing of the random waves')
26984  * else:
26985  * try: # <<<<<<<<<<<<<<
26986  * self.phi = np.array(phi)
26987  * if self.phi.shape[0] != self.fi.shape[0]:
26988  */
26989  __Pyx_XGIVEREF(__pyx_t_12);
26990  __Pyx_XGIVEREF(__pyx_t_13);
26991  __Pyx_XGIVEREF(__pyx_t_14);
26992  __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
26993  goto __pyx_L1_error;
26994  __pyx_L5_exception_handled:;
26995  __Pyx_XGIVEREF(__pyx_t_12);
26996  __Pyx_XGIVEREF(__pyx_t_13);
26997  __Pyx_XGIVEREF(__pyx_t_14);
26998  __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
26999  __pyx_L9_try_end:;
27000  }
27001  }
27002  __pyx_L3:;
27003 
27004  /* "WaveTools.py":1481
27005  *
27006  * #ai = np.sqrt((Si_J[1:]+Si_J[:-1])*(fi[1:]-fi[:-1]))
27007  * fim = reduceToIntervals(self.fi,self.df) # <<<<<<<<<<<<<<
27008  * self.fim = fim
27009  * if (spectral_params is None):
27010  */
27011  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_reduceToIntervals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error)
27012  __Pyx_GOTREF(__pyx_t_3);
27013  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->df); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1481, __pyx_L1_error)
27014  __Pyx_GOTREF(__pyx_t_6);
27015  __pyx_t_2 = NULL;
27016  __pyx_t_5 = 0;
27017  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27018  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
27019  if (likely(__pyx_t_2)) {
27020  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27021  __Pyx_INCREF(__pyx_t_2);
27022  __Pyx_INCREF(function);
27023  __Pyx_DECREF_SET(__pyx_t_3, function);
27024  __pyx_t_5 = 1;
27025  }
27026  }
27027  #if CYTHON_FAST_PYCALL
27028  if (PyFunction_Check(__pyx_t_3)) {
27029  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->fi), __pyx_t_6};
27030  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1481, __pyx_L1_error)
27031  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27032  __Pyx_GOTREF(__pyx_t_7);
27033  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27034  } else
27035  #endif
27036  #if CYTHON_FAST_PYCCALL
27037  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
27038  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->fi), __pyx_t_6};
27039  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1481, __pyx_L1_error)
27040  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27041  __Pyx_GOTREF(__pyx_t_7);
27042  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27043  } else
27044  #endif
27045  {
27046  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error)
27047  __Pyx_GOTREF(__pyx_t_4);
27048  if (__pyx_t_2) {
27049  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
27050  }
27051  __Pyx_INCREF(((PyObject *)__pyx_v_self->fi));
27052  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->fi));
27053  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_self->fi));
27054  __Pyx_GIVEREF(__pyx_t_6);
27055  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_6);
27056  __pyx_t_6 = 0;
27057  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1481, __pyx_L1_error)
27058  __Pyx_GOTREF(__pyx_t_7);
27059  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27060  }
27061  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27062  __pyx_v_fim = __pyx_t_7;
27063  __pyx_t_7 = 0;
27064 
27065  /* "WaveTools.py":1482
27066  * #ai = np.sqrt((Si_J[1:]+Si_J[:-1])*(fi[1:]-fi[:-1]))
27067  * fim = reduceToIntervals(self.fi,self.df)
27068  * self.fim = fim # <<<<<<<<<<<<<<
27069  * if (spectral_params is None):
27070  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
27071  */
27072  if (!(likely(((__pyx_v_fim) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_fim, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1482, __pyx_L1_error)
27073  __pyx_t_7 = __pyx_v_fim;
27074  __Pyx_INCREF(__pyx_t_7);
27075  __Pyx_GIVEREF(__pyx_t_7);
27076  __Pyx_GOTREF(__pyx_v_self->fim);
27077  __Pyx_DECREF(((PyObject *)__pyx_v_self->fim));
27078  __pyx_v_self->fim = ((PyArrayObject *)__pyx_t_7);
27079  __pyx_t_7 = 0;
27080 
27081  /* "WaveTools.py":1483
27082  * fim = reduceToIntervals(self.fi,self.df)
27083  * self.fim = fim
27084  * if (spectral_params is None): # <<<<<<<<<<<<<<
27085  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
27086  * else:
27087  */
27088  __pyx_t_11 = (__pyx_v_spectral_params == Py_None);
27089  __pyx_t_10 = (__pyx_t_11 != 0);
27090  if (__pyx_t_10) {
27091 
27092  /* "WaveTools.py":1484
27093  * self.fim = fim
27094  * if (spectral_params is None):
27095  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs) # <<<<<<<<<<<<<<
27096  * else:
27097  * try:
27098  */
27099  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->fp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1484, __pyx_L1_error)
27100  __Pyx_GOTREF(__pyx_t_3);
27101  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->Hs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1484, __pyx_L1_error)
27102  __Pyx_GOTREF(__pyx_t_4);
27103  __Pyx_INCREF(__pyx_v_spec_fun);
27104  __pyx_t_6 = __pyx_v_spec_fun; __pyx_t_2 = NULL;
27105  __pyx_t_5 = 0;
27106  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
27107  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
27108  if (likely(__pyx_t_2)) {
27109  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27110  __Pyx_INCREF(__pyx_t_2);
27111  __Pyx_INCREF(function);
27112  __Pyx_DECREF_SET(__pyx_t_6, function);
27113  __pyx_t_5 = 1;
27114  }
27115  }
27116  #if CYTHON_FAST_PYCALL
27117  if (PyFunction_Check(__pyx_t_6)) {
27118  PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_fim, __pyx_t_3, __pyx_t_4};
27119  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1484, __pyx_L1_error)
27120  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27121  __Pyx_GOTREF(__pyx_t_7);
27122  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27123  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27124  } else
27125  #endif
27126  #if CYTHON_FAST_PYCCALL
27127  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
27128  PyObject *__pyx_temp[4] = {__pyx_t_2, __pyx_v_fim, __pyx_t_3, __pyx_t_4};
27129  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1484, __pyx_L1_error)
27130  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27131  __Pyx_GOTREF(__pyx_t_7);
27132  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27133  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27134  } else
27135  #endif
27136  {
27137  __pyx_t_9 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1484, __pyx_L1_error)
27138  __Pyx_GOTREF(__pyx_t_9);
27139  if (__pyx_t_2) {
27140  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
27141  }
27142  __Pyx_INCREF(__pyx_v_fim);
27143  __Pyx_GIVEREF(__pyx_v_fim);
27144  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_v_fim);
27145  __Pyx_GIVEREF(__pyx_t_3);
27146  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_3);
27147  __Pyx_GIVEREF(__pyx_t_4);
27148  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_5, __pyx_t_4);
27149  __pyx_t_3 = 0;
27150  __pyx_t_4 = 0;
27151  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1484, __pyx_L1_error)
27152  __Pyx_GOTREF(__pyx_t_7);
27153  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27154  }
27155  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27156  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1484, __pyx_L1_error)
27157  __Pyx_GIVEREF(__pyx_t_7);
27158  __Pyx_GOTREF(__pyx_v_self->Si_Jm);
27159  __Pyx_DECREF(((PyObject *)__pyx_v_self->Si_Jm));
27160  __pyx_v_self->Si_Jm = ((PyArrayObject *)__pyx_t_7);
27161  __pyx_t_7 = 0;
27162 
27163  /* "WaveTools.py":1483
27164  * fim = reduceToIntervals(self.fi,self.df)
27165  * self.fim = fim
27166  * if (spectral_params is None): # <<<<<<<<<<<<<<
27167  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
27168  * else:
27169  */
27170  goto __pyx_L13;
27171  }
27172 
27173  /* "WaveTools.py":1486
27174  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
27175  * else:
27176  * try: # <<<<<<<<<<<<<<
27177  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
27178  * except:
27179  */
27180  /*else*/ {
27181  {
27182  __Pyx_PyThreadState_declare
27183  __Pyx_PyThreadState_assign
27184  __Pyx_ExceptionSave(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
27185  __Pyx_XGOTREF(__pyx_t_14);
27186  __Pyx_XGOTREF(__pyx_t_13);
27187  __Pyx_XGOTREF(__pyx_t_12);
27188  /*try:*/ {
27189 
27190  /* "WaveTools.py":1487
27191  * else:
27192  * try:
27193  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params) # <<<<<<<<<<<<<<
27194  * except:
27195  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName)
27196  */
27197  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->fp); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1487, __pyx_L14_error)
27198  __Pyx_GOTREF(__pyx_t_7);
27199  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->Hs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1487, __pyx_L14_error)
27200  __Pyx_GOTREF(__pyx_t_6);
27201  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1487, __pyx_L14_error)
27202  __Pyx_GOTREF(__pyx_t_9);
27203  __Pyx_INCREF(__pyx_v_fim);
27204  __Pyx_GIVEREF(__pyx_v_fim);
27205  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_fim);
27206  __Pyx_GIVEREF(__pyx_t_7);
27207  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
27208  __Pyx_GIVEREF(__pyx_t_6);
27209  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6);
27210  __pyx_t_7 = 0;
27211  __pyx_t_6 = 0;
27212  if (unlikely(__pyx_v_spectral_params == Py_None)) {
27213  PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
27214  __PYX_ERR(0, 1487, __pyx_L14_error)
27215  }
27216  if (likely(PyDict_CheckExact(__pyx_v_spectral_params))) {
27217  __pyx_t_6 = PyDict_Copy(__pyx_v_spectral_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1487, __pyx_L14_error)
27218  __Pyx_GOTREF(__pyx_t_6);
27219  } else {
27220  __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_spectral_params, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1487, __pyx_L14_error)
27221  __Pyx_GOTREF(__pyx_t_6);
27222  }
27223  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_spec_fun, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1487, __pyx_L14_error)
27224  __Pyx_GOTREF(__pyx_t_7);
27225  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27226  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27227  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1487, __pyx_L14_error)
27228  __Pyx_GIVEREF(__pyx_t_7);
27229  __Pyx_GOTREF(__pyx_v_self->Si_Jm);
27230  __Pyx_DECREF(((PyObject *)__pyx_v_self->Si_Jm));
27231  __pyx_v_self->Si_Jm = ((PyArrayObject *)__pyx_t_7);
27232  __pyx_t_7 = 0;
27233 
27234  /* "WaveTools.py":1486
27235  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
27236  * else:
27237  * try: # <<<<<<<<<<<<<<
27238  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
27239  * except:
27240  */
27241  }
27242  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
27243  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
27244  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
27245  goto __pyx_L19_try_end;
27246  __pyx_L14_error:;
27247  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27248  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27249  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27250  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27251  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27252  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27253 
27254  /* "WaveTools.py":1488
27255  * try:
27256  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
27257  * except: # <<<<<<<<<<<<<<
27258  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName)
27259  * sys.exit(1)
27260  */
27261  /*except:*/ {
27262  __Pyx_AddTraceback("WaveTools.RandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
27263  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 1488, __pyx_L16_except_error)
27264  __Pyx_GOTREF(__pyx_t_7);
27265  __Pyx_GOTREF(__pyx_t_6);
27266  __Pyx_GOTREF(__pyx_t_9);
27267 
27268  /* "WaveTools.py":1489
27269  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
27270  * except:
27271  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName) # <<<<<<<<<<<<<<
27272  * sys.exit(1)
27273  *
27274  */
27275  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1489, __pyx_L16_except_error)
27276  __Pyx_GOTREF(__pyx_t_3);
27277  __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ERROR_Wavetools_py_Additional_sp, __pyx_v_spectName); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L16_except_error)
27278  __Pyx_GOTREF(__pyx_t_2);
27279  __pyx_t_15 = NULL;
27280  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27281  __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_3);
27282  if (likely(__pyx_t_15)) {
27283  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27284  __Pyx_INCREF(__pyx_t_15);
27285  __Pyx_INCREF(function);
27286  __Pyx_DECREF_SET(__pyx_t_3, function);
27287  }
27288  }
27289  __pyx_t_4 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_15, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
27290  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
27291  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27292  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L16_except_error)
27293  __Pyx_GOTREF(__pyx_t_4);
27294  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27295  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27296 
27297  /* "WaveTools.py":1490
27298  * except:
27299  * logEvent('ERROR! Wavetools.py: Additional spectral parameters are not valid for the %s spectrum' %spectName)
27300  * sys.exit(1) # <<<<<<<<<<<<<<
27301  *
27302  * self.tanhF = np.zeros(N,"d")
27303  */
27304  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1490, __pyx_L16_except_error)
27305  __Pyx_GOTREF(__pyx_t_3);
27306  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L16_except_error)
27307  __Pyx_GOTREF(__pyx_t_2);
27308  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27309  __pyx_t_3 = NULL;
27310  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27311  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
27312  if (likely(__pyx_t_3)) {
27313  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27314  __Pyx_INCREF(__pyx_t_3);
27315  __Pyx_INCREF(function);
27316  __Pyx_DECREF_SET(__pyx_t_2, function);
27317  }
27318  }
27319  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
27320  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27321  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L16_except_error)
27322  __Pyx_GOTREF(__pyx_t_4);
27323  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27324  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27325  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27326  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27327  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27328  goto __pyx_L15_exception_handled;
27329  }
27330  __pyx_L16_except_error:;
27331 
27332  /* "WaveTools.py":1486
27333  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs)
27334  * else:
27335  * try: # <<<<<<<<<<<<<<
27336  * self.Si_Jm = spec_fun(fim,self.fp,self.Hs,**spectral_params)
27337  * except:
27338  */
27339  __Pyx_XGIVEREF(__pyx_t_14);
27340  __Pyx_XGIVEREF(__pyx_t_13);
27341  __Pyx_XGIVEREF(__pyx_t_12);
27342  __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
27343  goto __pyx_L1_error;
27344  __pyx_L15_exception_handled:;
27345  __Pyx_XGIVEREF(__pyx_t_14);
27346  __Pyx_XGIVEREF(__pyx_t_13);
27347  __Pyx_XGIVEREF(__pyx_t_12);
27348  __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_13, __pyx_t_12);
27349  __pyx_L19_try_end:;
27350  }
27351  }
27352  __pyx_L13:;
27353 
27354  /* "WaveTools.py":1492
27355  * sys.exit(1)
27356  *
27357  * self.tanhF = np.zeros(N,"d") # <<<<<<<<<<<<<<
27358  * for ii in range(self.N):
27359  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
27360  */
27361  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1492, __pyx_L1_error)
27362  __Pyx_GOTREF(__pyx_t_6);
27363  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1492, __pyx_L1_error)
27364  __Pyx_GOTREF(__pyx_t_7);
27365  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27366  __pyx_t_6 = NULL;
27367  __pyx_t_5 = 0;
27368  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
27369  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
27370  if (likely(__pyx_t_6)) {
27371  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
27372  __Pyx_INCREF(__pyx_t_6);
27373  __Pyx_INCREF(function);
27374  __Pyx_DECREF_SET(__pyx_t_7, function);
27375  __pyx_t_5 = 1;
27376  }
27377  }
27378  #if CYTHON_FAST_PYCALL
27379  if (PyFunction_Check(__pyx_t_7)) {
27380  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_N, __pyx_n_s_d};
27381  __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1492, __pyx_L1_error)
27382  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27383  __Pyx_GOTREF(__pyx_t_9);
27384  } else
27385  #endif
27386  #if CYTHON_FAST_PYCCALL
27387  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
27388  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_N, __pyx_n_s_d};
27389  __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1492, __pyx_L1_error)
27390  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27391  __Pyx_GOTREF(__pyx_t_9);
27392  } else
27393  #endif
27394  {
27395  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1492, __pyx_L1_error)
27396  __Pyx_GOTREF(__pyx_t_4);
27397  if (__pyx_t_6) {
27398  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
27399  }
27400  __Pyx_INCREF(__pyx_v_N);
27401  __Pyx_GIVEREF(__pyx_v_N);
27402  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_N);
27403  __Pyx_INCREF(__pyx_n_s_d);
27404  __Pyx_GIVEREF(__pyx_n_s_d);
27405  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_n_s_d);
27406  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1492, __pyx_L1_error)
27407  __Pyx_GOTREF(__pyx_t_9);
27408  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27409  }
27410  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27411  if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1492, __pyx_L1_error)
27412  __Pyx_GIVEREF(__pyx_t_9);
27413  __Pyx_GOTREF(__pyx_v_self->tanhF);
27414  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
27415  __pyx_v_self->tanhF = ((PyArrayObject *)__pyx_t_9);
27416  __pyx_t_9 = 0;
27417 
27418  /* "WaveTools.py":1493
27419  *
27420  * self.tanhF = np.zeros(N,"d")
27421  * for ii in range(self.N): # <<<<<<<<<<<<<<
27422  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
27423  *
27424  */
27425  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1493, __pyx_L1_error)
27426  __Pyx_GOTREF(__pyx_t_7);
27427  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error)
27428  __Pyx_GOTREF(__pyx_t_4);
27429  __pyx_t_6 = NULL;
27430  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
27431  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
27432  if (likely(__pyx_t_6)) {
27433  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
27434  __Pyx_INCREF(__pyx_t_6);
27435  __Pyx_INCREF(function);
27436  __Pyx_DECREF_SET(__pyx_t_7, function);
27437  }
27438  }
27439  __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4);
27440  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27441  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27442  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1493, __pyx_L1_error)
27443  __Pyx_GOTREF(__pyx_t_9);
27444  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27445  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
27446  __pyx_t_7 = __pyx_t_9; __Pyx_INCREF(__pyx_t_7); __pyx_t_16 = 0;
27447  __pyx_t_17 = NULL;
27448  } else {
27449  __pyx_t_16 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1493, __pyx_L1_error)
27450  __Pyx_GOTREF(__pyx_t_7);
27451  __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1493, __pyx_L1_error)
27452  }
27453  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27454  for (;;) {
27455  if (likely(!__pyx_t_17)) {
27456  if (likely(PyList_CheckExact(__pyx_t_7))) {
27457  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_7)) break;
27458  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27459  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1493, __pyx_L1_error)
27460  #else
27461  __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1493, __pyx_L1_error)
27462  __Pyx_GOTREF(__pyx_t_9);
27463  #endif
27464  } else {
27465  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
27466  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27467  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1493, __pyx_L1_error)
27468  #else
27469  __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1493, __pyx_L1_error)
27470  __Pyx_GOTREF(__pyx_t_9);
27471  #endif
27472  }
27473  } else {
27474  __pyx_t_9 = __pyx_t_17(__pyx_t_7);
27475  if (unlikely(!__pyx_t_9)) {
27476  PyObject* exc_type = PyErr_Occurred();
27477  if (exc_type) {
27478  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27479  else __PYX_ERR(0, 1493, __pyx_L1_error)
27480  }
27481  break;
27482  }
27483  __Pyx_GOTREF(__pyx_t_9);
27484  }
27485  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_9);
27486  __pyx_t_9 = 0;
27487 
27488  /* "WaveTools.py":1494
27489  * self.tanhF = np.zeros(N,"d")
27490  * for ii in range(self.N):
27491  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) ) # <<<<<<<<<<<<<<
27492  *
27493  *
27494  */
27495  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error)
27496  __Pyx_GOTREF(__pyx_t_4);
27497  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tanh); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
27498  __Pyx_GOTREF(__pyx_t_6);
27499  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27500  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error)
27501  __Pyx_GOTREF(__pyx_t_4);
27502  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error)
27503  __Pyx_GOTREF(__pyx_t_2);
27504  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error)
27505  __Pyx_GOTREF(__pyx_t_3);
27506  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27507  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27508  __pyx_t_2 = NULL;
27509  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
27510  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
27511  if (likely(__pyx_t_2)) {
27512  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27513  __Pyx_INCREF(__pyx_t_2);
27514  __Pyx_INCREF(function);
27515  __Pyx_DECREF_SET(__pyx_t_6, function);
27516  }
27517  }
27518  __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
27519  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27520  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27521  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1494, __pyx_L1_error)
27522  __Pyx_GOTREF(__pyx_t_9);
27523  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27524  __pyx_t_6 = __Pyx_PyNumber_Float(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1494, __pyx_L1_error)
27525  __Pyx_GOTREF(__pyx_t_6);
27526  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27527  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->tanhF), __pyx_v_ii, __pyx_t_6) < 0)) __PYX_ERR(0, 1494, __pyx_L1_error)
27528  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27529 
27530  /* "WaveTools.py":1493
27531  *
27532  * self.tanhF = np.zeros(N,"d")
27533  * for ii in range(self.N): # <<<<<<<<<<<<<<
27534  * self.tanhF[ii] = float(np.tanh(self.ki[ii]*self.depth) )
27535  *
27536  */
27537  }
27538  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27539 
27540  /* "WaveTools.py":1497
27541  *
27542  *
27543  * self.ai = np.sqrt(2.*returnRectangles(self.Si_Jm,fim)) # <<<<<<<<<<<<<<
27544  * self.kDir = np.zeros((len(self.ki),3),)
27545  * for ii in range(3):
27546  */
27547  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
27548  __Pyx_GOTREF(__pyx_t_6);
27549  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1497, __pyx_L1_error)
27550  __Pyx_GOTREF(__pyx_t_9);
27551  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27552  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_returnRectangles); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
27553  __Pyx_GOTREF(__pyx_t_3);
27554  __pyx_t_2 = NULL;
27555  __pyx_t_5 = 0;
27556  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27557  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
27558  if (likely(__pyx_t_2)) {
27559  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27560  __Pyx_INCREF(__pyx_t_2);
27561  __Pyx_INCREF(function);
27562  __Pyx_DECREF_SET(__pyx_t_3, function);
27563  __pyx_t_5 = 1;
27564  }
27565  }
27566  #if CYTHON_FAST_PYCALL
27567  if (PyFunction_Check(__pyx_t_3)) {
27568  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->Si_Jm), __pyx_v_fim};
27569  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
27570  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27571  __Pyx_GOTREF(__pyx_t_6);
27572  } else
27573  #endif
27574  #if CYTHON_FAST_PYCCALL
27575  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
27576  PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self->Si_Jm), __pyx_v_fim};
27577  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
27578  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
27579  __Pyx_GOTREF(__pyx_t_6);
27580  } else
27581  #endif
27582  {
27583  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L1_error)
27584  __Pyx_GOTREF(__pyx_t_4);
27585  if (__pyx_t_2) {
27586  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
27587  }
27588  __Pyx_INCREF(((PyObject *)__pyx_v_self->Si_Jm));
27589  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->Si_Jm));
27590  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, ((PyObject *)__pyx_v_self->Si_Jm));
27591  __Pyx_INCREF(__pyx_v_fim);
27592  __Pyx_GIVEREF(__pyx_v_fim);
27593  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_fim);
27594  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1497, __pyx_L1_error)
27595  __Pyx_GOTREF(__pyx_t_6);
27596  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27597  }
27598  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27599  __pyx_t_3 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error)
27600  __Pyx_GOTREF(__pyx_t_3);
27601  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27602  __pyx_t_6 = NULL;
27603  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
27604  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
27605  if (likely(__pyx_t_6)) {
27606  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
27607  __Pyx_INCREF(__pyx_t_6);
27608  __Pyx_INCREF(function);
27609  __Pyx_DECREF_SET(__pyx_t_9, function);
27610  }
27611  }
27612  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3);
27613  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27614  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27615  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1497, __pyx_L1_error)
27616  __Pyx_GOTREF(__pyx_t_7);
27617  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27618  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1497, __pyx_L1_error)
27619  __Pyx_GIVEREF(__pyx_t_7);
27620  __Pyx_GOTREF(__pyx_v_self->ai);
27621  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
27622  __pyx_v_self->ai = ((PyArrayObject *)__pyx_t_7);
27623  __pyx_t_7 = 0;
27624 
27625  /* "WaveTools.py":1498
27626  *
27627  * self.ai = np.sqrt(2.*returnRectangles(self.Si_Jm,fim))
27628  * self.kDir = np.zeros((len(self.ki),3),) # <<<<<<<<<<<<<<
27629  * for ii in range(3):
27630  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
27631  */
27632  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1498, __pyx_L1_error)
27633  __Pyx_GOTREF(__pyx_t_9);
27634  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
27635  __Pyx_GOTREF(__pyx_t_3);
27636  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27637  __pyx_t_9 = ((PyObject *)__pyx_v_self->ki);
27638  __Pyx_INCREF(__pyx_t_9);
27639  __pyx_t_16 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1498, __pyx_L1_error)
27640  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27641  __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1498, __pyx_L1_error)
27642  __Pyx_GOTREF(__pyx_t_9);
27643  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1498, __pyx_L1_error)
27644  __Pyx_GOTREF(__pyx_t_6);
27645  __Pyx_GIVEREF(__pyx_t_9);
27646  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
27647  __Pyx_INCREF(__pyx_int_3);
27648  __Pyx_GIVEREF(__pyx_int_3);
27649  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3);
27650  __pyx_t_9 = 0;
27651  __pyx_t_9 = NULL;
27652  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27653  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
27654  if (likely(__pyx_t_9)) {
27655  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27656  __Pyx_INCREF(__pyx_t_9);
27657  __Pyx_INCREF(function);
27658  __Pyx_DECREF_SET(__pyx_t_3, function);
27659  }
27660  }
27661  __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
27662  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27663  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27664  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error)
27665  __Pyx_GOTREF(__pyx_t_7);
27666  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27667  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1498, __pyx_L1_error)
27668  __Pyx_GIVEREF(__pyx_t_7);
27669  __Pyx_GOTREF(__pyx_v_self->kDir);
27670  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
27671  __pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_7);
27672  __pyx_t_7 = 0;
27673 
27674  /* "WaveTools.py":1499
27675  * self.ai = np.sqrt(2.*returnRectangles(self.Si_Jm,fim))
27676  * self.kDir = np.zeros((len(self.ki),3),)
27677  * for ii in range(3): # <<<<<<<<<<<<<<
27678  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
27679  * if(self.N > 10000):
27680  */
27681  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
27682  __Pyx_GOTREF(__pyx_t_3);
27683  __pyx_t_6 = NULL;
27684  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
27685  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
27686  if (likely(__pyx_t_6)) {
27687  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
27688  __Pyx_INCREF(__pyx_t_6);
27689  __Pyx_INCREF(function);
27690  __Pyx_DECREF_SET(__pyx_t_3, function);
27691  }
27692  }
27693  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
27694  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
27695  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1499, __pyx_L1_error)
27696  __Pyx_GOTREF(__pyx_t_7);
27697  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27698  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
27699  __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3); __pyx_t_16 = 0;
27700  __pyx_t_17 = NULL;
27701  } else {
27702  __pyx_t_16 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error)
27703  __Pyx_GOTREF(__pyx_t_3);
27704  __pyx_t_17 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1499, __pyx_L1_error)
27705  }
27706  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27707  for (;;) {
27708  if (likely(!__pyx_t_17)) {
27709  if (likely(PyList_CheckExact(__pyx_t_3))) {
27710  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_3)) break;
27711  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27712  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_7); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1499, __pyx_L1_error)
27713  #else
27714  __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1499, __pyx_L1_error)
27715  __Pyx_GOTREF(__pyx_t_7);
27716  #endif
27717  } else {
27718  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
27719  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27720  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_16); __Pyx_INCREF(__pyx_t_7); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1499, __pyx_L1_error)
27721  #else
27722  __pyx_t_7 = PySequence_ITEM(__pyx_t_3, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1499, __pyx_L1_error)
27723  __Pyx_GOTREF(__pyx_t_7);
27724  #endif
27725  }
27726  } else {
27727  __pyx_t_7 = __pyx_t_17(__pyx_t_3);
27728  if (unlikely(!__pyx_t_7)) {
27729  PyObject* exc_type = PyErr_Occurred();
27730  if (exc_type) {
27731  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27732  else __PYX_ERR(0, 1499, __pyx_L1_error)
27733  }
27734  break;
27735  }
27736  __Pyx_GOTREF(__pyx_t_7);
27737  }
27738  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_7);
27739  __pyx_t_7 = 0;
27740 
27741  /* "WaveTools.py":1500
27742  * self.kDir = np.zeros((len(self.ki),3),)
27743  * for ii in range(3):
27744  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii] # <<<<<<<<<<<<<<
27745  * if(self.N > 10000):
27746  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
27747  */
27748  __pyx_t_7 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->ki), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L1_error)
27749  __Pyx_GOTREF(__pyx_t_7);
27750  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDir), __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1500, __pyx_L1_error)
27751  __Pyx_GOTREF(__pyx_t_6);
27752  __pyx_t_9 = PyNumber_Multiply(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1500, __pyx_L1_error)
27753  __Pyx_GOTREF(__pyx_t_9);
27754  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27755  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27756  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1500, __pyx_L1_error)
27757  __Pyx_GOTREF(__pyx_t_6);
27758  __Pyx_INCREF(__pyx_slice__4);
27759  __Pyx_GIVEREF(__pyx_slice__4);
27760  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4);
27761  __Pyx_INCREF(__pyx_v_ii);
27762  __Pyx_GIVEREF(__pyx_v_ii);
27763  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ii);
27764  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_6, __pyx_t_9) < 0)) __PYX_ERR(0, 1500, __pyx_L1_error)
27765  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27766  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27767 
27768  /* "WaveTools.py":1499
27769  * self.ai = np.sqrt(2.*returnRectangles(self.Si_Jm,fim))
27770  * self.kDir = np.zeros((len(self.ki),3),)
27771  * for ii in range(3): # <<<<<<<<<<<<<<
27772  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
27773  * if(self.N > 10000):
27774  */
27775  }
27776  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27777 
27778  /* "WaveTools.py":1501
27779  * for ii in range(3):
27780  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
27781  * if(self.N > 10000): # <<<<<<<<<<<<<<
27782  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
27783  *
27784  */
27785  __pyx_t_10 = ((__pyx_v_self->N > 0x2710) != 0);
27786  if (__pyx_t_10) {
27787 
27788  /* "WaveTools.py":1502
27789  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
27790  * if(self.N > 10000):
27791  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0) # <<<<<<<<<<<<<<
27792  *
27793  * #C++ declarations
27794  */
27795  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1502, __pyx_L1_error)
27796  __Pyx_GOTREF(__pyx_t_3);
27797  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1502, __pyx_L1_error)
27798  __Pyx_GOTREF(__pyx_t_9);
27799  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 1502, __pyx_L1_error)
27800  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1502, __pyx_L1_error)
27801  __Pyx_GOTREF(__pyx_t_6);
27802  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27803  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27804  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27805 
27806  /* "WaveTools.py":1501
27807  * for ii in range(3):
27808  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
27809  * if(self.N > 10000): # <<<<<<<<<<<<<<
27810  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0)
27811  *
27812  */
27813  }
27814 
27815  /* "WaveTools.py":1505
27816  *
27817  * #C++ declarations
27818  * for ij in range(3): # <<<<<<<<<<<<<<
27819  * self.waveDir_c[ij] = self.waveDir[ij]
27820  * self.vDir_c[ij] = self.vDir[ij]
27821  */
27822  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_range); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1505, __pyx_L1_error)
27823  __Pyx_GOTREF(__pyx_t_9);
27824  __pyx_t_3 = NULL;
27825  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
27826  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
27827  if (likely(__pyx_t_3)) {
27828  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
27829  __Pyx_INCREF(__pyx_t_3);
27830  __Pyx_INCREF(function);
27831  __Pyx_DECREF_SET(__pyx_t_9, function);
27832  }
27833  }
27834  __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_int_3);
27835  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
27836  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1505, __pyx_L1_error)
27837  __Pyx_GOTREF(__pyx_t_6);
27838  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27839  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
27840  __pyx_t_9 = __pyx_t_6; __Pyx_INCREF(__pyx_t_9); __pyx_t_16 = 0;
27841  __pyx_t_17 = NULL;
27842  } else {
27843  __pyx_t_16 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1505, __pyx_L1_error)
27844  __Pyx_GOTREF(__pyx_t_9);
27845  __pyx_t_17 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1505, __pyx_L1_error)
27846  }
27847  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27848  for (;;) {
27849  if (likely(!__pyx_t_17)) {
27850  if (likely(PyList_CheckExact(__pyx_t_9))) {
27851  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_9)) break;
27852  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27853  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1505, __pyx_L1_error)
27854  #else
27855  __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1505, __pyx_L1_error)
27856  __Pyx_GOTREF(__pyx_t_6);
27857  #endif
27858  } else {
27859  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
27860  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27861  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1505, __pyx_L1_error)
27862  #else
27863  __pyx_t_6 = PySequence_ITEM(__pyx_t_9, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1505, __pyx_L1_error)
27864  __Pyx_GOTREF(__pyx_t_6);
27865  #endif
27866  }
27867  } else {
27868  __pyx_t_6 = __pyx_t_17(__pyx_t_9);
27869  if (unlikely(!__pyx_t_6)) {
27870  PyObject* exc_type = PyErr_Occurred();
27871  if (exc_type) {
27872  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
27873  else __PYX_ERR(0, 1505, __pyx_L1_error)
27874  }
27875  break;
27876  }
27877  __Pyx_GOTREF(__pyx_t_6);
27878  }
27879  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_6);
27880  __pyx_t_6 = 0;
27881 
27882  /* "WaveTools.py":1506
27883  * #C++ declarations
27884  * for ij in range(3):
27885  * self.waveDir_c[ij] = self.waveDir[ij] # <<<<<<<<<<<<<<
27886  * self.vDir_c[ij] = self.vDir[ij]
27887  * self.waveDir_ = self.waveDir_c
27888  */
27889  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDir), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1506, __pyx_L1_error)
27890  __Pyx_GOTREF(__pyx_t_6);
27891  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L1_error)
27892  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27893  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1506, __pyx_L1_error)
27894  (__pyx_v_self->waveDir_c[__pyx_t_18]) = __pyx_t_8;
27895 
27896  /* "WaveTools.py":1507
27897  * for ij in range(3):
27898  * self.waveDir_c[ij] = self.waveDir[ij]
27899  * self.vDir_c[ij] = self.vDir[ij] # <<<<<<<<<<<<<<
27900  * self.waveDir_ = self.waveDir_c
27901  * self.vDir_ = self.vDir_c
27902  */
27903  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->vDir), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1507, __pyx_L1_error)
27904  __Pyx_GOTREF(__pyx_t_6);
27905  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L1_error)
27906  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27907  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1507, __pyx_L1_error)
27908  (__pyx_v_self->vDir_c[__pyx_t_18]) = __pyx_t_8;
27909 
27910  /* "WaveTools.py":1505
27911  *
27912  * #C++ declarations
27913  * for ij in range(3): # <<<<<<<<<<<<<<
27914  * self.waveDir_c[ij] = self.waveDir[ij]
27915  * self.vDir_c[ij] = self.vDir[ij]
27916  */
27917  }
27918  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27919 
27920  /* "WaveTools.py":1508
27921  * self.waveDir_c[ij] = self.waveDir[ij]
27922  * self.vDir_c[ij] = self.vDir[ij]
27923  * self.waveDir_ = self.waveDir_c # <<<<<<<<<<<<<<
27924  * self.vDir_ = self.vDir_c
27925  *
27926  */
27927  __pyx_t_19 = __pyx_v_self->waveDir_c;
27928  __pyx_v_self->waveDir_ = __pyx_t_19;
27929 
27930  /* "WaveTools.py":1509
27931  * self.vDir_c[ij] = self.vDir[ij]
27932  * self.waveDir_ = self.waveDir_c
27933  * self.vDir_ = self.vDir_c # <<<<<<<<<<<<<<
27934  *
27935  *
27936  */
27937  __pyx_t_19 = __pyx_v_self->vDir_c;
27938  __pyx_v_self->vDir_ = __pyx_t_19;
27939 
27940  /* "WaveTools.py":1512
27941  *
27942  *
27943  * for ij in range(self.N): # <<<<<<<<<<<<<<
27944  * for kk in range(3):
27945  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
27946  */
27947  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1512, __pyx_L1_error)
27948  __Pyx_GOTREF(__pyx_t_6);
27949  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1512, __pyx_L1_error)
27950  __Pyx_GOTREF(__pyx_t_3);
27951  __pyx_t_7 = NULL;
27952  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
27953  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
27954  if (likely(__pyx_t_7)) {
27955  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
27956  __Pyx_INCREF(__pyx_t_7);
27957  __Pyx_INCREF(function);
27958  __Pyx_DECREF_SET(__pyx_t_6, function);
27959  }
27960  }
27961  __pyx_t_9 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3);
27962  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
27963  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27964  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1512, __pyx_L1_error)
27965  __Pyx_GOTREF(__pyx_t_9);
27966  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
27967  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
27968  __pyx_t_6 = __pyx_t_9; __Pyx_INCREF(__pyx_t_6); __pyx_t_16 = 0;
27969  __pyx_t_17 = NULL;
27970  } else {
27971  __pyx_t_16 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1512, __pyx_L1_error)
27972  __Pyx_GOTREF(__pyx_t_6);
27973  __pyx_t_17 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1512, __pyx_L1_error)
27974  }
27975  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
27976  for (;;) {
27977  if (likely(!__pyx_t_17)) {
27978  if (likely(PyList_CheckExact(__pyx_t_6))) {
27979  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_6)) break;
27980  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27981  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1512, __pyx_L1_error)
27982  #else
27983  __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1512, __pyx_L1_error)
27984  __Pyx_GOTREF(__pyx_t_9);
27985  #endif
27986  } else {
27987  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
27988  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27989  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_9); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 1512, __pyx_L1_error)
27990  #else
27991  __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1512, __pyx_L1_error)
27992  __Pyx_GOTREF(__pyx_t_9);
27993  #endif
27994  }
27995  } else {
27996  __pyx_t_9 = __pyx_t_17(__pyx_t_6);
27997  if (unlikely(!__pyx_t_9)) {
27998  PyObject* exc_type = PyErr_Occurred();
27999  if (exc_type) {
28000  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
28001  else __PYX_ERR(0, 1512, __pyx_L1_error)
28002  }
28003  break;
28004  }
28005  __Pyx_GOTREF(__pyx_t_9);
28006  }
28007  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_9);
28008  __pyx_t_9 = 0;
28009 
28010  /* "WaveTools.py":1513
28011  *
28012  * for ij in range(self.N):
28013  * for kk in range(3): # <<<<<<<<<<<<<<
28014  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
28015  * self.omega_c[ij] = self.omega[ij]
28016  */
28017  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_range); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
28018  __Pyx_GOTREF(__pyx_t_3);
28019  __pyx_t_7 = NULL;
28020  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
28021  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
28022  if (likely(__pyx_t_7)) {
28023  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
28024  __Pyx_INCREF(__pyx_t_7);
28025  __Pyx_INCREF(function);
28026  __Pyx_DECREF_SET(__pyx_t_3, function);
28027  }
28028  }
28029  __pyx_t_9 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
28030  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
28031  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1513, __pyx_L1_error)
28032  __Pyx_GOTREF(__pyx_t_9);
28033  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28034  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
28035  __pyx_t_3 = __pyx_t_9; __Pyx_INCREF(__pyx_t_3); __pyx_t_18 = 0;
28036  __pyx_t_20 = NULL;
28037  } else {
28038  __pyx_t_18 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1513, __pyx_L1_error)
28039  __Pyx_GOTREF(__pyx_t_3);
28040  __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1513, __pyx_L1_error)
28041  }
28042  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28043  for (;;) {
28044  if (likely(!__pyx_t_20)) {
28045  if (likely(PyList_CheckExact(__pyx_t_3))) {
28046  if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_3)) break;
28047  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28048  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_18); __Pyx_INCREF(__pyx_t_9); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 1513, __pyx_L1_error)
28049  #else
28050  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1513, __pyx_L1_error)
28051  __Pyx_GOTREF(__pyx_t_9);
28052  #endif
28053  } else {
28054  if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
28055  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28056  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_18); __Pyx_INCREF(__pyx_t_9); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 1513, __pyx_L1_error)
28057  #else
28058  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1513, __pyx_L1_error)
28059  __Pyx_GOTREF(__pyx_t_9);
28060  #endif
28061  }
28062  } else {
28063  __pyx_t_9 = __pyx_t_20(__pyx_t_3);
28064  if (unlikely(!__pyx_t_9)) {
28065  PyObject* exc_type = PyErr_Occurred();
28066  if (exc_type) {
28067  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
28068  else __PYX_ERR(0, 1513, __pyx_L1_error)
28069  }
28070  break;
28071  }
28072  __Pyx_GOTREF(__pyx_t_9);
28073  }
28074  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_9);
28075  __pyx_t_9 = 0;
28076 
28077  /* "WaveTools.py":1514
28078  * for ij in range(self.N):
28079  * for kk in range(3):
28080  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk] # <<<<<<<<<<<<<<
28081  * self.omega_c[ij] = self.omega[ij]
28082  * self.ki_c[ij] =self.ki[ij]
28083  */
28084  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1514, __pyx_L1_error)
28085  __Pyx_GOTREF(__pyx_t_9);
28086  __Pyx_INCREF(__pyx_v_ij);
28087  __Pyx_GIVEREF(__pyx_v_ij);
28088  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ij);
28089  __Pyx_INCREF(__pyx_v_kk);
28090  __Pyx_GIVEREF(__pyx_v_kk);
28091  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_kk);
28092  __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error)
28093  __Pyx_GOTREF(__pyx_t_7);
28094  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28095  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
28096  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28097  __pyx_t_7 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error)
28098  __Pyx_GOTREF(__pyx_t_7);
28099  __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_v_kk); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1514, __pyx_L1_error)
28100  __Pyx_GOTREF(__pyx_t_9);
28101  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28102  __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
28103  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
28104  (__pyx_v_self->kDir_c[__pyx_t_21]) = __pyx_t_8;
28105 
28106  /* "WaveTools.py":1513
28107  *
28108  * for ij in range(self.N):
28109  * for kk in range(3): # <<<<<<<<<<<<<<
28110  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
28111  * self.omega_c[ij] = self.omega[ij]
28112  */
28113  }
28114  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28115 
28116  /* "WaveTools.py":1515
28117  * for kk in range(3):
28118  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
28119  * self.omega_c[ij] = self.omega[ij] # <<<<<<<<<<<<<<
28120  * self.ki_c[ij] =self.ki[ij]
28121  * self.tanh_c[ij] = self.tanhF[ij]
28122  */
28123  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omega), __pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1515, __pyx_L1_error)
28124  __Pyx_GOTREF(__pyx_t_3);
28125  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1515, __pyx_L1_error)
28126  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28127  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1515, __pyx_L1_error)
28128  (__pyx_v_self->omega_c[__pyx_t_18]) = __pyx_t_8;
28129 
28130  /* "WaveTools.py":1516
28131  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
28132  * self.omega_c[ij] = self.omega[ij]
28133  * self.ki_c[ij] =self.ki[ij] # <<<<<<<<<<<<<<
28134  * self.tanh_c[ij] = self.tanhF[ij]
28135  * self.ai_c[ij] = self.ai[ij]
28136  */
28137  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
28138  __Pyx_GOTREF(__pyx_t_3);
28139  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L1_error)
28140  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28141  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1516, __pyx_L1_error)
28142  (__pyx_v_self->ki_c[__pyx_t_18]) = __pyx_t_8;
28143 
28144  /* "WaveTools.py":1517
28145  * self.omega_c[ij] = self.omega[ij]
28146  * self.ki_c[ij] =self.ki[ij]
28147  * self.tanh_c[ij] = self.tanhF[ij] # <<<<<<<<<<<<<<
28148  * self.ai_c[ij] = self.ai[ij]
28149  * self.phi_c[ij] = self.phi[ij]
28150  */
28151  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->tanhF), __pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1517, __pyx_L1_error)
28152  __Pyx_GOTREF(__pyx_t_3);
28153  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1517, __pyx_L1_error)
28154  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28155  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1517, __pyx_L1_error)
28156  (__pyx_v_self->tanh_c[__pyx_t_18]) = __pyx_t_8;
28157 
28158  /* "WaveTools.py":1518
28159  * self.ki_c[ij] =self.ki[ij]
28160  * self.tanh_c[ij] = self.tanhF[ij]
28161  * self.ai_c[ij] = self.ai[ij] # <<<<<<<<<<<<<<
28162  * self.phi_c[ij] = self.phi[ij]
28163  *
28164  */
28165  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ai), __pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1518, __pyx_L1_error)
28166  __Pyx_GOTREF(__pyx_t_3);
28167  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1518, __pyx_L1_error)
28168  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28169  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1518, __pyx_L1_error)
28170  (__pyx_v_self->ai_c[__pyx_t_18]) = __pyx_t_8;
28171 
28172  /* "WaveTools.py":1519
28173  * self.tanh_c[ij] = self.tanhF[ij]
28174  * self.ai_c[ij] = self.ai[ij]
28175  * self.phi_c[ij] = self.phi[ij] # <<<<<<<<<<<<<<
28176  *
28177  * self.kDir_ = self.kDir_c
28178  */
28179  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_self->phi, __pyx_v_ij); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1519, __pyx_L1_error)
28180  __Pyx_GOTREF(__pyx_t_3);
28181  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L1_error)
28182  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28183  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1519, __pyx_L1_error)
28184  (__pyx_v_self->phi_c[__pyx_t_18]) = __pyx_t_8;
28185 
28186  /* "WaveTools.py":1512
28187  *
28188  *
28189  * for ij in range(self.N): # <<<<<<<<<<<<<<
28190  * for kk in range(3):
28191  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
28192  */
28193  }
28194  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
28195 
28196  /* "WaveTools.py":1521
28197  * self.phi_c[ij] = self.phi[ij]
28198  *
28199  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
28200  * self.omega_ = self.omega_c
28201  * self.ki_ =self.ki_c
28202  */
28203  __pyx_t_19 = __pyx_v_self->kDir_c;
28204  __pyx_v_self->kDir_ = __pyx_t_19;
28205 
28206  /* "WaveTools.py":1522
28207  *
28208  * self.kDir_ = self.kDir_c
28209  * self.omega_ = self.omega_c # <<<<<<<<<<<<<<
28210  * self.ki_ =self.ki_c
28211  * self.ai_ = self.ai_c
28212  */
28213  __pyx_t_19 = __pyx_v_self->omega_c;
28214  __pyx_v_self->omega_ = __pyx_t_19;
28215 
28216  /* "WaveTools.py":1523
28217  * self.kDir_ = self.kDir_c
28218  * self.omega_ = self.omega_c
28219  * self.ki_ =self.ki_c # <<<<<<<<<<<<<<
28220  * self.ai_ = self.ai_c
28221  * self.tanh_ = self.tanh_c
28222  */
28223  __pyx_t_19 = __pyx_v_self->ki_c;
28224  __pyx_v_self->ki_ = __pyx_t_19;
28225 
28226  /* "WaveTools.py":1524
28227  * self.omega_ = self.omega_c
28228  * self.ki_ =self.ki_c
28229  * self.ai_ = self.ai_c # <<<<<<<<<<<<<<
28230  * self.tanh_ = self.tanh_c
28231  * self.phi_ = self.phi_c
28232  */
28233  __pyx_t_19 = __pyx_v_self->ai_c;
28234  __pyx_v_self->ai_ = __pyx_t_19;
28235 
28236  /* "WaveTools.py":1525
28237  * self.ki_ =self.ki_c
28238  * self.ai_ = self.ai_c
28239  * self.tanh_ = self.tanh_c # <<<<<<<<<<<<<<
28240  * self.phi_ = self.phi_c
28241  *
28242  */
28243  __pyx_t_19 = __pyx_v_self->tanh_c;
28244  __pyx_v_self->tanh_ = __pyx_t_19;
28245 
28246  /* "WaveTools.py":1526
28247  * self.ai_ = self.ai_c
28248  * self.tanh_ = self.tanh_c
28249  * self.phi_ = self.phi_c # <<<<<<<<<<<<<<
28250  *
28251  * def _cpp_eta(self, x, t):
28252  */
28253  __pyx_t_19 = __pyx_v_self->phi_c;
28254  __pyx_v_self->phi_ = __pyx_t_19;
28255 
28256  /* "WaveTools.py":1428
28257  * Switch for optimised functions
28258  * """
28259  * def __cinit__(self, # <<<<<<<<<<<<<<
28260  * Tp,
28261  * Hs,
28262  */
28263 
28264  /* function exit code */
28265  __pyx_r = 0;
28266  goto __pyx_L0;
28267  __pyx_L1_error:;
28268  __Pyx_XDECREF(__pyx_t_2);
28269  __Pyx_XDECREF(__pyx_t_3);
28270  __Pyx_XDECREF(__pyx_t_4);
28271  __Pyx_XDECREF(__pyx_t_6);
28272  __Pyx_XDECREF(__pyx_t_7);
28273  __Pyx_XDECREF(__pyx_t_9);
28274  __Pyx_XDECREF(__pyx_t_15);
28275  __Pyx_AddTraceback("WaveTools.RandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
28276  __pyx_r = -1;
28277  __pyx_L0:;
28278  __Pyx_XDECREF(__pyx_v_validSpectra);
28279  __Pyx_XDECREF(__pyx_v_spec_fun);
28280  __Pyx_XDECREF(__pyx_v_fmin);
28281  __Pyx_XDECREF(__pyx_v_omega_p);
28282  __Pyx_XDECREF(__pyx_v_fim);
28283  __Pyx_XDECREF(__pyx_v_ii);
28284  __Pyx_XDECREF(__pyx_v_ij);
28285  __Pyx_XDECREF(__pyx_v_kk);
28286  __Pyx_XDECREF(__pyx_v_waveDir);
28287  __Pyx_RefNannyFinishContext();
28288  return __pyx_r;
28289 }
28290 
28291 /* "WaveTools.py":1528
28292  * self.phi_ = self.phi_c
28293  *
28294  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
28295  *
28296  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
28297  */
28298 
28299 static double __pyx_f_9WaveTools_11RandomWaves__cpp_eta(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
28300  double __pyx_r;
28301  __Pyx_RefNannyDeclarations
28302  __Pyx_RefNannySetupContext("_cpp_eta", 0);
28303 
28304  /* "WaveTools.py":1530
28305  * def _cpp_eta(self, x, t):
28306  *
28307  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast) # <<<<<<<<<<<<<<
28308  *
28309  * def eta(self, x, t):
28310  */
28311  __pyx_r = proteus::__cpp_etaRandom(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->N, __pyx_v_self->fast);
28312  goto __pyx_L0;
28313 
28314  /* "WaveTools.py":1528
28315  * self.phi_ = self.phi_c
28316  *
28317  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
28318  *
28319  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
28320  */
28321 
28322  /* function exit code */
28323  __pyx_L0:;
28324  __Pyx_RefNannyFinishContext();
28325  return __pyx_r;
28326 }
28327 
28328 /* "WaveTools.py":1532
28329  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
28330  *
28331  * def eta(self, x, t): # <<<<<<<<<<<<<<
28332  * """Calculates free surface elevation (RandomWaves class)
28333  * Parameters
28334  */
28335 
28336 /* Python wrapper */
28337 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28338 static char __pyx_doc_9WaveTools_11RandomWaves_2eta[] = "Calculates free surface elevation (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
28339 static PyMethodDef __pyx_mdef_9WaveTools_11RandomWaves_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11RandomWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_11RandomWaves_2eta};
28340 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28341  PyObject *__pyx_v_x = 0;
28342  PyObject *__pyx_v_t = 0;
28343  PyObject *__pyx_r = 0;
28344  __Pyx_RefNannyDeclarations
28345  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
28346  {
28347  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
28348  PyObject* values[2] = {0,0};
28349  if (unlikely(__pyx_kwds)) {
28350  Py_ssize_t kw_args;
28351  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28352  switch (pos_args) {
28353  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28354  CYTHON_FALLTHROUGH;
28355  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28356  CYTHON_FALLTHROUGH;
28357  case 0: break;
28358  default: goto __pyx_L5_argtuple_error;
28359  }
28360  kw_args = PyDict_Size(__pyx_kwds);
28361  switch (pos_args) {
28362  case 0:
28363  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
28364  else goto __pyx_L5_argtuple_error;
28365  CYTHON_FALLTHROUGH;
28366  case 1:
28367  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
28368  else {
28369  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 1532, __pyx_L3_error)
28370  }
28371  }
28372  if (unlikely(kw_args > 0)) {
28373  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 1532, __pyx_L3_error)
28374  }
28375  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
28376  goto __pyx_L5_argtuple_error;
28377  } else {
28378  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28379  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28380  }
28381  __pyx_v_x = values[0];
28382  __pyx_v_t = values[1];
28383  }
28384  goto __pyx_L4_argument_unpacking_done;
28385  __pyx_L5_argtuple_error:;
28386  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1532, __pyx_L3_error)
28387  __pyx_L3_error:;
28388  __Pyx_AddTraceback("WaveTools.RandomWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
28389  __Pyx_RefNannyFinishContext();
28390  return NULL;
28391  __pyx_L4_argument_unpacking_done:;
28392  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2eta(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
28393 
28394  /* function exit code */
28395  __Pyx_RefNannyFinishContext();
28396  return __pyx_r;
28397 }
28398 
28399 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2eta(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
28400  double __pyx_v_xx[3];
28401  PyObject *__pyx_r = NULL;
28402  __Pyx_RefNannyDeclarations
28403  PyObject *__pyx_t_1 = NULL;
28404  double __pyx_t_2;
28405  __Pyx_RefNannySetupContext("eta", 0);
28406 
28407  /* "WaveTools.py":1548
28408  * """
28409  * cython.declare(xx=cython.double[3])
28410  * xx[0] = x[0] # <<<<<<<<<<<<<<
28411  * xx[1] = x[1]
28412  * xx[2] = x[2]
28413  */
28414  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error)
28415  __Pyx_GOTREF(__pyx_t_1);
28416  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
28417  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28418  (__pyx_v_xx[0]) = __pyx_t_2;
28419 
28420  /* "WaveTools.py":1549
28421  * cython.declare(xx=cython.double[3])
28422  * xx[0] = x[0]
28423  * xx[1] = x[1] # <<<<<<<<<<<<<<
28424  * xx[2] = x[2]
28425  * return self._cpp_eta(xx,t)
28426  */
28427  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
28428  __Pyx_GOTREF(__pyx_t_1);
28429  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1549, __pyx_L1_error)
28430  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28431  (__pyx_v_xx[1]) = __pyx_t_2;
28432 
28433  /* "WaveTools.py":1550
28434  * xx[0] = x[0]
28435  * xx[1] = x[1]
28436  * xx[2] = x[2] # <<<<<<<<<<<<<<
28437  * return self._cpp_eta(xx,t)
28438  *
28439  */
28440  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1550, __pyx_L1_error)
28441  __Pyx_GOTREF(__pyx_t_1);
28442  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L1_error)
28443  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28444  (__pyx_v_xx[2]) = __pyx_t_2;
28445 
28446  /* "WaveTools.py":1551
28447  * xx[1] = x[1]
28448  * xx[2] = x[2]
28449  * return self._cpp_eta(xx,t) # <<<<<<<<<<<<<<
28450  *
28451  * def _cpp_u(self, U, x, t):
28452  */
28453  __Pyx_XDECREF(__pyx_r);
28454  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1551, __pyx_L1_error)
28455  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error)
28456  __Pyx_GOTREF(__pyx_t_1);
28457  __pyx_r = __pyx_t_1;
28458  __pyx_t_1 = 0;
28459  goto __pyx_L0;
28460 
28461  /* "WaveTools.py":1532
28462  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
28463  *
28464  * def eta(self, x, t): # <<<<<<<<<<<<<<
28465  * """Calculates free surface elevation (RandomWaves class)
28466  * Parameters
28467  */
28468 
28469  /* function exit code */
28470  __pyx_L1_error:;
28471  __Pyx_XDECREF(__pyx_t_1);
28472  __Pyx_AddTraceback("WaveTools.RandomWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
28473  __pyx_r = NULL;
28474  __pyx_L0:;
28475  __Pyx_XGIVEREF(__pyx_r);
28476  __Pyx_RefNannyFinishContext();
28477  return __pyx_r;
28478 }
28479 
28480 /* "WaveTools.py":1553
28481  * return self._cpp_eta(xx,t)
28482  *
28483  * def _cpp_u(self, U, x, t): # <<<<<<<<<<<<<<
28484  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
28485  *
28486  */
28487 
28488 static void __pyx_f_9WaveTools_11RandomWaves__cpp_u(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
28489  __Pyx_RefNannyDeclarations
28490  __Pyx_RefNannySetupContext("_cpp_u", 0);
28491 
28492  /* "WaveTools.py":1554
28493  *
28494  * def _cpp_u(self, U, x, t):
28495  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast) # <<<<<<<<<<<<<<
28496  *
28497  * def u(self, x, t):
28498  */
28499  proteus::__cpp_uRandom(__pyx_v_U, __pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->N, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanh_, __pyx_v_self->gAbs, __pyx_v_self->fast);
28500 
28501  /* "WaveTools.py":1553
28502  * return self._cpp_eta(xx,t)
28503  *
28504  * def _cpp_u(self, U, x, t): # <<<<<<<<<<<<<<
28505  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
28506  *
28507  */
28508 
28509  /* function exit code */
28510  __Pyx_RefNannyFinishContext();
28511 }
28512 
28513 /* "WaveTools.py":1556
28514  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
28515  *
28516  * def u(self, x, t): # <<<<<<<<<<<<<<
28517  * """Calculates wave velocity vector (RandomWaves class)
28518  * Parameters
28519  */
28520 
28521 /* Python wrapper */
28522 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28523 static char __pyx_doc_9WaveTools_11RandomWaves_4u[] = "Calculates wave velocity vector (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
28524 static PyMethodDef __pyx_mdef_9WaveTools_11RandomWaves_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11RandomWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_11RandomWaves_4u};
28525 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28526  PyObject *__pyx_v_x = 0;
28527  PyObject *__pyx_v_t = 0;
28528  PyObject *__pyx_r = 0;
28529  __Pyx_RefNannyDeclarations
28530  __Pyx_RefNannySetupContext("u (wrapper)", 0);
28531  {
28532  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
28533  PyObject* values[2] = {0,0};
28534  if (unlikely(__pyx_kwds)) {
28535  Py_ssize_t kw_args;
28536  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28537  switch (pos_args) {
28538  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28539  CYTHON_FALLTHROUGH;
28540  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28541  CYTHON_FALLTHROUGH;
28542  case 0: break;
28543  default: goto __pyx_L5_argtuple_error;
28544  }
28545  kw_args = PyDict_Size(__pyx_kwds);
28546  switch (pos_args) {
28547  case 0:
28548  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
28549  else goto __pyx_L5_argtuple_error;
28550  CYTHON_FALLTHROUGH;
28551  case 1:
28552  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
28553  else {
28554  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 1556, __pyx_L3_error)
28555  }
28556  }
28557  if (unlikely(kw_args > 0)) {
28558  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 1556, __pyx_L3_error)
28559  }
28560  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
28561  goto __pyx_L5_argtuple_error;
28562  } else {
28563  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28564  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28565  }
28566  __pyx_v_x = values[0];
28567  __pyx_v_t = values[1];
28568  }
28569  goto __pyx_L4_argument_unpacking_done;
28570  __pyx_L5_argtuple_error:;
28571  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1556, __pyx_L3_error)
28572  __pyx_L3_error:;
28573  __Pyx_AddTraceback("WaveTools.RandomWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
28574  __Pyx_RefNannyFinishContext();
28575  return NULL;
28576  __pyx_L4_argument_unpacking_done:;
28577  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4u(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
28578 
28579  /* function exit code */
28580  __Pyx_RefNannyFinishContext();
28581  return __pyx_r;
28582 }
28583 
28584 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4u(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
28585  double __pyx_v_xx[3];
28586  double __pyx_v_cppU[3];
28587  PyObject *__pyx_v_ii = NULL;
28588  PyObject *__pyx_v_U = NULL;
28589  PyObject *__pyx_r = NULL;
28590  __Pyx_RefNannyDeclarations
28591  PyObject *__pyx_t_1 = NULL;
28592  PyObject *__pyx_t_2 = NULL;
28593  PyObject *__pyx_t_3 = NULL;
28594  Py_ssize_t __pyx_t_4;
28595  PyObject *(*__pyx_t_5)(PyObject *);
28596  double __pyx_t_6;
28597  Py_ssize_t __pyx_t_7;
28598  __Pyx_RefNannySetupContext("u", 0);
28599 
28600  /* "WaveTools.py":1574
28601  * cython.declare(xx=cython.double[3])
28602  * cython.declare(cppU=cython.double[3])
28603  * for ii in range(3): # <<<<<<<<<<<<<<
28604  * xx[ii] = x[ii]
28605  * cppU[ii] = 0.
28606  */
28607  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
28608  __Pyx_GOTREF(__pyx_t_2);
28609  __pyx_t_3 = NULL;
28610  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
28611  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
28612  if (likely(__pyx_t_3)) {
28613  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
28614  __Pyx_INCREF(__pyx_t_3);
28615  __Pyx_INCREF(function);
28616  __Pyx_DECREF_SET(__pyx_t_2, function);
28617  }
28618  }
28619  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
28620  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
28621  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
28622  __Pyx_GOTREF(__pyx_t_1);
28623  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28624  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
28625  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
28626  __pyx_t_5 = NULL;
28627  } else {
28628  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1574, __pyx_L1_error)
28629  __Pyx_GOTREF(__pyx_t_2);
28630  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1574, __pyx_L1_error)
28631  }
28632  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28633  for (;;) {
28634  if (likely(!__pyx_t_5)) {
28635  if (likely(PyList_CheckExact(__pyx_t_2))) {
28636  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
28637  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28638  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1574, __pyx_L1_error)
28639  #else
28640  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
28641  __Pyx_GOTREF(__pyx_t_1);
28642  #endif
28643  } else {
28644  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
28645  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28646  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1574, __pyx_L1_error)
28647  #else
28648  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error)
28649  __Pyx_GOTREF(__pyx_t_1);
28650  #endif
28651  }
28652  } else {
28653  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
28654  if (unlikely(!__pyx_t_1)) {
28655  PyObject* exc_type = PyErr_Occurred();
28656  if (exc_type) {
28657  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
28658  else __PYX_ERR(0, 1574, __pyx_L1_error)
28659  }
28660  break;
28661  }
28662  __Pyx_GOTREF(__pyx_t_1);
28663  }
28664  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
28665  __pyx_t_1 = 0;
28666 
28667  /* "WaveTools.py":1575
28668  * cython.declare(cppU=cython.double[3])
28669  * for ii in range(3):
28670  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
28671  * cppU[ii] = 0.
28672  * U = np.zeros(3,)
28673  */
28674  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1575, __pyx_L1_error)
28675  __Pyx_GOTREF(__pyx_t_1);
28676  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L1_error)
28677  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28678  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1575, __pyx_L1_error)
28679  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
28680 
28681  /* "WaveTools.py":1576
28682  * for ii in range(3):
28683  * xx[ii] = x[ii]
28684  * cppU[ii] = 0. # <<<<<<<<<<<<<<
28685  * U = np.zeros(3,)
28686  * self._cpp_u(cppU,xx,t)
28687  */
28688  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1576, __pyx_L1_error)
28689  (__pyx_v_cppU[__pyx_t_7]) = 0.;
28690 
28691  /* "WaveTools.py":1574
28692  * cython.declare(xx=cython.double[3])
28693  * cython.declare(cppU=cython.double[3])
28694  * for ii in range(3): # <<<<<<<<<<<<<<
28695  * xx[ii] = x[ii]
28696  * cppU[ii] = 0.
28697  */
28698  }
28699  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28700 
28701  /* "WaveTools.py":1577
28702  * xx[ii] = x[ii]
28703  * cppU[ii] = 0.
28704  * U = np.zeros(3,) # <<<<<<<<<<<<<<
28705  * self._cpp_u(cppU,xx,t)
28706  * U[0] = cppU[0]
28707  */
28708  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1577, __pyx_L1_error)
28709  __Pyx_GOTREF(__pyx_t_1);
28710  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1577, __pyx_L1_error)
28711  __Pyx_GOTREF(__pyx_t_3);
28712  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28713  __pyx_t_1 = NULL;
28714  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
28715  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
28716  if (likely(__pyx_t_1)) {
28717  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
28718  __Pyx_INCREF(__pyx_t_1);
28719  __Pyx_INCREF(function);
28720  __Pyx_DECREF_SET(__pyx_t_3, function);
28721  }
28722  }
28723  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
28724  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28725  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error)
28726  __Pyx_GOTREF(__pyx_t_2);
28727  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28728  __pyx_v_U = __pyx_t_2;
28729  __pyx_t_2 = 0;
28730 
28731  /* "WaveTools.py":1578
28732  * cppU[ii] = 0.
28733  * U = np.zeros(3,)
28734  * self._cpp_u(cppU,xx,t) # <<<<<<<<<<<<<<
28735  * U[0] = cppU[0]
28736  * U[1] = cppU[1]
28737  */
28738  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1578, __pyx_L1_error)
28739  ((struct __pyx_vtabstruct_9WaveTools_RandomWaves *)__pyx_v_self->__pyx_vtab)->_cpp_u(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
28740 
28741  /* "WaveTools.py":1579
28742  * U = np.zeros(3,)
28743  * self._cpp_u(cppU,xx,t)
28744  * U[0] = cppU[0] # <<<<<<<<<<<<<<
28745  * U[1] = cppU[1]
28746  * U[2] = cppU[2]
28747  */
28748  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
28749  __Pyx_GOTREF(__pyx_t_2);
28750  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1579, __pyx_L1_error)
28751  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28752 
28753  /* "WaveTools.py":1580
28754  * self._cpp_u(cppU,xx,t)
28755  * U[0] = cppU[0]
28756  * U[1] = cppU[1] # <<<<<<<<<<<<<<
28757  * U[2] = cppU[2]
28758  *
28759  */
28760  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1580, __pyx_L1_error)
28761  __Pyx_GOTREF(__pyx_t_2);
28762  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1580, __pyx_L1_error)
28763  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28764 
28765  /* "WaveTools.py":1581
28766  * U[0] = cppU[0]
28767  * U[1] = cppU[1]
28768  * U[2] = cppU[2] # <<<<<<<<<<<<<<
28769  *
28770  * return U
28771  */
28772  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1581, __pyx_L1_error)
28773  __Pyx_GOTREF(__pyx_t_2);
28774  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1581, __pyx_L1_error)
28775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28776 
28777  /* "WaveTools.py":1583
28778  * U[2] = cppU[2]
28779  *
28780  * return U # <<<<<<<<<<<<<<
28781  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])):
28782  * """Writes a timeseries of the free-surface elevation
28783  */
28784  __Pyx_XDECREF(__pyx_r);
28785  __Pyx_INCREF(__pyx_v_U);
28786  __pyx_r = __pyx_v_U;
28787  goto __pyx_L0;
28788 
28789  /* "WaveTools.py":1556
28790  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
28791  *
28792  * def u(self, x, t): # <<<<<<<<<<<<<<
28793  * """Calculates wave velocity vector (RandomWaves class)
28794  * Parameters
28795  */
28796 
28797  /* function exit code */
28798  __pyx_L1_error:;
28799  __Pyx_XDECREF(__pyx_t_1);
28800  __Pyx_XDECREF(__pyx_t_2);
28801  __Pyx_XDECREF(__pyx_t_3);
28802  __Pyx_AddTraceback("WaveTools.RandomWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
28803  __pyx_r = NULL;
28804  __pyx_L0:;
28805  __Pyx_XDECREF(__pyx_v_ii);
28806  __Pyx_XDECREF(__pyx_v_U);
28807  __Pyx_XGIVEREF(__pyx_r);
28808  __Pyx_RefNannyFinishContext();
28809  return __pyx_r;
28810 }
28811 
28812 /* "WaveTools.py":1584
28813  *
28814  * return U
28815  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
28816  * """Writes a timeseries of the free-surface elevation
28817  *
28818  */
28819 
28820 /* Python wrapper */
28821 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_7writeEtaSeries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28822 static char __pyx_doc_9WaveTools_11RandomWaves_6writeEtaSeries[] = "Writes a timeseries of the free-surface elevation\n\n It also returns the free surface elevation as a time-eta array.\n If Lgen !=[0.,0.,0.,] then Tstart is modified to account for the\n wave transformation at the most remote point of the relaxation zone.\n\n Parameters\n ----------\n Tstart : float\n Start time\n Tend : float\n End time\n x0 : numpy.ndarray\n Position vector of the time series\n fname : string\n Filename for timeseries file\n Lgen : Optional[numpy.ndarray]\n Length vector of relaxation zone\n\n\n Returns\n ----------\n numpy.ndarray\n 2D numpy array Nx2 containing free-surface elevation in time.\n ";
28823 static PyMethodDef __pyx_mdef_9WaveTools_11RandomWaves_7writeEtaSeries = {"writeEtaSeries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11RandomWaves_7writeEtaSeries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_11RandomWaves_6writeEtaSeries};
28824 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_7writeEtaSeries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28825  PyObject *__pyx_v_Tstart = 0;
28826  PyObject *__pyx_v_Tend = 0;
28827  PyObject *__pyx_v_x0 = 0;
28828  PyObject *__pyx_v_fname = 0;
28829  PyObject *__pyx_v_Lgen = 0;
28830  PyObject *__pyx_r = 0;
28831  __Pyx_RefNannyDeclarations
28832  __Pyx_RefNannySetupContext("writeEtaSeries (wrapper)", 0);
28833  {
28834  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Tstart,&__pyx_n_s_Tend,&__pyx_n_s_x0,&__pyx_n_s_fname,&__pyx_n_s_Lgen,0};
28835  PyObject* values[5] = {0,0,0,0,0};
28836  values[4] = __pyx_k__29;
28837  if (unlikely(__pyx_kwds)) {
28838  Py_ssize_t kw_args;
28839  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28840  switch (pos_args) {
28841  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
28842  CYTHON_FALLTHROUGH;
28843  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
28844  CYTHON_FALLTHROUGH;
28845  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28846  CYTHON_FALLTHROUGH;
28847  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28848  CYTHON_FALLTHROUGH;
28849  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28850  CYTHON_FALLTHROUGH;
28851  case 0: break;
28852  default: goto __pyx_L5_argtuple_error;
28853  }
28854  kw_args = PyDict_Size(__pyx_kwds);
28855  switch (pos_args) {
28856  case 0:
28857  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tstart)) != 0)) kw_args--;
28858  else goto __pyx_L5_argtuple_error;
28859  CYTHON_FALLTHROUGH;
28860  case 1:
28861  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tend)) != 0)) kw_args--;
28862  else {
28863  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, 1); __PYX_ERR(0, 1584, __pyx_L3_error)
28864  }
28865  CYTHON_FALLTHROUGH;
28866  case 2:
28867  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
28868  else {
28869  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, 2); __PYX_ERR(0, 1584, __pyx_L3_error)
28870  }
28871  CYTHON_FALLTHROUGH;
28872  case 3:
28873  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--;
28874  else {
28875  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, 3); __PYX_ERR(0, 1584, __pyx_L3_error)
28876  }
28877  CYTHON_FALLTHROUGH;
28878  case 4:
28879  if (kw_args > 0) {
28880  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Lgen);
28881  if (value) { values[4] = value; kw_args--; }
28882  }
28883  }
28884  if (unlikely(kw_args > 0)) {
28885  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeEtaSeries") < 0)) __PYX_ERR(0, 1584, __pyx_L3_error)
28886  }
28887  } else {
28888  switch (PyTuple_GET_SIZE(__pyx_args)) {
28889  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
28890  CYTHON_FALLTHROUGH;
28891  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
28892  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28893  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28894  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28895  break;
28896  default: goto __pyx_L5_argtuple_error;
28897  }
28898  }
28899  __pyx_v_Tstart = values[0];
28900  __pyx_v_Tend = values[1];
28901  __pyx_v_x0 = values[2];
28902  __pyx_v_fname = values[3];
28903  __pyx_v_Lgen = values[4];
28904  }
28905  goto __pyx_L4_argument_unpacking_done;
28906  __pyx_L5_argtuple_error:;
28907  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1584, __pyx_L3_error)
28908  __pyx_L3_error:;
28909  __Pyx_AddTraceback("WaveTools.RandomWaves.writeEtaSeries", __pyx_clineno, __pyx_lineno, __pyx_filename);
28910  __Pyx_RefNannyFinishContext();
28911  return NULL;
28912  __pyx_L4_argument_unpacking_done:;
28913  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_6writeEtaSeries(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_x0, __pyx_v_fname, __pyx_v_Lgen);
28914 
28915  /* function exit code */
28916  __Pyx_RefNannyFinishContext();
28917  return __pyx_r;
28918 }
28919 
28920 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_6writeEtaSeries(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_fname, PyObject *__pyx_v_Lgen) {
28921  PyObject *__pyx_v_dt = NULL;
28922  PyObject *__pyx_v_Tlag = NULL;
28923  PyObject *__pyx_v_j = NULL;
28924  PyObject *__pyx_v_Np = NULL;
28925  PyObject *__pyx_v_time = NULL;
28926  PyObject *__pyx_v_etaR = NULL;
28927  PyObject *__pyx_v_jj = NULL;
28928  PyObject *__pyx_v_series = NULL;
28929  PyObject *__pyx_r = NULL;
28930  __Pyx_RefNannyDeclarations
28931  PyObject *__pyx_t_1 = NULL;
28932  PyObject *__pyx_t_2 = NULL;
28933  PyObject *__pyx_t_3 = NULL;
28934  int __pyx_t_4;
28935  PyObject *__pyx_t_5 = NULL;
28936  int __pyx_t_6;
28937  PyObject *__pyx_t_7 = NULL;
28938  Py_ssize_t __pyx_t_8;
28939  PyObject *(*__pyx_t_9)(PyObject *);
28940  PyObject *__pyx_t_10 = NULL;
28941  PyObject *__pyx_t_11 = NULL;
28942  __Pyx_RefNannySetupContext("writeEtaSeries", 0);
28943  __Pyx_INCREF(__pyx_v_Tstart);
28944 
28945  /* "WaveTools.py":1610
28946  * 2D numpy array Nx2 containing free-surface elevation in time.
28947  * """
28948  * if sum(Lgen[:]*self.waveDir[:])< 0 : # <<<<<<<<<<<<<<
28949  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
28950  * sys.exit(1)
28951  */
28952  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1610, __pyx_L1_error)
28953  __Pyx_GOTREF(__pyx_t_1);
28954  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1610, __pyx_L1_error)
28955  __Pyx_GOTREF(__pyx_t_2);
28956  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error)
28957  __Pyx_GOTREF(__pyx_t_3);
28958  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28959  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28960  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1610, __pyx_L1_error)
28961  __Pyx_GOTREF(__pyx_t_2);
28962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28963  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error)
28964  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28965  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1610, __pyx_L1_error)
28966  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28967  if (__pyx_t_4) {
28968 
28969  /* "WaveTools.py":1611
28970  * """
28971  * if sum(Lgen[:]*self.waveDir[:])< 0 :
28972  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction') # <<<<<<<<<<<<<<
28973  * sys.exit(1)
28974  * dt = old_div(self.Tp,50.)
28975  */
28976  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1611, __pyx_L1_error)
28977  __Pyx_GOTREF(__pyx_t_2);
28978  __pyx_t_1 = NULL;
28979  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
28980  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
28981  if (likely(__pyx_t_1)) {
28982  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
28983  __Pyx_INCREF(__pyx_t_1);
28984  __Pyx_INCREF(function);
28985  __Pyx_DECREF_SET(__pyx_t_2, function);
28986  }
28987  }
28988  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_s_ERROR_Wavetools_py_Location_vect) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_ERROR_Wavetools_py_Location_vect);
28989  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
28990  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1611, __pyx_L1_error)
28991  __Pyx_GOTREF(__pyx_t_3);
28992  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28993  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28994 
28995  /* "WaveTools.py":1612
28996  * if sum(Lgen[:]*self.waveDir[:])< 0 :
28997  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
28998  * sys.exit(1) # <<<<<<<<<<<<<<
28999  * dt = old_div(self.Tp,50.)
29000  * Tlag = np.zeros(len(self.omega),)
29001  */
29002  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1612, __pyx_L1_error)
29003  __Pyx_GOTREF(__pyx_t_2);
29004  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error)
29005  __Pyx_GOTREF(__pyx_t_1);
29006  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29007  __pyx_t_2 = NULL;
29008  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
29009  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
29010  if (likely(__pyx_t_2)) {
29011  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
29012  __Pyx_INCREF(__pyx_t_2);
29013  __Pyx_INCREF(function);
29014  __Pyx_DECREF_SET(__pyx_t_1, function);
29015  }
29016  }
29017  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_1);
29018  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29019  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error)
29020  __Pyx_GOTREF(__pyx_t_3);
29021  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29022  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29023 
29024  /* "WaveTools.py":1610
29025  * 2D numpy array Nx2 containing free-surface elevation in time.
29026  * """
29027  * if sum(Lgen[:]*self.waveDir[:])< 0 : # <<<<<<<<<<<<<<
29028  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
29029  * sys.exit(1)
29030  */
29031  }
29032 
29033  /* "WaveTools.py":1613
29034  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
29035  * sys.exit(1)
29036  * dt = old_div(self.Tp,50.) # <<<<<<<<<<<<<<
29037  * Tlag = np.zeros(len(self.omega),)
29038  * for j in range(len(self.omega)):
29039  */
29040  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
29041  __Pyx_GOTREF(__pyx_t_1);
29042  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->Tp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1613, __pyx_L1_error)
29043  __Pyx_GOTREF(__pyx_t_2);
29044  __pyx_t_5 = NULL;
29045  __pyx_t_6 = 0;
29046  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
29047  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
29048  if (likely(__pyx_t_5)) {
29049  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
29050  __Pyx_INCREF(__pyx_t_5);
29051  __Pyx_INCREF(function);
29052  __Pyx_DECREF_SET(__pyx_t_1, function);
29053  __pyx_t_6 = 1;
29054  }
29055  }
29056  #if CYTHON_FAST_PYCALL
29057  if (PyFunction_Check(__pyx_t_1)) {
29058  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_float_50_};
29059  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
29060  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29061  __Pyx_GOTREF(__pyx_t_3);
29062  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29063  } else
29064  #endif
29065  #if CYTHON_FAST_PYCCALL
29066  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
29067  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_float_50_};
29068  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
29069  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29070  __Pyx_GOTREF(__pyx_t_3);
29071  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29072  } else
29073  #endif
29074  {
29075  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1613, __pyx_L1_error)
29076  __Pyx_GOTREF(__pyx_t_7);
29077  if (__pyx_t_5) {
29078  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
29079  }
29080  __Pyx_GIVEREF(__pyx_t_2);
29081  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
29082  __Pyx_INCREF(__pyx_float_50_);
29083  __Pyx_GIVEREF(__pyx_float_50_);
29084  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_float_50_);
29085  __pyx_t_2 = 0;
29086  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error)
29087  __Pyx_GOTREF(__pyx_t_3);
29088  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29089  }
29090  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29091  __pyx_v_dt = __pyx_t_3;
29092  __pyx_t_3 = 0;
29093 
29094  /* "WaveTools.py":1614
29095  * sys.exit(1)
29096  * dt = old_div(self.Tp,50.)
29097  * Tlag = np.zeros(len(self.omega),) # <<<<<<<<<<<<<<
29098  * for j in range(len(self.omega)):
29099  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
29100  */
29101  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error)
29102  __Pyx_GOTREF(__pyx_t_1);
29103  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1614, __pyx_L1_error)
29104  __Pyx_GOTREF(__pyx_t_7);
29105  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29106  __pyx_t_1 = ((PyObject *)__pyx_v_self->omega);
29107  __Pyx_INCREF(__pyx_t_1);
29108  __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1614, __pyx_L1_error)
29109  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29110  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error)
29111  __Pyx_GOTREF(__pyx_t_1);
29112  __pyx_t_2 = NULL;
29113  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
29114  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
29115  if (likely(__pyx_t_2)) {
29116  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
29117  __Pyx_INCREF(__pyx_t_2);
29118  __Pyx_INCREF(function);
29119  __Pyx_DECREF_SET(__pyx_t_7, function);
29120  }
29121  }
29122  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
29123  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29124  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29125  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L1_error)
29126  __Pyx_GOTREF(__pyx_t_3);
29127  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29128  __pyx_v_Tlag = __pyx_t_3;
29129  __pyx_t_3 = 0;
29130 
29131  /* "WaveTools.py":1615
29132  * dt = old_div(self.Tp,50.)
29133  * Tlag = np.zeros(len(self.omega),)
29134  * for j in range(len(self.omega)): # <<<<<<<<<<<<<<
29135  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
29136  * Tlag = max(Tlag)
29137  */
29138  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1615, __pyx_L1_error)
29139  __Pyx_GOTREF(__pyx_t_7);
29140  __pyx_t_1 = ((PyObject *)__pyx_v_self->omega);
29141  __Pyx_INCREF(__pyx_t_1);
29142  __pyx_t_8 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1615, __pyx_L1_error)
29143  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29144  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
29145  __Pyx_GOTREF(__pyx_t_1);
29146  __pyx_t_2 = NULL;
29147  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
29148  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7);
29149  if (likely(__pyx_t_2)) {
29150  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
29151  __Pyx_INCREF(__pyx_t_2);
29152  __Pyx_INCREF(function);
29153  __Pyx_DECREF_SET(__pyx_t_7, function);
29154  }
29155  }
29156  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
29157  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29158  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29159  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
29160  __Pyx_GOTREF(__pyx_t_3);
29161  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29162  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
29163  __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
29164  __pyx_t_9 = NULL;
29165  } else {
29166  __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1615, __pyx_L1_error)
29167  __Pyx_GOTREF(__pyx_t_7);
29168  __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1615, __pyx_L1_error)
29169  }
29170  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29171  for (;;) {
29172  if (likely(!__pyx_t_9)) {
29173  if (likely(PyList_CheckExact(__pyx_t_7))) {
29174  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
29175  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29176  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1615, __pyx_L1_error)
29177  #else
29178  __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
29179  __Pyx_GOTREF(__pyx_t_3);
29180  #endif
29181  } else {
29182  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
29183  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29184  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1615, __pyx_L1_error)
29185  #else
29186  __pyx_t_3 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error)
29187  __Pyx_GOTREF(__pyx_t_3);
29188  #endif
29189  }
29190  } else {
29191  __pyx_t_3 = __pyx_t_9(__pyx_t_7);
29192  if (unlikely(!__pyx_t_3)) {
29193  PyObject* exc_type = PyErr_Occurred();
29194  if (exc_type) {
29195  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
29196  else __PYX_ERR(0, 1615, __pyx_L1_error)
29197  }
29198  break;
29199  }
29200  __Pyx_GOTREF(__pyx_t_3);
29201  }
29202  __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
29203  __pyx_t_3 = 0;
29204 
29205  /* "WaveTools.py":1616
29206  * Tlag = np.zeros(len(self.omega),)
29207  * for j in range(len(self.omega)):
29208  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j]) # <<<<<<<<<<<<<<
29209  * Tlag = max(Tlag)
29210  * Tstart = Tstart - Tlag
29211  */
29212  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error)
29213  __Pyx_GOTREF(__pyx_t_1);
29214  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1616, __pyx_L1_error)
29215  __Pyx_GOTREF(__pyx_t_2);
29216  __Pyx_INCREF(__pyx_v_j);
29217  __Pyx_GIVEREF(__pyx_v_j);
29218  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_j);
29219  __Pyx_INCREF(__pyx_slice__4);
29220  __Pyx_GIVEREF(__pyx_slice__4);
29221  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__4);
29222  __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1616, __pyx_L1_error)
29223  __Pyx_GOTREF(__pyx_t_5);
29224  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29225  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1616, __pyx_L1_error)
29226  __Pyx_GOTREF(__pyx_t_2);
29227  __pyx_t_10 = PyNumber_Multiply(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1616, __pyx_L1_error)
29228  __Pyx_GOTREF(__pyx_t_10);
29229  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
29230  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29231  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1616, __pyx_L1_error)
29232  __Pyx_GOTREF(__pyx_t_2);
29233  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29234  __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omega), __pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1616, __pyx_L1_error)
29235  __Pyx_GOTREF(__pyx_t_10);
29236  __pyx_t_5 = NULL;
29237  __pyx_t_6 = 0;
29238  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
29239  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
29240  if (likely(__pyx_t_5)) {
29241  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
29242  __Pyx_INCREF(__pyx_t_5);
29243  __Pyx_INCREF(function);
29244  __Pyx_DECREF_SET(__pyx_t_1, function);
29245  __pyx_t_6 = 1;
29246  }
29247  }
29248  #if CYTHON_FAST_PYCALL
29249  if (PyFunction_Check(__pyx_t_1)) {
29250  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_10};
29251  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
29252  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29253  __Pyx_GOTREF(__pyx_t_3);
29254  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29255  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29256  } else
29257  #endif
29258  #if CYTHON_FAST_PYCCALL
29259  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
29260  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_2, __pyx_t_10};
29261  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
29262  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29263  __Pyx_GOTREF(__pyx_t_3);
29264  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29265  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29266  } else
29267  #endif
29268  {
29269  __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1616, __pyx_L1_error)
29270  __Pyx_GOTREF(__pyx_t_11);
29271  if (__pyx_t_5) {
29272  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
29273  }
29274  __Pyx_GIVEREF(__pyx_t_2);
29275  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_t_2);
29276  __Pyx_GIVEREF(__pyx_t_10);
29277  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_10);
29278  __pyx_t_2 = 0;
29279  __pyx_t_10 = 0;
29280  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error)
29281  __Pyx_GOTREF(__pyx_t_3);
29282  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
29283  }
29284  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29285  if (unlikely(PyObject_SetItem(__pyx_v_Tlag, __pyx_v_j, __pyx_t_3) < 0)) __PYX_ERR(0, 1616, __pyx_L1_error)
29286  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29287 
29288  /* "WaveTools.py":1615
29289  * dt = old_div(self.Tp,50.)
29290  * Tlag = np.zeros(len(self.omega),)
29291  * for j in range(len(self.omega)): # <<<<<<<<<<<<<<
29292  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
29293  * Tlag = max(Tlag)
29294  */
29295  }
29296  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29297 
29298  /* "WaveTools.py":1617
29299  * for j in range(len(self.omega)):
29300  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
29301  * Tlag = max(Tlag) # <<<<<<<<<<<<<<
29302  * Tstart = Tstart - Tlag
29303  * Np = int(old_div((Tend - Tstart),dt))
29304  */
29305  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_Tlag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1617, __pyx_L1_error)
29306  __Pyx_GOTREF(__pyx_t_7);
29307  __Pyx_DECREF_SET(__pyx_v_Tlag, __pyx_t_7);
29308  __pyx_t_7 = 0;
29309 
29310  /* "WaveTools.py":1618
29311  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
29312  * Tlag = max(Tlag)
29313  * Tstart = Tstart - Tlag # <<<<<<<<<<<<<<
29314  * Np = int(old_div((Tend - Tstart),dt))
29315  * time = np.linspace(Tstart,Tend,Np )
29316  */
29317  __pyx_t_7 = PyNumber_Subtract(__pyx_v_Tstart, __pyx_v_Tlag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1618, __pyx_L1_error)
29318  __Pyx_GOTREF(__pyx_t_7);
29319  __Pyx_DECREF_SET(__pyx_v_Tstart, __pyx_t_7);
29320  __pyx_t_7 = 0;
29321 
29322  /* "WaveTools.py":1619
29323  * Tlag = max(Tlag)
29324  * Tstart = Tstart - Tlag
29325  * Np = int(old_div((Tend - Tstart),dt)) # <<<<<<<<<<<<<<
29326  * time = np.linspace(Tstart,Tend,Np )
29327  * etaR = np.zeros(len(time), )
29328  */
29329  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error)
29330  __Pyx_GOTREF(__pyx_t_3);
29331  __pyx_t_1 = PyNumber_Subtract(__pyx_v_Tend, __pyx_v_Tstart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
29332  __Pyx_GOTREF(__pyx_t_1);
29333  __pyx_t_11 = NULL;
29334  __pyx_t_6 = 0;
29335  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
29336  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
29337  if (likely(__pyx_t_11)) {
29338  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
29339  __Pyx_INCREF(__pyx_t_11);
29340  __Pyx_INCREF(function);
29341  __Pyx_DECREF_SET(__pyx_t_3, function);
29342  __pyx_t_6 = 1;
29343  }
29344  }
29345  #if CYTHON_FAST_PYCALL
29346  if (PyFunction_Check(__pyx_t_3)) {
29347  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_dt};
29348  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1619, __pyx_L1_error)
29349  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
29350  __Pyx_GOTREF(__pyx_t_7);
29351  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29352  } else
29353  #endif
29354  #if CYTHON_FAST_PYCCALL
29355  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
29356  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_dt};
29357  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1619, __pyx_L1_error)
29358  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
29359  __Pyx_GOTREF(__pyx_t_7);
29360  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29361  } else
29362  #endif
29363  {
29364  __pyx_t_10 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1619, __pyx_L1_error)
29365  __Pyx_GOTREF(__pyx_t_10);
29366  if (__pyx_t_11) {
29367  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
29368  }
29369  __Pyx_GIVEREF(__pyx_t_1);
29370  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_6, __pyx_t_1);
29371  __Pyx_INCREF(__pyx_v_dt);
29372  __Pyx_GIVEREF(__pyx_v_dt);
29373  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_6, __pyx_v_dt);
29374  __pyx_t_1 = 0;
29375  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1619, __pyx_L1_error)
29376  __Pyx_GOTREF(__pyx_t_7);
29377  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29378  }
29379  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29380  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1619, __pyx_L1_error)
29381  __Pyx_GOTREF(__pyx_t_3);
29382  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29383  __pyx_v_Np = __pyx_t_3;
29384  __pyx_t_3 = 0;
29385 
29386  /* "WaveTools.py":1620
29387  * Tstart = Tstart - Tlag
29388  * Np = int(old_div((Tend - Tstart),dt))
29389  * time = np.linspace(Tstart,Tend,Np ) # <<<<<<<<<<<<<<
29390  * etaR = np.zeros(len(time), )
29391  * for jj in range(len(time)):
29392  */
29393  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1620, __pyx_L1_error)
29394  __Pyx_GOTREF(__pyx_t_7);
29395  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_linspace); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1620, __pyx_L1_error)
29396  __Pyx_GOTREF(__pyx_t_10);
29397  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29398  __pyx_t_7 = NULL;
29399  __pyx_t_6 = 0;
29400  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
29401  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
29402  if (likely(__pyx_t_7)) {
29403  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
29404  __Pyx_INCREF(__pyx_t_7);
29405  __Pyx_INCREF(function);
29406  __Pyx_DECREF_SET(__pyx_t_10, function);
29407  __pyx_t_6 = 1;
29408  }
29409  }
29410  #if CYTHON_FAST_PYCALL
29411  if (PyFunction_Check(__pyx_t_10)) {
29412  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Np};
29413  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1620, __pyx_L1_error)
29414  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29415  __Pyx_GOTREF(__pyx_t_3);
29416  } else
29417  #endif
29418  #if CYTHON_FAST_PYCCALL
29419  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
29420  PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Np};
29421  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1620, __pyx_L1_error)
29422  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29423  __Pyx_GOTREF(__pyx_t_3);
29424  } else
29425  #endif
29426  {
29427  __pyx_t_1 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1620, __pyx_L1_error)
29428  __Pyx_GOTREF(__pyx_t_1);
29429  if (__pyx_t_7) {
29430  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
29431  }
29432  __Pyx_INCREF(__pyx_v_Tstart);
29433  __Pyx_GIVEREF(__pyx_v_Tstart);
29434  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_v_Tstart);
29435  __Pyx_INCREF(__pyx_v_Tend);
29436  __Pyx_GIVEREF(__pyx_v_Tend);
29437  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_v_Tend);
29438  __Pyx_INCREF(__pyx_v_Np);
29439  __Pyx_GIVEREF(__pyx_v_Np);
29440  PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_6, __pyx_v_Np);
29441  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1620, __pyx_L1_error)
29442  __Pyx_GOTREF(__pyx_t_3);
29443  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29444  }
29445  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29446  __pyx_v_time = __pyx_t_3;
29447  __pyx_t_3 = 0;
29448 
29449  /* "WaveTools.py":1621
29450  * Np = int(old_div((Tend - Tstart),dt))
29451  * time = np.linspace(Tstart,Tend,Np )
29452  * etaR = np.zeros(len(time), ) # <<<<<<<<<<<<<<
29453  * for jj in range(len(time)):
29454  * etaR[jj] = self.eta(x0,time[jj])
29455  */
29456  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1621, __pyx_L1_error)
29457  __Pyx_GOTREF(__pyx_t_10);
29458  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
29459  __Pyx_GOTREF(__pyx_t_1);
29460  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29461  __pyx_t_8 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1621, __pyx_L1_error)
29462  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1621, __pyx_L1_error)
29463  __Pyx_GOTREF(__pyx_t_10);
29464  __pyx_t_7 = NULL;
29465  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
29466  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
29467  if (likely(__pyx_t_7)) {
29468  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
29469  __Pyx_INCREF(__pyx_t_7);
29470  __Pyx_INCREF(function);
29471  __Pyx_DECREF_SET(__pyx_t_1, function);
29472  }
29473  }
29474  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
29475  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29476  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29477  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1621, __pyx_L1_error)
29478  __Pyx_GOTREF(__pyx_t_3);
29479  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29480  __pyx_v_etaR = __pyx_t_3;
29481  __pyx_t_3 = 0;
29482 
29483  /* "WaveTools.py":1622
29484  * time = np.linspace(Tstart,Tend,Np )
29485  * etaR = np.zeros(len(time), )
29486  * for jj in range(len(time)): # <<<<<<<<<<<<<<
29487  * etaR[jj] = self.eta(x0,time[jj])
29488  * np.savetxt(fname,list(zip(time,etaR)))
29489  */
29490  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error)
29491  __Pyx_GOTREF(__pyx_t_1);
29492  __pyx_t_8 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1622, __pyx_L1_error)
29493  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1622, __pyx_L1_error)
29494  __Pyx_GOTREF(__pyx_t_10);
29495  __pyx_t_7 = NULL;
29496  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
29497  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
29498  if (likely(__pyx_t_7)) {
29499  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
29500  __Pyx_INCREF(__pyx_t_7);
29501  __Pyx_INCREF(function);
29502  __Pyx_DECREF_SET(__pyx_t_1, function);
29503  }
29504  }
29505  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_10);
29506  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29507  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29508  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1622, __pyx_L1_error)
29509  __Pyx_GOTREF(__pyx_t_3);
29510  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29511  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
29512  __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
29513  __pyx_t_9 = NULL;
29514  } else {
29515  __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error)
29516  __Pyx_GOTREF(__pyx_t_1);
29517  __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1622, __pyx_L1_error)
29518  }
29519  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29520  for (;;) {
29521  if (likely(!__pyx_t_9)) {
29522  if (likely(PyList_CheckExact(__pyx_t_1))) {
29523  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
29524  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29525  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1622, __pyx_L1_error)
29526  #else
29527  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1622, __pyx_L1_error)
29528  __Pyx_GOTREF(__pyx_t_3);
29529  #endif
29530  } else {
29531  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
29532  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29533  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1622, __pyx_L1_error)
29534  #else
29535  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1622, __pyx_L1_error)
29536  __Pyx_GOTREF(__pyx_t_3);
29537  #endif
29538  }
29539  } else {
29540  __pyx_t_3 = __pyx_t_9(__pyx_t_1);
29541  if (unlikely(!__pyx_t_3)) {
29542  PyObject* exc_type = PyErr_Occurred();
29543  if (exc_type) {
29544  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
29545  else __PYX_ERR(0, 1622, __pyx_L1_error)
29546  }
29547  break;
29548  }
29549  __Pyx_GOTREF(__pyx_t_3);
29550  }
29551  __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_3);
29552  __pyx_t_3 = 0;
29553 
29554  /* "WaveTools.py":1623
29555  * etaR = np.zeros(len(time), )
29556  * for jj in range(len(time)):
29557  * etaR[jj] = self.eta(x0,time[jj]) # <<<<<<<<<<<<<<
29558  * np.savetxt(fname,list(zip(time,etaR)))
29559  * series = np.zeros((len(time),2),)
29560  */
29561  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1623, __pyx_L1_error)
29562  __Pyx_GOTREF(__pyx_t_10);
29563  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_time, __pyx_v_jj); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1623, __pyx_L1_error)
29564  __Pyx_GOTREF(__pyx_t_7);
29565  __pyx_t_11 = NULL;
29566  __pyx_t_6 = 0;
29567  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
29568  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
29569  if (likely(__pyx_t_11)) {
29570  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
29571  __Pyx_INCREF(__pyx_t_11);
29572  __Pyx_INCREF(function);
29573  __Pyx_DECREF_SET(__pyx_t_10, function);
29574  __pyx_t_6 = 1;
29575  }
29576  }
29577  #if CYTHON_FAST_PYCALL
29578  if (PyFunction_Check(__pyx_t_10)) {
29579  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_x0, __pyx_t_7};
29580  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error)
29581  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
29582  __Pyx_GOTREF(__pyx_t_3);
29583  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29584  } else
29585  #endif
29586  #if CYTHON_FAST_PYCCALL
29587  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
29588  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_x0, __pyx_t_7};
29589  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error)
29590  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
29591  __Pyx_GOTREF(__pyx_t_3);
29592  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29593  } else
29594  #endif
29595  {
29596  __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1623, __pyx_L1_error)
29597  __Pyx_GOTREF(__pyx_t_2);
29598  if (__pyx_t_11) {
29599  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL;
29600  }
29601  __Pyx_INCREF(__pyx_v_x0);
29602  __Pyx_GIVEREF(__pyx_v_x0);
29603  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_v_x0);
29604  __Pyx_GIVEREF(__pyx_t_7);
29605  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_7);
29606  __pyx_t_7 = 0;
29607  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1623, __pyx_L1_error)
29608  __Pyx_GOTREF(__pyx_t_3);
29609  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29610  }
29611  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29612  if (unlikely(PyObject_SetItem(__pyx_v_etaR, __pyx_v_jj, __pyx_t_3) < 0)) __PYX_ERR(0, 1623, __pyx_L1_error)
29613  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29614 
29615  /* "WaveTools.py":1622
29616  * time = np.linspace(Tstart,Tend,Np )
29617  * etaR = np.zeros(len(time), )
29618  * for jj in range(len(time)): # <<<<<<<<<<<<<<
29619  * etaR[jj] = self.eta(x0,time[jj])
29620  * np.savetxt(fname,list(zip(time,etaR)))
29621  */
29622  }
29623  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29624 
29625  /* "WaveTools.py":1624
29626  * for jj in range(len(time)):
29627  * etaR[jj] = self.eta(x0,time[jj])
29628  * np.savetxt(fname,list(zip(time,etaR))) # <<<<<<<<<<<<<<
29629  * series = np.zeros((len(time),2),)
29630  * series[:,0] = time
29631  */
29632  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error)
29633  __Pyx_GOTREF(__pyx_t_3);
29634  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_savetxt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1624, __pyx_L1_error)
29635  __Pyx_GOTREF(__pyx_t_10);
29636  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29637  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_zip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error)
29638  __Pyx_GOTREF(__pyx_t_2);
29639  __pyx_t_7 = NULL;
29640  __pyx_t_6 = 0;
29641  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
29642  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
29643  if (likely(__pyx_t_7)) {
29644  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29645  __Pyx_INCREF(__pyx_t_7);
29646  __Pyx_INCREF(function);
29647  __Pyx_DECREF_SET(__pyx_t_2, function);
29648  __pyx_t_6 = 1;
29649  }
29650  }
29651  #if CYTHON_FAST_PYCALL
29652  if (PyFunction_Check(__pyx_t_2)) {
29653  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_time, __pyx_v_etaR};
29654  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error)
29655  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29656  __Pyx_GOTREF(__pyx_t_3);
29657  } else
29658  #endif
29659  #if CYTHON_FAST_PYCCALL
29660  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
29661  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_time, __pyx_v_etaR};
29662  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error)
29663  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
29664  __Pyx_GOTREF(__pyx_t_3);
29665  } else
29666  #endif
29667  {
29668  __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1624, __pyx_L1_error)
29669  __Pyx_GOTREF(__pyx_t_11);
29670  if (__pyx_t_7) {
29671  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
29672  }
29673  __Pyx_INCREF(__pyx_v_time);
29674  __Pyx_GIVEREF(__pyx_v_time);
29675  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_v_time);
29676  __Pyx_INCREF(__pyx_v_etaR);
29677  __Pyx_GIVEREF(__pyx_v_etaR);
29678  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_v_etaR);
29679  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error)
29680  __Pyx_GOTREF(__pyx_t_3);
29681  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
29682  }
29683  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29684  __pyx_t_2 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1624, __pyx_L1_error)
29685  __Pyx_GOTREF(__pyx_t_2);
29686  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29687  __pyx_t_3 = NULL;
29688  __pyx_t_6 = 0;
29689  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
29690  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
29691  if (likely(__pyx_t_3)) {
29692  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
29693  __Pyx_INCREF(__pyx_t_3);
29694  __Pyx_INCREF(function);
29695  __Pyx_DECREF_SET(__pyx_t_10, function);
29696  __pyx_t_6 = 1;
29697  }
29698  }
29699  #if CYTHON_FAST_PYCALL
29700  if (PyFunction_Check(__pyx_t_10)) {
29701  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fname, __pyx_t_2};
29702  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
29703  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29704  __Pyx_GOTREF(__pyx_t_1);
29705  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29706  } else
29707  #endif
29708  #if CYTHON_FAST_PYCCALL
29709  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
29710  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_fname, __pyx_t_2};
29711  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
29712  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29713  __Pyx_GOTREF(__pyx_t_1);
29714  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29715  } else
29716  #endif
29717  {
29718  __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1624, __pyx_L1_error)
29719  __Pyx_GOTREF(__pyx_t_11);
29720  if (__pyx_t_3) {
29721  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
29722  }
29723  __Pyx_INCREF(__pyx_v_fname);
29724  __Pyx_GIVEREF(__pyx_v_fname);
29725  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_v_fname);
29726  __Pyx_GIVEREF(__pyx_t_2);
29727  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_2);
29728  __pyx_t_2 = 0;
29729  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error)
29730  __Pyx_GOTREF(__pyx_t_1);
29731  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
29732  }
29733  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29734  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29735 
29736  /* "WaveTools.py":1625
29737  * etaR[jj] = self.eta(x0,time[jj])
29738  * np.savetxt(fname,list(zip(time,etaR)))
29739  * series = np.zeros((len(time),2),) # <<<<<<<<<<<<<<
29740  * series[:,0] = time
29741  * series[:,1] = etaR
29742  */
29743  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1625, __pyx_L1_error)
29744  __Pyx_GOTREF(__pyx_t_10);
29745  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1625, __pyx_L1_error)
29746  __Pyx_GOTREF(__pyx_t_11);
29747  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
29748  __pyx_t_8 = PyObject_Length(__pyx_v_time); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1625, __pyx_L1_error)
29749  __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1625, __pyx_L1_error)
29750  __Pyx_GOTREF(__pyx_t_10);
29751  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1625, __pyx_L1_error)
29752  __Pyx_GOTREF(__pyx_t_2);
29753  __Pyx_GIVEREF(__pyx_t_10);
29754  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
29755  __Pyx_INCREF(__pyx_int_2);
29756  __Pyx_GIVEREF(__pyx_int_2);
29757  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_2);
29758  __pyx_t_10 = 0;
29759  __pyx_t_10 = NULL;
29760  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
29761  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
29762  if (likely(__pyx_t_10)) {
29763  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
29764  __Pyx_INCREF(__pyx_t_10);
29765  __Pyx_INCREF(function);
29766  __Pyx_DECREF_SET(__pyx_t_11, function);
29767  }
29768  }
29769  __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2);
29770  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
29771  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29772  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1625, __pyx_L1_error)
29773  __Pyx_GOTREF(__pyx_t_1);
29774  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
29775  __pyx_v_series = __pyx_t_1;
29776  __pyx_t_1 = 0;
29777 
29778  /* "WaveTools.py":1626
29779  * np.savetxt(fname,list(zip(time,etaR)))
29780  * series = np.zeros((len(time),2),)
29781  * series[:,0] = time # <<<<<<<<<<<<<<
29782  * series[:,1] = etaR
29783  *
29784  */
29785  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_tuple__25, __pyx_v_time) < 0)) __PYX_ERR(0, 1626, __pyx_L1_error)
29786 
29787  /* "WaveTools.py":1627
29788  * series = np.zeros((len(time),2),)
29789  * series[:,0] = time
29790  * series[:,1] = etaR # <<<<<<<<<<<<<<
29791  *
29792  * return series
29793  */
29794  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_tuple__26, __pyx_v_etaR) < 0)) __PYX_ERR(0, 1627, __pyx_L1_error)
29795 
29796  /* "WaveTools.py":1629
29797  * series[:,1] = etaR
29798  *
29799  * return series # <<<<<<<<<<<<<<
29800  *
29801  *
29802  */
29803  __Pyx_XDECREF(__pyx_r);
29804  __Pyx_INCREF(__pyx_v_series);
29805  __pyx_r = __pyx_v_series;
29806  goto __pyx_L0;
29807 
29808  /* "WaveTools.py":1584
29809  *
29810  * return U
29811  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
29812  * """Writes a timeseries of the free-surface elevation
29813  *
29814  */
29815 
29816  /* function exit code */
29817  __pyx_L1_error:;
29818  __Pyx_XDECREF(__pyx_t_1);
29819  __Pyx_XDECREF(__pyx_t_2);
29820  __Pyx_XDECREF(__pyx_t_3);
29821  __Pyx_XDECREF(__pyx_t_5);
29822  __Pyx_XDECREF(__pyx_t_7);
29823  __Pyx_XDECREF(__pyx_t_10);
29824  __Pyx_XDECREF(__pyx_t_11);
29825  __Pyx_AddTraceback("WaveTools.RandomWaves.writeEtaSeries", __pyx_clineno, __pyx_lineno, __pyx_filename);
29826  __pyx_r = NULL;
29827  __pyx_L0:;
29828  __Pyx_XDECREF(__pyx_v_dt);
29829  __Pyx_XDECREF(__pyx_v_Tlag);
29830  __Pyx_XDECREF(__pyx_v_j);
29831  __Pyx_XDECREF(__pyx_v_Np);
29832  __Pyx_XDECREF(__pyx_v_time);
29833  __Pyx_XDECREF(__pyx_v_etaR);
29834  __Pyx_XDECREF(__pyx_v_jj);
29835  __Pyx_XDECREF(__pyx_v_series);
29836  __Pyx_XDECREF(__pyx_v_Tstart);
29837  __Pyx_XGIVEREF(__pyx_r);
29838  __Pyx_RefNannyFinishContext();
29839  return __pyx_r;
29840 }
29841 
29842 /* "WaveTools.pxd":123
29843  * cdef double[10000] phi_c
29844  * cdef public:
29845  * double mwl,depth,gAbs,Tlag,Hs,Tp,fp,bandFactor,df,wavelength # <<<<<<<<<<<<<<
29846  * int N
29847  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai
29848  */
29849 
29850 /* Python wrapper */
29851 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
29852 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3mwl_1__get__(PyObject *__pyx_v_self) {
29853  PyObject *__pyx_r = 0;
29854  __Pyx_RefNannyDeclarations
29855  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
29856  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3mwl___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
29857 
29858  /* function exit code */
29859  __Pyx_RefNannyFinishContext();
29860  return __pyx_r;
29861 }
29862 
29863 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_3mwl___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
29864  PyObject *__pyx_r = NULL;
29865  __Pyx_RefNannyDeclarations
29866  PyObject *__pyx_t_1 = NULL;
29867  __Pyx_RefNannySetupContext("__get__", 0);
29868  __Pyx_XDECREF(__pyx_r);
29869  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
29870  __Pyx_GOTREF(__pyx_t_1);
29871  __pyx_r = __pyx_t_1;
29872  __pyx_t_1 = 0;
29873  goto __pyx_L0;
29874 
29875  /* function exit code */
29876  __pyx_L1_error:;
29877  __Pyx_XDECREF(__pyx_t_1);
29878  __Pyx_AddTraceback("WaveTools.RandomWaves.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29879  __pyx_r = NULL;
29880  __pyx_L0:;
29881  __Pyx_XGIVEREF(__pyx_r);
29882  __Pyx_RefNannyFinishContext();
29883  return __pyx_r;
29884 }
29885 
29886 /* Python wrapper */
29887 static int __pyx_pw_9WaveTools_11RandomWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
29888 static int __pyx_pw_9WaveTools_11RandomWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
29889  int __pyx_r;
29890  __Pyx_RefNannyDeclarations
29891  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
29892  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3mwl_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
29893 
29894  /* function exit code */
29895  __Pyx_RefNannyFinishContext();
29896  return __pyx_r;
29897 }
29898 
29899 static int __pyx_pf_9WaveTools_11RandomWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
29900  int __pyx_r;
29901  __Pyx_RefNannyDeclarations
29902  double __pyx_t_1;
29903  __Pyx_RefNannySetupContext("__set__", 0);
29904  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
29905  __pyx_v_self->mwl = __pyx_t_1;
29906 
29907  /* function exit code */
29908  __pyx_r = 0;
29909  goto __pyx_L0;
29910  __pyx_L1_error:;
29911  __Pyx_AddTraceback("WaveTools.RandomWaves.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29912  __pyx_r = -1;
29913  __pyx_L0:;
29914  __Pyx_RefNannyFinishContext();
29915  return __pyx_r;
29916 }
29917 
29918 /* Python wrapper */
29919 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
29920 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5depth_1__get__(PyObject *__pyx_v_self) {
29921  PyObject *__pyx_r = 0;
29922  __Pyx_RefNannyDeclarations
29923  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
29924  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5depth___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
29925 
29926  /* function exit code */
29927  __Pyx_RefNannyFinishContext();
29928  return __pyx_r;
29929 }
29930 
29931 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5depth___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
29932  PyObject *__pyx_r = NULL;
29933  __Pyx_RefNannyDeclarations
29934  PyObject *__pyx_t_1 = NULL;
29935  __Pyx_RefNannySetupContext("__get__", 0);
29936  __Pyx_XDECREF(__pyx_r);
29937  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
29938  __Pyx_GOTREF(__pyx_t_1);
29939  __pyx_r = __pyx_t_1;
29940  __pyx_t_1 = 0;
29941  goto __pyx_L0;
29942 
29943  /* function exit code */
29944  __pyx_L1_error:;
29945  __Pyx_XDECREF(__pyx_t_1);
29946  __Pyx_AddTraceback("WaveTools.RandomWaves.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29947  __pyx_r = NULL;
29948  __pyx_L0:;
29949  __Pyx_XGIVEREF(__pyx_r);
29950  __Pyx_RefNannyFinishContext();
29951  return __pyx_r;
29952 }
29953 
29954 /* Python wrapper */
29955 static int __pyx_pw_9WaveTools_11RandomWaves_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
29956 static int __pyx_pw_9WaveTools_11RandomWaves_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
29957  int __pyx_r;
29958  __Pyx_RefNannyDeclarations
29959  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
29960  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5depth_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
29961 
29962  /* function exit code */
29963  __Pyx_RefNannyFinishContext();
29964  return __pyx_r;
29965 }
29966 
29967 static int __pyx_pf_9WaveTools_11RandomWaves_5depth_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
29968  int __pyx_r;
29969  __Pyx_RefNannyDeclarations
29970  double __pyx_t_1;
29971  __Pyx_RefNannySetupContext("__set__", 0);
29972  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
29973  __pyx_v_self->depth = __pyx_t_1;
29974 
29975  /* function exit code */
29976  __pyx_r = 0;
29977  goto __pyx_L0;
29978  __pyx_L1_error:;
29979  __Pyx_AddTraceback("WaveTools.RandomWaves.depth.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
29980  __pyx_r = -1;
29981  __pyx_L0:;
29982  __Pyx_RefNannyFinishContext();
29983  return __pyx_r;
29984 }
29985 
29986 /* Python wrapper */
29987 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4gAbs_1__get__(PyObject *__pyx_v_self); /*proto*/
29988 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4gAbs_1__get__(PyObject *__pyx_v_self) {
29989  PyObject *__pyx_r = 0;
29990  __Pyx_RefNannyDeclarations
29991  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
29992  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4gAbs___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
29993 
29994  /* function exit code */
29995  __Pyx_RefNannyFinishContext();
29996  return __pyx_r;
29997 }
29998 
29999 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4gAbs___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30000  PyObject *__pyx_r = NULL;
30001  __Pyx_RefNannyDeclarations
30002  PyObject *__pyx_t_1 = NULL;
30003  __Pyx_RefNannySetupContext("__get__", 0);
30004  __Pyx_XDECREF(__pyx_r);
30005  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30006  __Pyx_GOTREF(__pyx_t_1);
30007  __pyx_r = __pyx_t_1;
30008  __pyx_t_1 = 0;
30009  goto __pyx_L0;
30010 
30011  /* function exit code */
30012  __pyx_L1_error:;
30013  __Pyx_XDECREF(__pyx_t_1);
30014  __Pyx_AddTraceback("WaveTools.RandomWaves.gAbs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30015  __pyx_r = NULL;
30016  __pyx_L0:;
30017  __Pyx_XGIVEREF(__pyx_r);
30018  __Pyx_RefNannyFinishContext();
30019  return __pyx_r;
30020 }
30021 
30022 /* Python wrapper */
30023 static int __pyx_pw_9WaveTools_11RandomWaves_4gAbs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30024 static int __pyx_pw_9WaveTools_11RandomWaves_4gAbs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30025  int __pyx_r;
30026  __Pyx_RefNannyDeclarations
30027  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30028  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4gAbs_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30029 
30030  /* function exit code */
30031  __Pyx_RefNannyFinishContext();
30032  return __pyx_r;
30033 }
30034 
30035 static int __pyx_pf_9WaveTools_11RandomWaves_4gAbs_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30036  int __pyx_r;
30037  __Pyx_RefNannyDeclarations
30038  double __pyx_t_1;
30039  __Pyx_RefNannySetupContext("__set__", 0);
30040  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30041  __pyx_v_self->gAbs = __pyx_t_1;
30042 
30043  /* function exit code */
30044  __pyx_r = 0;
30045  goto __pyx_L0;
30046  __pyx_L1_error:;
30047  __Pyx_AddTraceback("WaveTools.RandomWaves.gAbs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30048  __pyx_r = -1;
30049  __pyx_L0:;
30050  __Pyx_RefNannyFinishContext();
30051  return __pyx_r;
30052 }
30053 
30054 /* Python wrapper */
30055 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4Tlag_1__get__(PyObject *__pyx_v_self); /*proto*/
30056 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4Tlag_1__get__(PyObject *__pyx_v_self) {
30057  PyObject *__pyx_r = 0;
30058  __Pyx_RefNannyDeclarations
30059  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30060  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4Tlag___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30061 
30062  /* function exit code */
30063  __Pyx_RefNannyFinishContext();
30064  return __pyx_r;
30065 }
30066 
30067 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4Tlag___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30068  PyObject *__pyx_r = NULL;
30069  __Pyx_RefNannyDeclarations
30070  PyObject *__pyx_t_1 = NULL;
30071  __Pyx_RefNannySetupContext("__get__", 0);
30072  __Pyx_XDECREF(__pyx_r);
30073  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Tlag); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30074  __Pyx_GOTREF(__pyx_t_1);
30075  __pyx_r = __pyx_t_1;
30076  __pyx_t_1 = 0;
30077  goto __pyx_L0;
30078 
30079  /* function exit code */
30080  __pyx_L1_error:;
30081  __Pyx_XDECREF(__pyx_t_1);
30082  __Pyx_AddTraceback("WaveTools.RandomWaves.Tlag.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30083  __pyx_r = NULL;
30084  __pyx_L0:;
30085  __Pyx_XGIVEREF(__pyx_r);
30086  __Pyx_RefNannyFinishContext();
30087  return __pyx_r;
30088 }
30089 
30090 /* Python wrapper */
30091 static int __pyx_pw_9WaveTools_11RandomWaves_4Tlag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30092 static int __pyx_pw_9WaveTools_11RandomWaves_4Tlag_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30093  int __pyx_r;
30094  __Pyx_RefNannyDeclarations
30095  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30096  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4Tlag_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30097 
30098  /* function exit code */
30099  __Pyx_RefNannyFinishContext();
30100  return __pyx_r;
30101 }
30102 
30103 static int __pyx_pf_9WaveTools_11RandomWaves_4Tlag_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30104  int __pyx_r;
30105  __Pyx_RefNannyDeclarations
30106  double __pyx_t_1;
30107  __Pyx_RefNannySetupContext("__set__", 0);
30108  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30109  __pyx_v_self->Tlag = __pyx_t_1;
30110 
30111  /* function exit code */
30112  __pyx_r = 0;
30113  goto __pyx_L0;
30114  __pyx_L1_error:;
30115  __Pyx_AddTraceback("WaveTools.RandomWaves.Tlag.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30116  __pyx_r = -1;
30117  __pyx_L0:;
30118  __Pyx_RefNannyFinishContext();
30119  return __pyx_r;
30120 }
30121 
30122 /* Python wrapper */
30123 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2Hs_1__get__(PyObject *__pyx_v_self); /*proto*/
30124 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2Hs_1__get__(PyObject *__pyx_v_self) {
30125  PyObject *__pyx_r = 0;
30126  __Pyx_RefNannyDeclarations
30127  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30128  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2Hs___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30129 
30130  /* function exit code */
30131  __Pyx_RefNannyFinishContext();
30132  return __pyx_r;
30133 }
30134 
30135 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2Hs___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30136  PyObject *__pyx_r = NULL;
30137  __Pyx_RefNannyDeclarations
30138  PyObject *__pyx_t_1 = NULL;
30139  __Pyx_RefNannySetupContext("__get__", 0);
30140  __Pyx_XDECREF(__pyx_r);
30141  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Hs); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30142  __Pyx_GOTREF(__pyx_t_1);
30143  __pyx_r = __pyx_t_1;
30144  __pyx_t_1 = 0;
30145  goto __pyx_L0;
30146 
30147  /* function exit code */
30148  __pyx_L1_error:;
30149  __Pyx_XDECREF(__pyx_t_1);
30150  __Pyx_AddTraceback("WaveTools.RandomWaves.Hs.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30151  __pyx_r = NULL;
30152  __pyx_L0:;
30153  __Pyx_XGIVEREF(__pyx_r);
30154  __Pyx_RefNannyFinishContext();
30155  return __pyx_r;
30156 }
30157 
30158 /* Python wrapper */
30159 static int __pyx_pw_9WaveTools_11RandomWaves_2Hs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30160 static int __pyx_pw_9WaveTools_11RandomWaves_2Hs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30161  int __pyx_r;
30162  __Pyx_RefNannyDeclarations
30163  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30164  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2Hs_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30165 
30166  /* function exit code */
30167  __Pyx_RefNannyFinishContext();
30168  return __pyx_r;
30169 }
30170 
30171 static int __pyx_pf_9WaveTools_11RandomWaves_2Hs_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30172  int __pyx_r;
30173  __Pyx_RefNannyDeclarations
30174  double __pyx_t_1;
30175  __Pyx_RefNannySetupContext("__set__", 0);
30176  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30177  __pyx_v_self->Hs = __pyx_t_1;
30178 
30179  /* function exit code */
30180  __pyx_r = 0;
30181  goto __pyx_L0;
30182  __pyx_L1_error:;
30183  __Pyx_AddTraceback("WaveTools.RandomWaves.Hs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30184  __pyx_r = -1;
30185  __pyx_L0:;
30186  __Pyx_RefNannyFinishContext();
30187  return __pyx_r;
30188 }
30189 
30190 /* Python wrapper */
30191 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2Tp_1__get__(PyObject *__pyx_v_self); /*proto*/
30192 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2Tp_1__get__(PyObject *__pyx_v_self) {
30193  PyObject *__pyx_r = 0;
30194  __Pyx_RefNannyDeclarations
30195  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30196  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2Tp___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30197 
30198  /* function exit code */
30199  __Pyx_RefNannyFinishContext();
30200  return __pyx_r;
30201 }
30202 
30203 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2Tp___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30204  PyObject *__pyx_r = NULL;
30205  __Pyx_RefNannyDeclarations
30206  PyObject *__pyx_t_1 = NULL;
30207  __Pyx_RefNannySetupContext("__get__", 0);
30208  __Pyx_XDECREF(__pyx_r);
30209  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->Tp); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30210  __Pyx_GOTREF(__pyx_t_1);
30211  __pyx_r = __pyx_t_1;
30212  __pyx_t_1 = 0;
30213  goto __pyx_L0;
30214 
30215  /* function exit code */
30216  __pyx_L1_error:;
30217  __Pyx_XDECREF(__pyx_t_1);
30218  __Pyx_AddTraceback("WaveTools.RandomWaves.Tp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30219  __pyx_r = NULL;
30220  __pyx_L0:;
30221  __Pyx_XGIVEREF(__pyx_r);
30222  __Pyx_RefNannyFinishContext();
30223  return __pyx_r;
30224 }
30225 
30226 /* Python wrapper */
30227 static int __pyx_pw_9WaveTools_11RandomWaves_2Tp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30228 static int __pyx_pw_9WaveTools_11RandomWaves_2Tp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30229  int __pyx_r;
30230  __Pyx_RefNannyDeclarations
30231  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30232  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2Tp_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30233 
30234  /* function exit code */
30235  __Pyx_RefNannyFinishContext();
30236  return __pyx_r;
30237 }
30238 
30239 static int __pyx_pf_9WaveTools_11RandomWaves_2Tp_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30240  int __pyx_r;
30241  __Pyx_RefNannyDeclarations
30242  double __pyx_t_1;
30243  __Pyx_RefNannySetupContext("__set__", 0);
30244  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30245  __pyx_v_self->Tp = __pyx_t_1;
30246 
30247  /* function exit code */
30248  __pyx_r = 0;
30249  goto __pyx_L0;
30250  __pyx_L1_error:;
30251  __Pyx_AddTraceback("WaveTools.RandomWaves.Tp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30252  __pyx_r = -1;
30253  __pyx_L0:;
30254  __Pyx_RefNannyFinishContext();
30255  return __pyx_r;
30256 }
30257 
30258 /* Python wrapper */
30259 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2fp_1__get__(PyObject *__pyx_v_self); /*proto*/
30260 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2fp_1__get__(PyObject *__pyx_v_self) {
30261  PyObject *__pyx_r = 0;
30262  __Pyx_RefNannyDeclarations
30263  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30264  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2fp___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30265 
30266  /* function exit code */
30267  __Pyx_RefNannyFinishContext();
30268  return __pyx_r;
30269 }
30270 
30271 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2fp___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30272  PyObject *__pyx_r = NULL;
30273  __Pyx_RefNannyDeclarations
30274  PyObject *__pyx_t_1 = NULL;
30275  __Pyx_RefNannySetupContext("__get__", 0);
30276  __Pyx_XDECREF(__pyx_r);
30277  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->fp); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30278  __Pyx_GOTREF(__pyx_t_1);
30279  __pyx_r = __pyx_t_1;
30280  __pyx_t_1 = 0;
30281  goto __pyx_L0;
30282 
30283  /* function exit code */
30284  __pyx_L1_error:;
30285  __Pyx_XDECREF(__pyx_t_1);
30286  __Pyx_AddTraceback("WaveTools.RandomWaves.fp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30287  __pyx_r = NULL;
30288  __pyx_L0:;
30289  __Pyx_XGIVEREF(__pyx_r);
30290  __Pyx_RefNannyFinishContext();
30291  return __pyx_r;
30292 }
30293 
30294 /* Python wrapper */
30295 static int __pyx_pw_9WaveTools_11RandomWaves_2fp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30296 static int __pyx_pw_9WaveTools_11RandomWaves_2fp_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30297  int __pyx_r;
30298  __Pyx_RefNannyDeclarations
30299  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30300  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2fp_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30301 
30302  /* function exit code */
30303  __Pyx_RefNannyFinishContext();
30304  return __pyx_r;
30305 }
30306 
30307 static int __pyx_pf_9WaveTools_11RandomWaves_2fp_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30308  int __pyx_r;
30309  __Pyx_RefNannyDeclarations
30310  double __pyx_t_1;
30311  __Pyx_RefNannySetupContext("__set__", 0);
30312  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30313  __pyx_v_self->fp = __pyx_t_1;
30314 
30315  /* function exit code */
30316  __pyx_r = 0;
30317  goto __pyx_L0;
30318  __pyx_L1_error:;
30319  __Pyx_AddTraceback("WaveTools.RandomWaves.fp.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30320  __pyx_r = -1;
30321  __pyx_L0:;
30322  __Pyx_RefNannyFinishContext();
30323  return __pyx_r;
30324 }
30325 
30326 /* Python wrapper */
30327 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_10bandFactor_1__get__(PyObject *__pyx_v_self); /*proto*/
30328 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_10bandFactor_1__get__(PyObject *__pyx_v_self) {
30329  PyObject *__pyx_r = 0;
30330  __Pyx_RefNannyDeclarations
30331  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30332  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_10bandFactor___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30333 
30334  /* function exit code */
30335  __Pyx_RefNannyFinishContext();
30336  return __pyx_r;
30337 }
30338 
30339 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_10bandFactor___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30340  PyObject *__pyx_r = NULL;
30341  __Pyx_RefNannyDeclarations
30342  PyObject *__pyx_t_1 = NULL;
30343  __Pyx_RefNannySetupContext("__get__", 0);
30344  __Pyx_XDECREF(__pyx_r);
30345  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->bandFactor); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30346  __Pyx_GOTREF(__pyx_t_1);
30347  __pyx_r = __pyx_t_1;
30348  __pyx_t_1 = 0;
30349  goto __pyx_L0;
30350 
30351  /* function exit code */
30352  __pyx_L1_error:;
30353  __Pyx_XDECREF(__pyx_t_1);
30354  __Pyx_AddTraceback("WaveTools.RandomWaves.bandFactor.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30355  __pyx_r = NULL;
30356  __pyx_L0:;
30357  __Pyx_XGIVEREF(__pyx_r);
30358  __Pyx_RefNannyFinishContext();
30359  return __pyx_r;
30360 }
30361 
30362 /* Python wrapper */
30363 static int __pyx_pw_9WaveTools_11RandomWaves_10bandFactor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30364 static int __pyx_pw_9WaveTools_11RandomWaves_10bandFactor_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30365  int __pyx_r;
30366  __Pyx_RefNannyDeclarations
30367  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30368  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_10bandFactor_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30369 
30370  /* function exit code */
30371  __Pyx_RefNannyFinishContext();
30372  return __pyx_r;
30373 }
30374 
30375 static int __pyx_pf_9WaveTools_11RandomWaves_10bandFactor_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30376  int __pyx_r;
30377  __Pyx_RefNannyDeclarations
30378  double __pyx_t_1;
30379  __Pyx_RefNannySetupContext("__set__", 0);
30380  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30381  __pyx_v_self->bandFactor = __pyx_t_1;
30382 
30383  /* function exit code */
30384  __pyx_r = 0;
30385  goto __pyx_L0;
30386  __pyx_L1_error:;
30387  __Pyx_AddTraceback("WaveTools.RandomWaves.bandFactor.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30388  __pyx_r = -1;
30389  __pyx_L0:;
30390  __Pyx_RefNannyFinishContext();
30391  return __pyx_r;
30392 }
30393 
30394 /* Python wrapper */
30395 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2df_1__get__(PyObject *__pyx_v_self); /*proto*/
30396 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2df_1__get__(PyObject *__pyx_v_self) {
30397  PyObject *__pyx_r = 0;
30398  __Pyx_RefNannyDeclarations
30399  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30400  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2df___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30401 
30402  /* function exit code */
30403  __Pyx_RefNannyFinishContext();
30404  return __pyx_r;
30405 }
30406 
30407 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2df___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30408  PyObject *__pyx_r = NULL;
30409  __Pyx_RefNannyDeclarations
30410  PyObject *__pyx_t_1 = NULL;
30411  __Pyx_RefNannySetupContext("__get__", 0);
30412  __Pyx_XDECREF(__pyx_r);
30413  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->df); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30414  __Pyx_GOTREF(__pyx_t_1);
30415  __pyx_r = __pyx_t_1;
30416  __pyx_t_1 = 0;
30417  goto __pyx_L0;
30418 
30419  /* function exit code */
30420  __pyx_L1_error:;
30421  __Pyx_XDECREF(__pyx_t_1);
30422  __Pyx_AddTraceback("WaveTools.RandomWaves.df.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30423  __pyx_r = NULL;
30424  __pyx_L0:;
30425  __Pyx_XGIVEREF(__pyx_r);
30426  __Pyx_RefNannyFinishContext();
30427  return __pyx_r;
30428 }
30429 
30430 /* Python wrapper */
30431 static int __pyx_pw_9WaveTools_11RandomWaves_2df_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30432 static int __pyx_pw_9WaveTools_11RandomWaves_2df_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30433  int __pyx_r;
30434  __Pyx_RefNannyDeclarations
30435  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30436  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2df_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30437 
30438  /* function exit code */
30439  __Pyx_RefNannyFinishContext();
30440  return __pyx_r;
30441 }
30442 
30443 static int __pyx_pf_9WaveTools_11RandomWaves_2df_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30444  int __pyx_r;
30445  __Pyx_RefNannyDeclarations
30446  double __pyx_t_1;
30447  __Pyx_RefNannySetupContext("__set__", 0);
30448  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30449  __pyx_v_self->df = __pyx_t_1;
30450 
30451  /* function exit code */
30452  __pyx_r = 0;
30453  goto __pyx_L0;
30454  __pyx_L1_error:;
30455  __Pyx_AddTraceback("WaveTools.RandomWaves.df.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30456  __pyx_r = -1;
30457  __pyx_L0:;
30458  __Pyx_RefNannyFinishContext();
30459  return __pyx_r;
30460 }
30461 
30462 /* Python wrapper */
30463 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_10wavelength_1__get__(PyObject *__pyx_v_self); /*proto*/
30464 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_10wavelength_1__get__(PyObject *__pyx_v_self) {
30465  PyObject *__pyx_r = 0;
30466  __Pyx_RefNannyDeclarations
30467  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30468  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_10wavelength___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30469 
30470  /* function exit code */
30471  __Pyx_RefNannyFinishContext();
30472  return __pyx_r;
30473 }
30474 
30475 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_10wavelength___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30476  PyObject *__pyx_r = NULL;
30477  __Pyx_RefNannyDeclarations
30478  PyObject *__pyx_t_1 = NULL;
30479  __Pyx_RefNannySetupContext("__get__", 0);
30480  __Pyx_XDECREF(__pyx_r);
30481  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->wavelength); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 123, __pyx_L1_error)
30482  __Pyx_GOTREF(__pyx_t_1);
30483  __pyx_r = __pyx_t_1;
30484  __pyx_t_1 = 0;
30485  goto __pyx_L0;
30486 
30487  /* function exit code */
30488  __pyx_L1_error:;
30489  __Pyx_XDECREF(__pyx_t_1);
30490  __Pyx_AddTraceback("WaveTools.RandomWaves.wavelength.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30491  __pyx_r = NULL;
30492  __pyx_L0:;
30493  __Pyx_XGIVEREF(__pyx_r);
30494  __Pyx_RefNannyFinishContext();
30495  return __pyx_r;
30496 }
30497 
30498 /* Python wrapper */
30499 static int __pyx_pw_9WaveTools_11RandomWaves_10wavelength_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30500 static int __pyx_pw_9WaveTools_11RandomWaves_10wavelength_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30501  int __pyx_r;
30502  __Pyx_RefNannyDeclarations
30503  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30504  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_10wavelength_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30505 
30506  /* function exit code */
30507  __Pyx_RefNannyFinishContext();
30508  return __pyx_r;
30509 }
30510 
30511 static int __pyx_pf_9WaveTools_11RandomWaves_10wavelength_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30512  int __pyx_r;
30513  __Pyx_RefNannyDeclarations
30514  double __pyx_t_1;
30515  __Pyx_RefNannySetupContext("__set__", 0);
30516  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 123, __pyx_L1_error)
30517  __pyx_v_self->wavelength = __pyx_t_1;
30518 
30519  /* function exit code */
30520  __pyx_r = 0;
30521  goto __pyx_L0;
30522  __pyx_L1_error:;
30523  __Pyx_AddTraceback("WaveTools.RandomWaves.wavelength.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30524  __pyx_r = -1;
30525  __pyx_L0:;
30526  __Pyx_RefNannyFinishContext();
30527  return __pyx_r;
30528 }
30529 
30530 /* "WaveTools.pxd":124
30531  * cdef public:
30532  * double mwl,depth,gAbs,Tlag,Hs,Tp,fp,bandFactor,df,wavelength
30533  * int N # <<<<<<<<<<<<<<
30534  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai
30535  * cdef object phi
30536  */
30537 
30538 /* Python wrapper */
30539 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_1N_1__get__(PyObject *__pyx_v_self); /*proto*/
30540 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_1N_1__get__(PyObject *__pyx_v_self) {
30541  PyObject *__pyx_r = 0;
30542  __Pyx_RefNannyDeclarations
30543  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30544  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_1N___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30545 
30546  /* function exit code */
30547  __Pyx_RefNannyFinishContext();
30548  return __pyx_r;
30549 }
30550 
30551 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_1N___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30552  PyObject *__pyx_r = NULL;
30553  __Pyx_RefNannyDeclarations
30554  PyObject *__pyx_t_1 = NULL;
30555  __Pyx_RefNannySetupContext("__get__", 0);
30556  __Pyx_XDECREF(__pyx_r);
30557  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 124, __pyx_L1_error)
30558  __Pyx_GOTREF(__pyx_t_1);
30559  __pyx_r = __pyx_t_1;
30560  __pyx_t_1 = 0;
30561  goto __pyx_L0;
30562 
30563  /* function exit code */
30564  __pyx_L1_error:;
30565  __Pyx_XDECREF(__pyx_t_1);
30566  __Pyx_AddTraceback("WaveTools.RandomWaves.N.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30567  __pyx_r = NULL;
30568  __pyx_L0:;
30569  __Pyx_XGIVEREF(__pyx_r);
30570  __Pyx_RefNannyFinishContext();
30571  return __pyx_r;
30572 }
30573 
30574 /* Python wrapper */
30575 static int __pyx_pw_9WaveTools_11RandomWaves_1N_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30576 static int __pyx_pw_9WaveTools_11RandomWaves_1N_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30577  int __pyx_r;
30578  __Pyx_RefNannyDeclarations
30579  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30580  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_1N_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30581 
30582  /* function exit code */
30583  __Pyx_RefNannyFinishContext();
30584  return __pyx_r;
30585 }
30586 
30587 static int __pyx_pf_9WaveTools_11RandomWaves_1N_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30588  int __pyx_r;
30589  __Pyx_RefNannyDeclarations
30590  int __pyx_t_1;
30591  __Pyx_RefNannySetupContext("__set__", 0);
30592  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 124, __pyx_L1_error)
30593  __pyx_v_self->N = __pyx_t_1;
30594 
30595  /* function exit code */
30596  __pyx_r = 0;
30597  goto __pyx_L0;
30598  __pyx_L1_error:;
30599  __Pyx_AddTraceback("WaveTools.RandomWaves.N.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30600  __pyx_r = -1;
30601  __pyx_L0:;
30602  __Pyx_RefNannyFinishContext();
30603  return __pyx_r;
30604 }
30605 
30606 /* "WaveTools.pxd":125
30607  * double mwl,depth,gAbs,Tlag,Hs,Tp,fp,bandFactor,df,wavelength
30608  * int N
30609  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai # <<<<<<<<<<<<<<
30610  * cdef object phi
30611  * cdef double _cpp_eta(self , double* x, double t)
30612  */
30613 
30614 /* Python wrapper */
30615 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2fi_1__get__(PyObject *__pyx_v_self); /*proto*/
30616 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2fi_1__get__(PyObject *__pyx_v_self) {
30617  PyObject *__pyx_r = 0;
30618  __Pyx_RefNannyDeclarations
30619  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30620  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2fi___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30621 
30622  /* function exit code */
30623  __Pyx_RefNannyFinishContext();
30624  return __pyx_r;
30625 }
30626 
30627 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2fi___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30628  PyObject *__pyx_r = NULL;
30629  __Pyx_RefNannyDeclarations
30630  __Pyx_RefNannySetupContext("__get__", 0);
30631  __Pyx_XDECREF(__pyx_r);
30632  __Pyx_INCREF(((PyObject *)__pyx_v_self->fi));
30633  __pyx_r = ((PyObject *)__pyx_v_self->fi);
30634  goto __pyx_L0;
30635 
30636  /* function exit code */
30637  __pyx_L0:;
30638  __Pyx_XGIVEREF(__pyx_r);
30639  __Pyx_RefNannyFinishContext();
30640  return __pyx_r;
30641 }
30642 
30643 /* Python wrapper */
30644 static int __pyx_pw_9WaveTools_11RandomWaves_2fi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30645 static int __pyx_pw_9WaveTools_11RandomWaves_2fi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30646  int __pyx_r;
30647  __Pyx_RefNannyDeclarations
30648  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30649  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2fi_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30650 
30651  /* function exit code */
30652  __Pyx_RefNannyFinishContext();
30653  return __pyx_r;
30654 }
30655 
30656 static int __pyx_pf_9WaveTools_11RandomWaves_2fi_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30657  int __pyx_r;
30658  __Pyx_RefNannyDeclarations
30659  PyObject *__pyx_t_1 = NULL;
30660  __Pyx_RefNannySetupContext("__set__", 0);
30661  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
30662  __pyx_t_1 = __pyx_v_value;
30663  __Pyx_INCREF(__pyx_t_1);
30664  __Pyx_GIVEREF(__pyx_t_1);
30665  __Pyx_GOTREF(__pyx_v_self->fi);
30666  __Pyx_DECREF(((PyObject *)__pyx_v_self->fi));
30667  __pyx_v_self->fi = ((PyArrayObject *)__pyx_t_1);
30668  __pyx_t_1 = 0;
30669 
30670  /* function exit code */
30671  __pyx_r = 0;
30672  goto __pyx_L0;
30673  __pyx_L1_error:;
30674  __Pyx_XDECREF(__pyx_t_1);
30675  __Pyx_AddTraceback("WaveTools.RandomWaves.fi.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30676  __pyx_r = -1;
30677  __pyx_L0:;
30678  __Pyx_RefNannyFinishContext();
30679  return __pyx_r;
30680 }
30681 
30682 /* Python wrapper */
30683 static int __pyx_pw_9WaveTools_11RandomWaves_2fi_5__del__(PyObject *__pyx_v_self); /*proto*/
30684 static int __pyx_pw_9WaveTools_11RandomWaves_2fi_5__del__(PyObject *__pyx_v_self) {
30685  int __pyx_r;
30686  __Pyx_RefNannyDeclarations
30687  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
30688  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2fi_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30689 
30690  /* function exit code */
30691  __Pyx_RefNannyFinishContext();
30692  return __pyx_r;
30693 }
30694 
30695 static int __pyx_pf_9WaveTools_11RandomWaves_2fi_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30696  int __pyx_r;
30697  __Pyx_RefNannyDeclarations
30698  __Pyx_RefNannySetupContext("__del__", 0);
30699  __Pyx_INCREF(Py_None);
30700  __Pyx_GIVEREF(Py_None);
30701  __Pyx_GOTREF(__pyx_v_self->fi);
30702  __Pyx_DECREF(((PyObject *)__pyx_v_self->fi));
30703  __pyx_v_self->fi = ((PyArrayObject *)Py_None);
30704 
30705  /* function exit code */
30706  __pyx_r = 0;
30707  __Pyx_RefNannyFinishContext();
30708  return __pyx_r;
30709 }
30710 
30711 /* Python wrapper */
30712 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3fim_1__get__(PyObject *__pyx_v_self); /*proto*/
30713 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3fim_1__get__(PyObject *__pyx_v_self) {
30714  PyObject *__pyx_r = 0;
30715  __Pyx_RefNannyDeclarations
30716  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30717  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3fim___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30718 
30719  /* function exit code */
30720  __Pyx_RefNannyFinishContext();
30721  return __pyx_r;
30722 }
30723 
30724 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_3fim___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30725  PyObject *__pyx_r = NULL;
30726  __Pyx_RefNannyDeclarations
30727  __Pyx_RefNannySetupContext("__get__", 0);
30728  __Pyx_XDECREF(__pyx_r);
30729  __Pyx_INCREF(((PyObject *)__pyx_v_self->fim));
30730  __pyx_r = ((PyObject *)__pyx_v_self->fim);
30731  goto __pyx_L0;
30732 
30733  /* function exit code */
30734  __pyx_L0:;
30735  __Pyx_XGIVEREF(__pyx_r);
30736  __Pyx_RefNannyFinishContext();
30737  return __pyx_r;
30738 }
30739 
30740 /* Python wrapper */
30741 static int __pyx_pw_9WaveTools_11RandomWaves_3fim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30742 static int __pyx_pw_9WaveTools_11RandomWaves_3fim_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30743  int __pyx_r;
30744  __Pyx_RefNannyDeclarations
30745  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30746  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3fim_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30747 
30748  /* function exit code */
30749  __Pyx_RefNannyFinishContext();
30750  return __pyx_r;
30751 }
30752 
30753 static int __pyx_pf_9WaveTools_11RandomWaves_3fim_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30754  int __pyx_r;
30755  __Pyx_RefNannyDeclarations
30756  PyObject *__pyx_t_1 = NULL;
30757  __Pyx_RefNannySetupContext("__set__", 0);
30758  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
30759  __pyx_t_1 = __pyx_v_value;
30760  __Pyx_INCREF(__pyx_t_1);
30761  __Pyx_GIVEREF(__pyx_t_1);
30762  __Pyx_GOTREF(__pyx_v_self->fim);
30763  __Pyx_DECREF(((PyObject *)__pyx_v_self->fim));
30764  __pyx_v_self->fim = ((PyArrayObject *)__pyx_t_1);
30765  __pyx_t_1 = 0;
30766 
30767  /* function exit code */
30768  __pyx_r = 0;
30769  goto __pyx_L0;
30770  __pyx_L1_error:;
30771  __Pyx_XDECREF(__pyx_t_1);
30772  __Pyx_AddTraceback("WaveTools.RandomWaves.fim.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30773  __pyx_r = -1;
30774  __pyx_L0:;
30775  __Pyx_RefNannyFinishContext();
30776  return __pyx_r;
30777 }
30778 
30779 /* Python wrapper */
30780 static int __pyx_pw_9WaveTools_11RandomWaves_3fim_5__del__(PyObject *__pyx_v_self); /*proto*/
30781 static int __pyx_pw_9WaveTools_11RandomWaves_3fim_5__del__(PyObject *__pyx_v_self) {
30782  int __pyx_r;
30783  __Pyx_RefNannyDeclarations
30784  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
30785  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3fim_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30786 
30787  /* function exit code */
30788  __Pyx_RefNannyFinishContext();
30789  return __pyx_r;
30790 }
30791 
30792 static int __pyx_pf_9WaveTools_11RandomWaves_3fim_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30793  int __pyx_r;
30794  __Pyx_RefNannyDeclarations
30795  __Pyx_RefNannySetupContext("__del__", 0);
30796  __Pyx_INCREF(Py_None);
30797  __Pyx_GIVEREF(Py_None);
30798  __Pyx_GOTREF(__pyx_v_self->fim);
30799  __Pyx_DECREF(((PyObject *)__pyx_v_self->fim));
30800  __pyx_v_self->fim = ((PyArrayObject *)Py_None);
30801 
30802  /* function exit code */
30803  __pyx_r = 0;
30804  __Pyx_RefNannyFinishContext();
30805  return __pyx_r;
30806 }
30807 
30808 /* Python wrapper */
30809 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_1__get__(PyObject *__pyx_v_self); /*proto*/
30810 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_1__get__(PyObject *__pyx_v_self) {
30811  PyObject *__pyx_r = 0;
30812  __Pyx_RefNannyDeclarations
30813  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30814  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30815 
30816  /* function exit code */
30817  __Pyx_RefNannyFinishContext();
30818  return __pyx_r;
30819 }
30820 
30821 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5Si_Jm___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30822  PyObject *__pyx_r = NULL;
30823  __Pyx_RefNannyDeclarations
30824  __Pyx_RefNannySetupContext("__get__", 0);
30825  __Pyx_XDECREF(__pyx_r);
30826  __Pyx_INCREF(((PyObject *)__pyx_v_self->Si_Jm));
30827  __pyx_r = ((PyObject *)__pyx_v_self->Si_Jm);
30828  goto __pyx_L0;
30829 
30830  /* function exit code */
30831  __pyx_L0:;
30832  __Pyx_XGIVEREF(__pyx_r);
30833  __Pyx_RefNannyFinishContext();
30834  return __pyx_r;
30835 }
30836 
30837 /* Python wrapper */
30838 static int __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30839 static int __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30840  int __pyx_r;
30841  __Pyx_RefNannyDeclarations
30842  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30843  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30844 
30845  /* function exit code */
30846  __Pyx_RefNannyFinishContext();
30847  return __pyx_r;
30848 }
30849 
30850 static int __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30851  int __pyx_r;
30852  __Pyx_RefNannyDeclarations
30853  PyObject *__pyx_t_1 = NULL;
30854  __Pyx_RefNannySetupContext("__set__", 0);
30855  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
30856  __pyx_t_1 = __pyx_v_value;
30857  __Pyx_INCREF(__pyx_t_1);
30858  __Pyx_GIVEREF(__pyx_t_1);
30859  __Pyx_GOTREF(__pyx_v_self->Si_Jm);
30860  __Pyx_DECREF(((PyObject *)__pyx_v_self->Si_Jm));
30861  __pyx_v_self->Si_Jm = ((PyArrayObject *)__pyx_t_1);
30862  __pyx_t_1 = 0;
30863 
30864  /* function exit code */
30865  __pyx_r = 0;
30866  goto __pyx_L0;
30867  __pyx_L1_error:;
30868  __Pyx_XDECREF(__pyx_t_1);
30869  __Pyx_AddTraceback("WaveTools.RandomWaves.Si_Jm.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30870  __pyx_r = -1;
30871  __pyx_L0:;
30872  __Pyx_RefNannyFinishContext();
30873  return __pyx_r;
30874 }
30875 
30876 /* Python wrapper */
30877 static int __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_5__del__(PyObject *__pyx_v_self); /*proto*/
30878 static int __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_5__del__(PyObject *__pyx_v_self) {
30879  int __pyx_r;
30880  __Pyx_RefNannyDeclarations
30881  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
30882  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30883 
30884  /* function exit code */
30885  __Pyx_RefNannyFinishContext();
30886  return __pyx_r;
30887 }
30888 
30889 static int __pyx_pf_9WaveTools_11RandomWaves_5Si_Jm_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30890  int __pyx_r;
30891  __Pyx_RefNannyDeclarations
30892  __Pyx_RefNannySetupContext("__del__", 0);
30893  __Pyx_INCREF(Py_None);
30894  __Pyx_GIVEREF(Py_None);
30895  __Pyx_GOTREF(__pyx_v_self->Si_Jm);
30896  __Pyx_DECREF(((PyObject *)__pyx_v_self->Si_Jm));
30897  __pyx_v_self->Si_Jm = ((PyArrayObject *)Py_None);
30898 
30899  /* function exit code */
30900  __pyx_r = 0;
30901  __Pyx_RefNannyFinishContext();
30902  return __pyx_r;
30903 }
30904 
30905 /* Python wrapper */
30906 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2ki_1__get__(PyObject *__pyx_v_self); /*proto*/
30907 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2ki_1__get__(PyObject *__pyx_v_self) {
30908  PyObject *__pyx_r = 0;
30909  __Pyx_RefNannyDeclarations
30910  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
30911  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2ki___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30912 
30913  /* function exit code */
30914  __Pyx_RefNannyFinishContext();
30915  return __pyx_r;
30916 }
30917 
30918 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2ki___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30919  PyObject *__pyx_r = NULL;
30920  __Pyx_RefNannyDeclarations
30921  __Pyx_RefNannySetupContext("__get__", 0);
30922  __Pyx_XDECREF(__pyx_r);
30923  __Pyx_INCREF(((PyObject *)__pyx_v_self->ki));
30924  __pyx_r = ((PyObject *)__pyx_v_self->ki);
30925  goto __pyx_L0;
30926 
30927  /* function exit code */
30928  __pyx_L0:;
30929  __Pyx_XGIVEREF(__pyx_r);
30930  __Pyx_RefNannyFinishContext();
30931  return __pyx_r;
30932 }
30933 
30934 /* Python wrapper */
30935 static int __pyx_pw_9WaveTools_11RandomWaves_2ki_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
30936 static int __pyx_pw_9WaveTools_11RandomWaves_2ki_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
30937  int __pyx_r;
30938  __Pyx_RefNannyDeclarations
30939  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
30940  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2ki_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
30941 
30942  /* function exit code */
30943  __Pyx_RefNannyFinishContext();
30944  return __pyx_r;
30945 }
30946 
30947 static int __pyx_pf_9WaveTools_11RandomWaves_2ki_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
30948  int __pyx_r;
30949  __Pyx_RefNannyDeclarations
30950  PyObject *__pyx_t_1 = NULL;
30951  __Pyx_RefNannySetupContext("__set__", 0);
30952  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
30953  __pyx_t_1 = __pyx_v_value;
30954  __Pyx_INCREF(__pyx_t_1);
30955  __Pyx_GIVEREF(__pyx_t_1);
30956  __Pyx_GOTREF(__pyx_v_self->ki);
30957  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
30958  __pyx_v_self->ki = ((PyArrayObject *)__pyx_t_1);
30959  __pyx_t_1 = 0;
30960 
30961  /* function exit code */
30962  __pyx_r = 0;
30963  goto __pyx_L0;
30964  __pyx_L1_error:;
30965  __Pyx_XDECREF(__pyx_t_1);
30966  __Pyx_AddTraceback("WaveTools.RandomWaves.ki.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
30967  __pyx_r = -1;
30968  __pyx_L0:;
30969  __Pyx_RefNannyFinishContext();
30970  return __pyx_r;
30971 }
30972 
30973 /* Python wrapper */
30974 static int __pyx_pw_9WaveTools_11RandomWaves_2ki_5__del__(PyObject *__pyx_v_self); /*proto*/
30975 static int __pyx_pw_9WaveTools_11RandomWaves_2ki_5__del__(PyObject *__pyx_v_self) {
30976  int __pyx_r;
30977  __Pyx_RefNannyDeclarations
30978  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
30979  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2ki_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
30980 
30981  /* function exit code */
30982  __Pyx_RefNannyFinishContext();
30983  return __pyx_r;
30984 }
30985 
30986 static int __pyx_pf_9WaveTools_11RandomWaves_2ki_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
30987  int __pyx_r;
30988  __Pyx_RefNannyDeclarations
30989  __Pyx_RefNannySetupContext("__del__", 0);
30990  __Pyx_INCREF(Py_None);
30991  __Pyx_GIVEREF(Py_None);
30992  __Pyx_GOTREF(__pyx_v_self->ki);
30993  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
30994  __pyx_v_self->ki = ((PyArrayObject *)Py_None);
30995 
30996  /* function exit code */
30997  __pyx_r = 0;
30998  __Pyx_RefNannyFinishContext();
30999  return __pyx_r;
31000 }
31001 
31002 /* Python wrapper */
31003 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5omega_1__get__(PyObject *__pyx_v_self); /*proto*/
31004 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5omega_1__get__(PyObject *__pyx_v_self) {
31005  PyObject *__pyx_r = 0;
31006  __Pyx_RefNannyDeclarations
31007  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31008  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5omega___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31009 
31010  /* function exit code */
31011  __Pyx_RefNannyFinishContext();
31012  return __pyx_r;
31013 }
31014 
31015 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5omega___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31016  PyObject *__pyx_r = NULL;
31017  __Pyx_RefNannyDeclarations
31018  __Pyx_RefNannySetupContext("__get__", 0);
31019  __Pyx_XDECREF(__pyx_r);
31020  __Pyx_INCREF(((PyObject *)__pyx_v_self->omega));
31021  __pyx_r = ((PyObject *)__pyx_v_self->omega);
31022  goto __pyx_L0;
31023 
31024  /* function exit code */
31025  __pyx_L0:;
31026  __Pyx_XGIVEREF(__pyx_r);
31027  __Pyx_RefNannyFinishContext();
31028  return __pyx_r;
31029 }
31030 
31031 /* Python wrapper */
31032 static int __pyx_pw_9WaveTools_11RandomWaves_5omega_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31033 static int __pyx_pw_9WaveTools_11RandomWaves_5omega_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31034  int __pyx_r;
31035  __Pyx_RefNannyDeclarations
31036  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31037  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5omega_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31038 
31039  /* function exit code */
31040  __Pyx_RefNannyFinishContext();
31041  return __pyx_r;
31042 }
31043 
31044 static int __pyx_pf_9WaveTools_11RandomWaves_5omega_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31045  int __pyx_r;
31046  __Pyx_RefNannyDeclarations
31047  PyObject *__pyx_t_1 = NULL;
31048  __Pyx_RefNannySetupContext("__set__", 0);
31049  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31050  __pyx_t_1 = __pyx_v_value;
31051  __Pyx_INCREF(__pyx_t_1);
31052  __Pyx_GIVEREF(__pyx_t_1);
31053  __Pyx_GOTREF(__pyx_v_self->omega);
31054  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
31055  __pyx_v_self->omega = ((PyArrayObject *)__pyx_t_1);
31056  __pyx_t_1 = 0;
31057 
31058  /* function exit code */
31059  __pyx_r = 0;
31060  goto __pyx_L0;
31061  __pyx_L1_error:;
31062  __Pyx_XDECREF(__pyx_t_1);
31063  __Pyx_AddTraceback("WaveTools.RandomWaves.omega.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31064  __pyx_r = -1;
31065  __pyx_L0:;
31066  __Pyx_RefNannyFinishContext();
31067  return __pyx_r;
31068 }
31069 
31070 /* Python wrapper */
31071 static int __pyx_pw_9WaveTools_11RandomWaves_5omega_5__del__(PyObject *__pyx_v_self); /*proto*/
31072 static int __pyx_pw_9WaveTools_11RandomWaves_5omega_5__del__(PyObject *__pyx_v_self) {
31073  int __pyx_r;
31074  __Pyx_RefNannyDeclarations
31075  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31076  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5omega_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31077 
31078  /* function exit code */
31079  __Pyx_RefNannyFinishContext();
31080  return __pyx_r;
31081 }
31082 
31083 static int __pyx_pf_9WaveTools_11RandomWaves_5omega_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31084  int __pyx_r;
31085  __Pyx_RefNannyDeclarations
31086  __Pyx_RefNannySetupContext("__del__", 0);
31087  __Pyx_INCREF(Py_None);
31088  __Pyx_GIVEREF(Py_None);
31089  __Pyx_GOTREF(__pyx_v_self->omega);
31090  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
31091  __pyx_v_self->omega = ((PyArrayObject *)Py_None);
31092 
31093  /* function exit code */
31094  __pyx_r = 0;
31095  __Pyx_RefNannyFinishContext();
31096  return __pyx_r;
31097 }
31098 
31099 /* Python wrapper */
31100 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5tanhF_1__get__(PyObject *__pyx_v_self); /*proto*/
31101 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_5tanhF_1__get__(PyObject *__pyx_v_self) {
31102  PyObject *__pyx_r = 0;
31103  __Pyx_RefNannyDeclarations
31104  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31105  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5tanhF___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31106 
31107  /* function exit code */
31108  __Pyx_RefNannyFinishContext();
31109  return __pyx_r;
31110 }
31111 
31112 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_5tanhF___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31113  PyObject *__pyx_r = NULL;
31114  __Pyx_RefNannyDeclarations
31115  __Pyx_RefNannySetupContext("__get__", 0);
31116  __Pyx_XDECREF(__pyx_r);
31117  __Pyx_INCREF(((PyObject *)__pyx_v_self->tanhF));
31118  __pyx_r = ((PyObject *)__pyx_v_self->tanhF);
31119  goto __pyx_L0;
31120 
31121  /* function exit code */
31122  __pyx_L0:;
31123  __Pyx_XGIVEREF(__pyx_r);
31124  __Pyx_RefNannyFinishContext();
31125  return __pyx_r;
31126 }
31127 
31128 /* Python wrapper */
31129 static int __pyx_pw_9WaveTools_11RandomWaves_5tanhF_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31130 static int __pyx_pw_9WaveTools_11RandomWaves_5tanhF_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31131  int __pyx_r;
31132  __Pyx_RefNannyDeclarations
31133  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31134  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5tanhF_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31135 
31136  /* function exit code */
31137  __Pyx_RefNannyFinishContext();
31138  return __pyx_r;
31139 }
31140 
31141 static int __pyx_pf_9WaveTools_11RandomWaves_5tanhF_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31142  int __pyx_r;
31143  __Pyx_RefNannyDeclarations
31144  PyObject *__pyx_t_1 = NULL;
31145  __Pyx_RefNannySetupContext("__set__", 0);
31146  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31147  __pyx_t_1 = __pyx_v_value;
31148  __Pyx_INCREF(__pyx_t_1);
31149  __Pyx_GIVEREF(__pyx_t_1);
31150  __Pyx_GOTREF(__pyx_v_self->tanhF);
31151  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
31152  __pyx_v_self->tanhF = ((PyArrayObject *)__pyx_t_1);
31153  __pyx_t_1 = 0;
31154 
31155  /* function exit code */
31156  __pyx_r = 0;
31157  goto __pyx_L0;
31158  __pyx_L1_error:;
31159  __Pyx_XDECREF(__pyx_t_1);
31160  __Pyx_AddTraceback("WaveTools.RandomWaves.tanhF.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31161  __pyx_r = -1;
31162  __pyx_L0:;
31163  __Pyx_RefNannyFinishContext();
31164  return __pyx_r;
31165 }
31166 
31167 /* Python wrapper */
31168 static int __pyx_pw_9WaveTools_11RandomWaves_5tanhF_5__del__(PyObject *__pyx_v_self); /*proto*/
31169 static int __pyx_pw_9WaveTools_11RandomWaves_5tanhF_5__del__(PyObject *__pyx_v_self) {
31170  int __pyx_r;
31171  __Pyx_RefNannyDeclarations
31172  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31173  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_5tanhF_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31174 
31175  /* function exit code */
31176  __Pyx_RefNannyFinishContext();
31177  return __pyx_r;
31178 }
31179 
31180 static int __pyx_pf_9WaveTools_11RandomWaves_5tanhF_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31181  int __pyx_r;
31182  __Pyx_RefNannyDeclarations
31183  __Pyx_RefNannySetupContext("__del__", 0);
31184  __Pyx_INCREF(Py_None);
31185  __Pyx_GIVEREF(Py_None);
31186  __Pyx_GOTREF(__pyx_v_self->tanhF);
31187  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
31188  __pyx_v_self->tanhF = ((PyArrayObject *)Py_None);
31189 
31190  /* function exit code */
31191  __pyx_r = 0;
31192  __Pyx_RefNannyFinishContext();
31193  return __pyx_r;
31194 }
31195 
31196 /* Python wrapper */
31197 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_1g_1__get__(PyObject *__pyx_v_self); /*proto*/
31198 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_1g_1__get__(PyObject *__pyx_v_self) {
31199  PyObject *__pyx_r = 0;
31200  __Pyx_RefNannyDeclarations
31201  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31202  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_1g___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31203 
31204  /* function exit code */
31205  __Pyx_RefNannyFinishContext();
31206  return __pyx_r;
31207 }
31208 
31209 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_1g___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31210  PyObject *__pyx_r = NULL;
31211  __Pyx_RefNannyDeclarations
31212  __Pyx_RefNannySetupContext("__get__", 0);
31213  __Pyx_XDECREF(__pyx_r);
31214  __Pyx_INCREF(((PyObject *)__pyx_v_self->g));
31215  __pyx_r = ((PyObject *)__pyx_v_self->g);
31216  goto __pyx_L0;
31217 
31218  /* function exit code */
31219  __pyx_L0:;
31220  __Pyx_XGIVEREF(__pyx_r);
31221  __Pyx_RefNannyFinishContext();
31222  return __pyx_r;
31223 }
31224 
31225 /* Python wrapper */
31226 static int __pyx_pw_9WaveTools_11RandomWaves_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31227 static int __pyx_pw_9WaveTools_11RandomWaves_1g_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31228  int __pyx_r;
31229  __Pyx_RefNannyDeclarations
31230  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31231  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_1g_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31232 
31233  /* function exit code */
31234  __Pyx_RefNannyFinishContext();
31235  return __pyx_r;
31236 }
31237 
31238 static int __pyx_pf_9WaveTools_11RandomWaves_1g_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31239  int __pyx_r;
31240  __Pyx_RefNannyDeclarations
31241  PyObject *__pyx_t_1 = NULL;
31242  __Pyx_RefNannySetupContext("__set__", 0);
31243  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31244  __pyx_t_1 = __pyx_v_value;
31245  __Pyx_INCREF(__pyx_t_1);
31246  __Pyx_GIVEREF(__pyx_t_1);
31247  __Pyx_GOTREF(__pyx_v_self->g);
31248  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
31249  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_1);
31250  __pyx_t_1 = 0;
31251 
31252  /* function exit code */
31253  __pyx_r = 0;
31254  goto __pyx_L0;
31255  __pyx_L1_error:;
31256  __Pyx_XDECREF(__pyx_t_1);
31257  __Pyx_AddTraceback("WaveTools.RandomWaves.g.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31258  __pyx_r = -1;
31259  __pyx_L0:;
31260  __Pyx_RefNannyFinishContext();
31261  return __pyx_r;
31262 }
31263 
31264 /* Python wrapper */
31265 static int __pyx_pw_9WaveTools_11RandomWaves_1g_5__del__(PyObject *__pyx_v_self); /*proto*/
31266 static int __pyx_pw_9WaveTools_11RandomWaves_1g_5__del__(PyObject *__pyx_v_self) {
31267  int __pyx_r;
31268  __Pyx_RefNannyDeclarations
31269  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31270  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_1g_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31271 
31272  /* function exit code */
31273  __Pyx_RefNannyFinishContext();
31274  return __pyx_r;
31275 }
31276 
31277 static int __pyx_pf_9WaveTools_11RandomWaves_1g_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31278  int __pyx_r;
31279  __Pyx_RefNannyDeclarations
31280  __Pyx_RefNannySetupContext("__del__", 0);
31281  __Pyx_INCREF(Py_None);
31282  __Pyx_GIVEREF(Py_None);
31283  __Pyx_GOTREF(__pyx_v_self->g);
31284  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
31285  __pyx_v_self->g = ((PyArrayObject *)Py_None);
31286 
31287  /* function exit code */
31288  __pyx_r = 0;
31289  __Pyx_RefNannyFinishContext();
31290  return __pyx_r;
31291 }
31292 
31293 /* Python wrapper */
31294 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_7waveDir_1__get__(PyObject *__pyx_v_self); /*proto*/
31295 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_7waveDir_1__get__(PyObject *__pyx_v_self) {
31296  PyObject *__pyx_r = 0;
31297  __Pyx_RefNannyDeclarations
31298  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31299  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_7waveDir___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31300 
31301  /* function exit code */
31302  __Pyx_RefNannyFinishContext();
31303  return __pyx_r;
31304 }
31305 
31306 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_7waveDir___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31307  PyObject *__pyx_r = NULL;
31308  __Pyx_RefNannyDeclarations
31309  __Pyx_RefNannySetupContext("__get__", 0);
31310  __Pyx_XDECREF(__pyx_r);
31311  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
31312  __pyx_r = ((PyObject *)__pyx_v_self->waveDir);
31313  goto __pyx_L0;
31314 
31315  /* function exit code */
31316  __pyx_L0:;
31317  __Pyx_XGIVEREF(__pyx_r);
31318  __Pyx_RefNannyFinishContext();
31319  return __pyx_r;
31320 }
31321 
31322 /* Python wrapper */
31323 static int __pyx_pw_9WaveTools_11RandomWaves_7waveDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31324 static int __pyx_pw_9WaveTools_11RandomWaves_7waveDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31325  int __pyx_r;
31326  __Pyx_RefNannyDeclarations
31327  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31328  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_7waveDir_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31329 
31330  /* function exit code */
31331  __Pyx_RefNannyFinishContext();
31332  return __pyx_r;
31333 }
31334 
31335 static int __pyx_pf_9WaveTools_11RandomWaves_7waveDir_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31336  int __pyx_r;
31337  __Pyx_RefNannyDeclarations
31338  PyObject *__pyx_t_1 = NULL;
31339  __Pyx_RefNannySetupContext("__set__", 0);
31340  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31341  __pyx_t_1 = __pyx_v_value;
31342  __Pyx_INCREF(__pyx_t_1);
31343  __Pyx_GIVEREF(__pyx_t_1);
31344  __Pyx_GOTREF(__pyx_v_self->waveDir);
31345  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
31346  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_1);
31347  __pyx_t_1 = 0;
31348 
31349  /* function exit code */
31350  __pyx_r = 0;
31351  goto __pyx_L0;
31352  __pyx_L1_error:;
31353  __Pyx_XDECREF(__pyx_t_1);
31354  __Pyx_AddTraceback("WaveTools.RandomWaves.waveDir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31355  __pyx_r = -1;
31356  __pyx_L0:;
31357  __Pyx_RefNannyFinishContext();
31358  return __pyx_r;
31359 }
31360 
31361 /* Python wrapper */
31362 static int __pyx_pw_9WaveTools_11RandomWaves_7waveDir_5__del__(PyObject *__pyx_v_self); /*proto*/
31363 static int __pyx_pw_9WaveTools_11RandomWaves_7waveDir_5__del__(PyObject *__pyx_v_self) {
31364  int __pyx_r;
31365  __Pyx_RefNannyDeclarations
31366  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31367  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_7waveDir_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31368 
31369  /* function exit code */
31370  __Pyx_RefNannyFinishContext();
31371  return __pyx_r;
31372 }
31373 
31374 static int __pyx_pf_9WaveTools_11RandomWaves_7waveDir_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31375  int __pyx_r;
31376  __Pyx_RefNannyDeclarations
31377  __Pyx_RefNannySetupContext("__del__", 0);
31378  __Pyx_INCREF(Py_None);
31379  __Pyx_GIVEREF(Py_None);
31380  __Pyx_GOTREF(__pyx_v_self->waveDir);
31381  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
31382  __pyx_v_self->waveDir = ((PyArrayObject *)Py_None);
31383 
31384  /* function exit code */
31385  __pyx_r = 0;
31386  __Pyx_RefNannyFinishContext();
31387  return __pyx_r;
31388 }
31389 
31390 /* Python wrapper */
31391 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4vDir_1__get__(PyObject *__pyx_v_self); /*proto*/
31392 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4vDir_1__get__(PyObject *__pyx_v_self) {
31393  PyObject *__pyx_r = 0;
31394  __Pyx_RefNannyDeclarations
31395  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31396  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4vDir___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31397 
31398  /* function exit code */
31399  __Pyx_RefNannyFinishContext();
31400  return __pyx_r;
31401 }
31402 
31403 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4vDir___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31404  PyObject *__pyx_r = NULL;
31405  __Pyx_RefNannyDeclarations
31406  __Pyx_RefNannySetupContext("__get__", 0);
31407  __Pyx_XDECREF(__pyx_r);
31408  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
31409  __pyx_r = ((PyObject *)__pyx_v_self->vDir);
31410  goto __pyx_L0;
31411 
31412  /* function exit code */
31413  __pyx_L0:;
31414  __Pyx_XGIVEREF(__pyx_r);
31415  __Pyx_RefNannyFinishContext();
31416  return __pyx_r;
31417 }
31418 
31419 /* Python wrapper */
31420 static int __pyx_pw_9WaveTools_11RandomWaves_4vDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31421 static int __pyx_pw_9WaveTools_11RandomWaves_4vDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31422  int __pyx_r;
31423  __Pyx_RefNannyDeclarations
31424  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31425  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4vDir_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31426 
31427  /* function exit code */
31428  __Pyx_RefNannyFinishContext();
31429  return __pyx_r;
31430 }
31431 
31432 static int __pyx_pf_9WaveTools_11RandomWaves_4vDir_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31433  int __pyx_r;
31434  __Pyx_RefNannyDeclarations
31435  PyObject *__pyx_t_1 = NULL;
31436  __Pyx_RefNannySetupContext("__set__", 0);
31437  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31438  __pyx_t_1 = __pyx_v_value;
31439  __Pyx_INCREF(__pyx_t_1);
31440  __Pyx_GIVEREF(__pyx_t_1);
31441  __Pyx_GOTREF(__pyx_v_self->vDir);
31442  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
31443  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_1);
31444  __pyx_t_1 = 0;
31445 
31446  /* function exit code */
31447  __pyx_r = 0;
31448  goto __pyx_L0;
31449  __pyx_L1_error:;
31450  __Pyx_XDECREF(__pyx_t_1);
31451  __Pyx_AddTraceback("WaveTools.RandomWaves.vDir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31452  __pyx_r = -1;
31453  __pyx_L0:;
31454  __Pyx_RefNannyFinishContext();
31455  return __pyx_r;
31456 }
31457 
31458 /* Python wrapper */
31459 static int __pyx_pw_9WaveTools_11RandomWaves_4vDir_5__del__(PyObject *__pyx_v_self); /*proto*/
31460 static int __pyx_pw_9WaveTools_11RandomWaves_4vDir_5__del__(PyObject *__pyx_v_self) {
31461  int __pyx_r;
31462  __Pyx_RefNannyDeclarations
31463  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31464  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4vDir_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31465 
31466  /* function exit code */
31467  __Pyx_RefNannyFinishContext();
31468  return __pyx_r;
31469 }
31470 
31471 static int __pyx_pf_9WaveTools_11RandomWaves_4vDir_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31472  int __pyx_r;
31473  __Pyx_RefNannyDeclarations
31474  __Pyx_RefNannySetupContext("__del__", 0);
31475  __Pyx_INCREF(Py_None);
31476  __Pyx_GIVEREF(Py_None);
31477  __Pyx_GOTREF(__pyx_v_self->vDir);
31478  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
31479  __pyx_v_self->vDir = ((PyArrayObject *)Py_None);
31480 
31481  /* function exit code */
31482  __pyx_r = 0;
31483  __Pyx_RefNannyFinishContext();
31484  return __pyx_r;
31485 }
31486 
31487 /* Python wrapper */
31488 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4kDir_1__get__(PyObject *__pyx_v_self); /*proto*/
31489 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_4kDir_1__get__(PyObject *__pyx_v_self) {
31490  PyObject *__pyx_r = 0;
31491  __Pyx_RefNannyDeclarations
31492  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31493  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4kDir___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31494 
31495  /* function exit code */
31496  __Pyx_RefNannyFinishContext();
31497  return __pyx_r;
31498 }
31499 
31500 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_4kDir___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31501  PyObject *__pyx_r = NULL;
31502  __Pyx_RefNannyDeclarations
31503  __Pyx_RefNannySetupContext("__get__", 0);
31504  __Pyx_XDECREF(__pyx_r);
31505  __Pyx_INCREF(((PyObject *)__pyx_v_self->kDir));
31506  __pyx_r = ((PyObject *)__pyx_v_self->kDir);
31507  goto __pyx_L0;
31508 
31509  /* function exit code */
31510  __pyx_L0:;
31511  __Pyx_XGIVEREF(__pyx_r);
31512  __Pyx_RefNannyFinishContext();
31513  return __pyx_r;
31514 }
31515 
31516 /* Python wrapper */
31517 static int __pyx_pw_9WaveTools_11RandomWaves_4kDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31518 static int __pyx_pw_9WaveTools_11RandomWaves_4kDir_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31519  int __pyx_r;
31520  __Pyx_RefNannyDeclarations
31521  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31522  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4kDir_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31523 
31524  /* function exit code */
31525  __Pyx_RefNannyFinishContext();
31526  return __pyx_r;
31527 }
31528 
31529 static int __pyx_pf_9WaveTools_11RandomWaves_4kDir_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31530  int __pyx_r;
31531  __Pyx_RefNannyDeclarations
31532  PyObject *__pyx_t_1 = NULL;
31533  __Pyx_RefNannySetupContext("__set__", 0);
31534  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31535  __pyx_t_1 = __pyx_v_value;
31536  __Pyx_INCREF(__pyx_t_1);
31537  __Pyx_GIVEREF(__pyx_t_1);
31538  __Pyx_GOTREF(__pyx_v_self->kDir);
31539  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
31540  __pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_1);
31541  __pyx_t_1 = 0;
31542 
31543  /* function exit code */
31544  __pyx_r = 0;
31545  goto __pyx_L0;
31546  __pyx_L1_error:;
31547  __Pyx_XDECREF(__pyx_t_1);
31548  __Pyx_AddTraceback("WaveTools.RandomWaves.kDir.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31549  __pyx_r = -1;
31550  __pyx_L0:;
31551  __Pyx_RefNannyFinishContext();
31552  return __pyx_r;
31553 }
31554 
31555 /* Python wrapper */
31556 static int __pyx_pw_9WaveTools_11RandomWaves_4kDir_5__del__(PyObject *__pyx_v_self); /*proto*/
31557 static int __pyx_pw_9WaveTools_11RandomWaves_4kDir_5__del__(PyObject *__pyx_v_self) {
31558  int __pyx_r;
31559  __Pyx_RefNannyDeclarations
31560  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31561  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_4kDir_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31562 
31563  /* function exit code */
31564  __Pyx_RefNannyFinishContext();
31565  return __pyx_r;
31566 }
31567 
31568 static int __pyx_pf_9WaveTools_11RandomWaves_4kDir_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31569  int __pyx_r;
31570  __Pyx_RefNannyDeclarations
31571  __Pyx_RefNannySetupContext("__del__", 0);
31572  __Pyx_INCREF(Py_None);
31573  __Pyx_GIVEREF(Py_None);
31574  __Pyx_GOTREF(__pyx_v_self->kDir);
31575  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
31576  __pyx_v_self->kDir = ((PyArrayObject *)Py_None);
31577 
31578  /* function exit code */
31579  __pyx_r = 0;
31580  __Pyx_RefNannyFinishContext();
31581  return __pyx_r;
31582 }
31583 
31584 /* Python wrapper */
31585 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2ai_1__get__(PyObject *__pyx_v_self); /*proto*/
31586 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_2ai_1__get__(PyObject *__pyx_v_self) {
31587  PyObject *__pyx_r = 0;
31588  __Pyx_RefNannyDeclarations
31589  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31590  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2ai___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31591 
31592  /* function exit code */
31593  __Pyx_RefNannyFinishContext();
31594  return __pyx_r;
31595 }
31596 
31597 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_2ai___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31598  PyObject *__pyx_r = NULL;
31599  __Pyx_RefNannyDeclarations
31600  __Pyx_RefNannySetupContext("__get__", 0);
31601  __Pyx_XDECREF(__pyx_r);
31602  __Pyx_INCREF(((PyObject *)__pyx_v_self->ai));
31603  __pyx_r = ((PyObject *)__pyx_v_self->ai);
31604  goto __pyx_L0;
31605 
31606  /* function exit code */
31607  __pyx_L0:;
31608  __Pyx_XGIVEREF(__pyx_r);
31609  __Pyx_RefNannyFinishContext();
31610  return __pyx_r;
31611 }
31612 
31613 /* Python wrapper */
31614 static int __pyx_pw_9WaveTools_11RandomWaves_2ai_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31615 static int __pyx_pw_9WaveTools_11RandomWaves_2ai_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31616  int __pyx_r;
31617  __Pyx_RefNannyDeclarations
31618  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31619  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2ai_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31620 
31621  /* function exit code */
31622  __Pyx_RefNannyFinishContext();
31623  return __pyx_r;
31624 }
31625 
31626 static int __pyx_pf_9WaveTools_11RandomWaves_2ai_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31627  int __pyx_r;
31628  __Pyx_RefNannyDeclarations
31629  PyObject *__pyx_t_1 = NULL;
31630  __Pyx_RefNannySetupContext("__set__", 0);
31631  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 125, __pyx_L1_error)
31632  __pyx_t_1 = __pyx_v_value;
31633  __Pyx_INCREF(__pyx_t_1);
31634  __Pyx_GIVEREF(__pyx_t_1);
31635  __Pyx_GOTREF(__pyx_v_self->ai);
31636  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
31637  __pyx_v_self->ai = ((PyArrayObject *)__pyx_t_1);
31638  __pyx_t_1 = 0;
31639 
31640  /* function exit code */
31641  __pyx_r = 0;
31642  goto __pyx_L0;
31643  __pyx_L1_error:;
31644  __Pyx_XDECREF(__pyx_t_1);
31645  __Pyx_AddTraceback("WaveTools.RandomWaves.ai.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31646  __pyx_r = -1;
31647  __pyx_L0:;
31648  __Pyx_RefNannyFinishContext();
31649  return __pyx_r;
31650 }
31651 
31652 /* Python wrapper */
31653 static int __pyx_pw_9WaveTools_11RandomWaves_2ai_5__del__(PyObject *__pyx_v_self); /*proto*/
31654 static int __pyx_pw_9WaveTools_11RandomWaves_2ai_5__del__(PyObject *__pyx_v_self) {
31655  int __pyx_r;
31656  __Pyx_RefNannyDeclarations
31657  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31658  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_2ai_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31659 
31660  /* function exit code */
31661  __Pyx_RefNannyFinishContext();
31662  return __pyx_r;
31663 }
31664 
31665 static int __pyx_pf_9WaveTools_11RandomWaves_2ai_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31666  int __pyx_r;
31667  __Pyx_RefNannyDeclarations
31668  __Pyx_RefNannySetupContext("__del__", 0);
31669  __Pyx_INCREF(Py_None);
31670  __Pyx_GIVEREF(Py_None);
31671  __Pyx_GOTREF(__pyx_v_self->ai);
31672  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
31673  __pyx_v_self->ai = ((PyArrayObject *)Py_None);
31674 
31675  /* function exit code */
31676  __pyx_r = 0;
31677  __Pyx_RefNannyFinishContext();
31678  return __pyx_r;
31679 }
31680 
31681 /* "WaveTools.pxd":126
31682  * int N
31683  * np.ndarray fi,fim,Si_Jm,ki,omega,tanhF,g,waveDir,vDir,kDir,ai
31684  * cdef object phi # <<<<<<<<<<<<<<
31685  * cdef double _cpp_eta(self , double* x, double t)
31686  * cdef void _cpp_u(self, double *U, double* x, double t)
31687  */
31688 
31689 /* Python wrapper */
31690 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3phi_1__get__(PyObject *__pyx_v_self); /*proto*/
31691 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_3phi_1__get__(PyObject *__pyx_v_self) {
31692  PyObject *__pyx_r = 0;
31693  __Pyx_RefNannyDeclarations
31694  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
31695  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3phi___get__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31696 
31697  /* function exit code */
31698  __Pyx_RefNannyFinishContext();
31699  return __pyx_r;
31700 }
31701 
31702 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_3phi___get__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31703  PyObject *__pyx_r = NULL;
31704  __Pyx_RefNannyDeclarations
31705  __Pyx_RefNannySetupContext("__get__", 0);
31706  __Pyx_XDECREF(__pyx_r);
31707  __Pyx_INCREF(__pyx_v_self->phi);
31708  __pyx_r = __pyx_v_self->phi;
31709  goto __pyx_L0;
31710 
31711  /* function exit code */
31712  __pyx_L0:;
31713  __Pyx_XGIVEREF(__pyx_r);
31714  __Pyx_RefNannyFinishContext();
31715  return __pyx_r;
31716 }
31717 
31718 /* Python wrapper */
31719 static int __pyx_pw_9WaveTools_11RandomWaves_3phi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
31720 static int __pyx_pw_9WaveTools_11RandomWaves_3phi_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
31721  int __pyx_r;
31722  __Pyx_RefNannyDeclarations
31723  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
31724  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3phi_2__set__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
31725 
31726  /* function exit code */
31727  __Pyx_RefNannyFinishContext();
31728  return __pyx_r;
31729 }
31730 
31731 static int __pyx_pf_9WaveTools_11RandomWaves_3phi_2__set__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
31732  int __pyx_r;
31733  __Pyx_RefNannyDeclarations
31734  __Pyx_RefNannySetupContext("__set__", 0);
31735  __Pyx_INCREF(__pyx_v_value);
31736  __Pyx_GIVEREF(__pyx_v_value);
31737  __Pyx_GOTREF(__pyx_v_self->phi);
31738  __Pyx_DECREF(__pyx_v_self->phi);
31739  __pyx_v_self->phi = __pyx_v_value;
31740 
31741  /* function exit code */
31742  __pyx_r = 0;
31743  __Pyx_RefNannyFinishContext();
31744  return __pyx_r;
31745 }
31746 
31747 /* Python wrapper */
31748 static int __pyx_pw_9WaveTools_11RandomWaves_3phi_5__del__(PyObject *__pyx_v_self); /*proto*/
31749 static int __pyx_pw_9WaveTools_11RandomWaves_3phi_5__del__(PyObject *__pyx_v_self) {
31750  int __pyx_r;
31751  __Pyx_RefNannyDeclarations
31752  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
31753  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_3phi_4__del__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31754 
31755  /* function exit code */
31756  __Pyx_RefNannyFinishContext();
31757  return __pyx_r;
31758 }
31759 
31760 static int __pyx_pf_9WaveTools_11RandomWaves_3phi_4__del__(struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31761  int __pyx_r;
31762  __Pyx_RefNannyDeclarations
31763  __Pyx_RefNannySetupContext("__del__", 0);
31764  __Pyx_INCREF(Py_None);
31765  __Pyx_GIVEREF(Py_None);
31766  __Pyx_GOTREF(__pyx_v_self->phi);
31767  __Pyx_DECREF(__pyx_v_self->phi);
31768  __pyx_v_self->phi = Py_None;
31769 
31770  /* function exit code */
31771  __pyx_r = 0;
31772  __Pyx_RefNannyFinishContext();
31773  return __pyx_r;
31774 }
31775 
31776 /* "(tree fragment)":1
31777  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
31778  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31779  * def __setstate_cython__(self, __pyx_state):
31780  */
31781 
31782 /* Python wrapper */
31783 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
31784 static PyMethodDef __pyx_mdef_9WaveTools_11RandomWaves_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_11RandomWaves_9__reduce_cython__, METH_NOARGS, 0};
31785 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
31786  PyObject *__pyx_r = 0;
31787  __Pyx_RefNannyDeclarations
31788  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
31789  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_8__reduce_cython__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self));
31790 
31791  /* function exit code */
31792  __Pyx_RefNannyFinishContext();
31793  return __pyx_r;
31794 }
31795 
31796 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self) {
31797  PyObject *__pyx_r = NULL;
31798  __Pyx_RefNannyDeclarations
31799  PyObject *__pyx_t_1 = NULL;
31800  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
31801 
31802  /* "(tree fragment)":2
31803  * def __reduce_cython__(self):
31804  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
31805  * def __setstate_cython__(self, __pyx_state):
31806  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31807  */
31808  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
31809  __Pyx_GOTREF(__pyx_t_1);
31810  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
31811  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31812  __PYX_ERR(1, 2, __pyx_L1_error)
31813 
31814  /* "(tree fragment)":1
31815  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
31816  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31817  * def __setstate_cython__(self, __pyx_state):
31818  */
31819 
31820  /* function exit code */
31821  __pyx_L1_error:;
31822  __Pyx_XDECREF(__pyx_t_1);
31823  __Pyx_AddTraceback("WaveTools.RandomWaves.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31824  __pyx_r = NULL;
31825  __Pyx_XGIVEREF(__pyx_r);
31826  __Pyx_RefNannyFinishContext();
31827  return __pyx_r;
31828 }
31829 
31830 /* "(tree fragment)":3
31831  * def __reduce_cython__(self):
31832  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31833  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
31834  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31835  */
31836 
31837 /* Python wrapper */
31838 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
31839 static PyMethodDef __pyx_mdef_9WaveTools_11RandomWaves_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_11RandomWaves_11__setstate_cython__, METH_O, 0};
31840 static PyObject *__pyx_pw_9WaveTools_11RandomWaves_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
31841  PyObject *__pyx_r = 0;
31842  __Pyx_RefNannyDeclarations
31843  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
31844  __pyx_r = __pyx_pf_9WaveTools_11RandomWaves_10__setstate_cython__(((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
31845 
31846  /* function exit code */
31847  __Pyx_RefNannyFinishContext();
31848  return __pyx_r;
31849 }
31850 
31851 static PyObject *__pyx_pf_9WaveTools_11RandomWaves_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
31852  PyObject *__pyx_r = NULL;
31853  __Pyx_RefNannyDeclarations
31854  PyObject *__pyx_t_1 = NULL;
31855  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
31856 
31857  /* "(tree fragment)":4
31858  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31859  * def __setstate_cython__(self, __pyx_state):
31860  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
31861  */
31862  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
31863  __Pyx_GOTREF(__pyx_t_1);
31864  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
31865  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31866  __PYX_ERR(1, 4, __pyx_L1_error)
31867 
31868  /* "(tree fragment)":3
31869  * def __reduce_cython__(self):
31870  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31871  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
31872  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
31873  */
31874 
31875  /* function exit code */
31876  __pyx_L1_error:;
31877  __Pyx_XDECREF(__pyx_t_1);
31878  __Pyx_AddTraceback("WaveTools.RandomWaves.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
31879  __pyx_r = NULL;
31880  __Pyx_XGIVEREF(__pyx_r);
31881  __Pyx_RefNannyFinishContext();
31882  return __pyx_r;
31883 }
31884 
31885 /* "WaveTools.py":1670
31886  * Switch for optimised functions
31887  * """
31888  * def __cinit__(self, # <<<<<<<<<<<<<<
31889  * Nspectra,
31890  * Tp, # np array with
31891  */
31892 
31893 /* Python wrapper */
31894 static int __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
31895 static int __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
31896  PyObject *__pyx_v_Nspectra = 0;
31897  PyObject *__pyx_v_Tp = 0;
31898  PyObject *__pyx_v_Hs = 0;
31899  PyObject *__pyx_v_mwl = 0;
31900  PyObject *__pyx_v_depth = 0;
31901  PyObject *__pyx_v_waveDir = 0;
31902  PyObject *__pyx_v_g = 0;
31903  PyObject *__pyx_v_N = 0;
31904  PyObject *__pyx_v_bandFactor = 0;
31905  PyObject *__pyx_v_spectName = 0;
31906  PyObject *__pyx_v_spectral_params = 0;
31907  PyObject *__pyx_v_phi = 0;
31908  PyObject *__pyx_v_fast = 0;
31909  int __pyx_r;
31910  __Pyx_RefNannyDeclarations
31911  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
31912  {
31913  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Nspectra,&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spectral_params,&__pyx_n_s_phi,&__pyx_n_s_fast,0};
31914  PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
31915 
31916  /* "WaveTools.py":1683
31917  * spectral_params, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
31918  * phi,
31919  * fast=True # <<<<<<<<<<<<<<
31920  * ):
31921  * # Checking length of arrays / lists to be equal to NSpectra
31922  */
31923  values[12] = ((PyObject *)Py_True);
31924  if (unlikely(__pyx_kwds)) {
31925  Py_ssize_t kw_args;
31926  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
31927  switch (pos_args) {
31928  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
31929  CYTHON_FALLTHROUGH;
31930  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
31931  CYTHON_FALLTHROUGH;
31932  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
31933  CYTHON_FALLTHROUGH;
31934  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
31935  CYTHON_FALLTHROUGH;
31936  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
31937  CYTHON_FALLTHROUGH;
31938  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
31939  CYTHON_FALLTHROUGH;
31940  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
31941  CYTHON_FALLTHROUGH;
31942  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
31943  CYTHON_FALLTHROUGH;
31944  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
31945  CYTHON_FALLTHROUGH;
31946  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
31947  CYTHON_FALLTHROUGH;
31948  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
31949  CYTHON_FALLTHROUGH;
31950  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
31951  CYTHON_FALLTHROUGH;
31952  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
31953  CYTHON_FALLTHROUGH;
31954  case 0: break;
31955  default: goto __pyx_L5_argtuple_error;
31956  }
31957  kw_args = PyDict_Size(__pyx_kwds);
31958  switch (pos_args) {
31959  case 0:
31960  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nspectra)) != 0)) kw_args--;
31961  else goto __pyx_L5_argtuple_error;
31962  CYTHON_FALLTHROUGH;
31963  case 1:
31964  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
31965  else {
31966  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 1); __PYX_ERR(0, 1670, __pyx_L3_error)
31967  }
31968  CYTHON_FALLTHROUGH;
31969  case 2:
31970  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
31971  else {
31972  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 2); __PYX_ERR(0, 1670, __pyx_L3_error)
31973  }
31974  CYTHON_FALLTHROUGH;
31975  case 3:
31976  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
31977  else {
31978  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 3); __PYX_ERR(0, 1670, __pyx_L3_error)
31979  }
31980  CYTHON_FALLTHROUGH;
31981  case 4:
31982  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
31983  else {
31984  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 4); __PYX_ERR(0, 1670, __pyx_L3_error)
31985  }
31986  CYTHON_FALLTHROUGH;
31987  case 5:
31988  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
31989  else {
31990  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 5); __PYX_ERR(0, 1670, __pyx_L3_error)
31991  }
31992  CYTHON_FALLTHROUGH;
31993  case 6:
31994  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
31995  else {
31996  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 6); __PYX_ERR(0, 1670, __pyx_L3_error)
31997  }
31998  CYTHON_FALLTHROUGH;
31999  case 7:
32000  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
32001  else {
32002  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 7); __PYX_ERR(0, 1670, __pyx_L3_error)
32003  }
32004  CYTHON_FALLTHROUGH;
32005  case 8:
32006  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
32007  else {
32008  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 8); __PYX_ERR(0, 1670, __pyx_L3_error)
32009  }
32010  CYTHON_FALLTHROUGH;
32011  case 9:
32012  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
32013  else {
32014  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 9); __PYX_ERR(0, 1670, __pyx_L3_error)
32015  }
32016  CYTHON_FALLTHROUGH;
32017  case 10:
32018  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params)) != 0)) kw_args--;
32019  else {
32020  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 10); __PYX_ERR(0, 1670, __pyx_L3_error)
32021  }
32022  CYTHON_FALLTHROUGH;
32023  case 11:
32024  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
32025  else {
32026  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, 11); __PYX_ERR(0, 1670, __pyx_L3_error)
32027  }
32028  CYTHON_FALLTHROUGH;
32029  case 12:
32030  if (kw_args > 0) {
32031  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
32032  if (value) { values[12] = value; kw_args--; }
32033  }
32034  }
32035  if (unlikely(kw_args > 0)) {
32036  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1670, __pyx_L3_error)
32037  }
32038  } else {
32039  switch (PyTuple_GET_SIZE(__pyx_args)) {
32040  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
32041  CYTHON_FALLTHROUGH;
32042  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
32043  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
32044  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
32045  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
32046  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
32047  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
32048  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
32049  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
32050  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
32051  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
32052  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
32053  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
32054  break;
32055  default: goto __pyx_L5_argtuple_error;
32056  }
32057  }
32058  __pyx_v_Nspectra = values[0];
32059  __pyx_v_Tp = values[1];
32060  __pyx_v_Hs = values[2];
32061  __pyx_v_mwl = values[3];
32062  __pyx_v_depth = values[4];
32063  __pyx_v_waveDir = values[5];
32064  __pyx_v_g = values[6];
32065  __pyx_v_N = values[7];
32066  __pyx_v_bandFactor = values[8];
32067  __pyx_v_spectName = values[9];
32068  __pyx_v_spectral_params = values[10];
32069  __pyx_v_phi = values[11];
32070  __pyx_v_fast = values[12];
32071  }
32072  goto __pyx_L4_argument_unpacking_done;
32073  __pyx_L5_argtuple_error:;
32074  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 12, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1670, __pyx_L3_error)
32075  __pyx_L3_error:;
32076  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32077  __Pyx_RefNannyFinishContext();
32078  return -1;
32079  __pyx_L4_argument_unpacking_done:;
32080  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves___cinit__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self), __pyx_v_Nspectra, __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spectral_params, __pyx_v_phi, __pyx_v_fast);
32081 
32082  /* "WaveTools.py":1670
32083  * Switch for optimised functions
32084  * """
32085  * def __cinit__(self, # <<<<<<<<<<<<<<
32086  * Nspectra,
32087  * Tp, # np array with
32088  */
32089 
32090  /* function exit code */
32091  __Pyx_RefNannyFinishContext();
32092  return __pyx_r;
32093 }
32094 
32095 static int __pyx_pf_9WaveTools_23MultiSpectraRandomWaves___cinit__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_Nspectra, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_fast) {
32096  PyObject *__pyx_v_nn = NULL;
32097  PyObject *__pyx_v_NN = NULL;
32098  PyObject *__pyx_v_kk = NULL;
32099  PyObject *__pyx_v_NN1 = NULL;
32100  struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_RW = NULL;
32101  PyObject *__pyx_v_ij = NULL;
32102  int __pyx_r;
32103  __Pyx_RefNannyDeclarations
32104  bool __pyx_t_1;
32105  PyObject *__pyx_t_2 = NULL;
32106  PyObject *__pyx_t_3 = NULL;
32107  PyObject *__pyx_t_4 = NULL;
32108  int __pyx_t_5;
32109  Py_ssize_t __pyx_t_6;
32110  PyObject *__pyx_t_7 = NULL;
32111  PyObject *__pyx_t_8 = NULL;
32112  int __pyx_t_9;
32113  PyObject *__pyx_t_10 = NULL;
32114  PyObject *__pyx_t_11 = NULL;
32115  PyObject *__pyx_t_12 = NULL;
32116  PyObject *__pyx_t_13 = NULL;
32117  double __pyx_t_14;
32118  PyObject *(*__pyx_t_15)(PyObject *);
32119  int __pyx_t_16;
32120  PyObject *__pyx_t_17 = NULL;
32121  PyObject *__pyx_t_18 = NULL;
32122  PyObject *__pyx_t_19 = NULL;
32123  PyObject *__pyx_t_20 = NULL;
32124  PyObject *__pyx_t_21 = NULL;
32125  Py_ssize_t __pyx_t_22;
32126  double *__pyx_t_23;
32127  PyObject *(*__pyx_t_24)(PyObject *);
32128  Py_ssize_t __pyx_t_25;
32129  __Pyx_RefNannySetupContext("__cinit__", 0);
32130 
32131  /* "WaveTools.py":1686
32132  * ):
32133  * # Checking length of arrays / lists to be equal to NSpectra
32134  * self.fast = fast # <<<<<<<<<<<<<<
32135  * try:
32136  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \
32137  */
32138  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1686, __pyx_L1_error)
32139  __pyx_v_self->fast = __pyx_t_1;
32140 
32141  /* "WaveTools.py":1687
32142  * # Checking length of arrays / lists to be equal to NSpectra
32143  * self.fast = fast
32144  * try: # <<<<<<<<<<<<<<
32145  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \
32146  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32147  */
32148  {
32149  __Pyx_PyThreadState_declare
32150  __Pyx_PyThreadState_assign
32151  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
32152  __Pyx_XGOTREF(__pyx_t_2);
32153  __Pyx_XGOTREF(__pyx_t_3);
32154  __Pyx_XGOTREF(__pyx_t_4);
32155  /*try:*/ {
32156 
32157  /* "WaveTools.py":1688
32158  * self.fast = fast
32159  * try:
32160  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \ # <<<<<<<<<<<<<<
32161  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32162  * (len(spectName) != Nspectra) or (len(spectral_params) != Nspectra) or(len(phi) != Nspectra):
32163  */
32164  __pyx_t_6 = PyObject_Length(__pyx_v_Tp); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1688, __pyx_L3_error)
32165  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L3_error)
32166  __Pyx_GOTREF(__pyx_t_7);
32167  __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L3_error)
32168  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32169  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
32170  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32171  if (!__pyx_t_9) {
32172  } else {
32173  __pyx_t_5 = __pyx_t_9;
32174  goto __pyx_L10_bool_binop_done;
32175  }
32176  __pyx_t_6 = PyObject_Length(__pyx_v_Hs); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1688, __pyx_L3_error)
32177  __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L3_error)
32178  __Pyx_GOTREF(__pyx_t_8);
32179  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L3_error)
32180  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32181  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
32182  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32183  if (!__pyx_t_9) {
32184  } else {
32185  __pyx_t_5 = __pyx_t_9;
32186  goto __pyx_L10_bool_binop_done;
32187  }
32188  __pyx_t_6 = PyObject_Length(__pyx_v_waveDir); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1688, __pyx_L3_error)
32189  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L3_error)
32190  __Pyx_GOTREF(__pyx_t_7);
32191  __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L3_error)
32192  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32193  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1688, __pyx_L3_error)
32194  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32195  if (!__pyx_t_9) {
32196  } else {
32197  __pyx_t_5 = __pyx_t_9;
32198  goto __pyx_L10_bool_binop_done;
32199  }
32200 
32201  /* "WaveTools.py":1689
32202  * try:
32203  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \
32204  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \ # <<<<<<<<<<<<<<
32205  * (len(spectName) != Nspectra) or (len(spectral_params) != Nspectra) or(len(phi) != Nspectra):
32206  *
32207  */
32208  __pyx_t_6 = PyObject_Length(__pyx_v_N); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1689, __pyx_L3_error)
32209  __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1689, __pyx_L3_error)
32210  __Pyx_GOTREF(__pyx_t_8);
32211  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1689, __pyx_L3_error)
32212  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32213  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1689, __pyx_L3_error)
32214  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32215  if (!__pyx_t_9) {
32216  } else {
32217  __pyx_t_5 = __pyx_t_9;
32218  goto __pyx_L10_bool_binop_done;
32219  }
32220  __pyx_t_6 = PyObject_Length(__pyx_v_bandFactor); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1689, __pyx_L3_error)
32221  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1689, __pyx_L3_error)
32222  __Pyx_GOTREF(__pyx_t_7);
32223  __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1689, __pyx_L3_error)
32224  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32225  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1689, __pyx_L3_error)
32226  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32227  if (!__pyx_t_9) {
32228  } else {
32229  __pyx_t_5 = __pyx_t_9;
32230  goto __pyx_L10_bool_binop_done;
32231  }
32232 
32233  /* "WaveTools.py":1690
32234  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \
32235  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32236  * (len(spectName) != Nspectra) or (len(spectral_params) != Nspectra) or(len(phi) != Nspectra): # <<<<<<<<<<<<<<
32237  *
32238  * logEvent('ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ')
32239  */
32240  __pyx_t_6 = PyObject_Length(__pyx_v_spectName); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1690, __pyx_L3_error)
32241  __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1690, __pyx_L3_error)
32242  __Pyx_GOTREF(__pyx_t_8);
32243  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1690, __pyx_L3_error)
32244  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32245  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1690, __pyx_L3_error)
32246  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32247  if (!__pyx_t_9) {
32248  } else {
32249  __pyx_t_5 = __pyx_t_9;
32250  goto __pyx_L10_bool_binop_done;
32251  }
32252  __pyx_t_6 = PyObject_Length(__pyx_v_spectral_params); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1690, __pyx_L3_error)
32253  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1690, __pyx_L3_error)
32254  __Pyx_GOTREF(__pyx_t_7);
32255  __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1690, __pyx_L3_error)
32256  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32257  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1690, __pyx_L3_error)
32258  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32259  if (!__pyx_t_9) {
32260  } else {
32261  __pyx_t_5 = __pyx_t_9;
32262  goto __pyx_L10_bool_binop_done;
32263  }
32264  __pyx_t_6 = PyObject_Length(__pyx_v_phi); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1690, __pyx_L3_error)
32265  __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1690, __pyx_L3_error)
32266  __Pyx_GOTREF(__pyx_t_8);
32267  __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_v_Nspectra, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1690, __pyx_L3_error)
32268  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32269  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1690, __pyx_L3_error)
32270  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32271  __pyx_t_5 = __pyx_t_9;
32272  __pyx_L10_bool_binop_done:;
32273 
32274  /* "WaveTools.py":1688
32275  * self.fast = fast
32276  * try:
32277  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \ # <<<<<<<<<<<<<<
32278  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32279  * (len(spectName) != Nspectra) or (len(spectral_params) != Nspectra) or(len(phi) != Nspectra):
32280  */
32281  if (__pyx_t_5) {
32282 
32283  /* "WaveTools.py":1692
32284  * (len(spectName) != Nspectra) or (len(spectral_params) != Nspectra) or(len(phi) != Nspectra):
32285  *
32286  * logEvent('ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ') # <<<<<<<<<<<<<<
32287  * sys.exit(1)
32288  *
32289  */
32290  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1692, __pyx_L3_error)
32291  __Pyx_GOTREF(__pyx_t_8);
32292  __pyx_t_10 = NULL;
32293  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
32294  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
32295  if (likely(__pyx_t_10)) {
32296  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
32297  __Pyx_INCREF(__pyx_t_10);
32298  __Pyx_INCREF(function);
32299  __Pyx_DECREF_SET(__pyx_t_8, function);
32300  }
32301  }
32302  __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_kp_s_ERROR_Wavetools_py_Parameters_pa) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_ERROR_Wavetools_py_Parameters_pa);
32303  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32304  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1692, __pyx_L3_error)
32305  __Pyx_GOTREF(__pyx_t_7);
32306  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32307  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32308 
32309  /* "WaveTools.py":1693
32310  *
32311  * logEvent('ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ')
32312  * sys.exit(1) # <<<<<<<<<<<<<<
32313  *
32314  * except:
32315  */
32316  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sys); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1693, __pyx_L3_error)
32317  __Pyx_GOTREF(__pyx_t_8);
32318  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1693, __pyx_L3_error)
32319  __Pyx_GOTREF(__pyx_t_10);
32320  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32321  __pyx_t_8 = NULL;
32322  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
32323  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
32324  if (likely(__pyx_t_8)) {
32325  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
32326  __Pyx_INCREF(__pyx_t_8);
32327  __Pyx_INCREF(function);
32328  __Pyx_DECREF_SET(__pyx_t_10, function);
32329  }
32330  }
32331  __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_8, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_int_1);
32332  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
32333  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1693, __pyx_L3_error)
32334  __Pyx_GOTREF(__pyx_t_7);
32335  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32336  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32337 
32338  /* "WaveTools.py":1688
32339  * self.fast = fast
32340  * try:
32341  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \ # <<<<<<<<<<<<<<
32342  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32343  * (len(spectName) != Nspectra) or (len(spectral_params) != Nspectra) or(len(phi) != Nspectra):
32344  */
32345  }
32346 
32347  /* "WaveTools.py":1687
32348  * # Checking length of arrays / lists to be equal to NSpectra
32349  * self.fast = fast
32350  * try: # <<<<<<<<<<<<<<
32351  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \
32352  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32353  */
32354  }
32355  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
32356  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
32357  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
32358  goto __pyx_L8_try_end;
32359  __pyx_L3_error:;
32360  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
32361  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32362  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
32363 
32364  /* "WaveTools.py":1695
32365  * sys.exit(1)
32366  *
32367  * except: # <<<<<<<<<<<<<<
32368  * logEvent('ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ')
32369  * sys.exit(1)
32370  */
32371  /*except:*/ {
32372  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
32373  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_10, &__pyx_t_8) < 0) __PYX_ERR(0, 1695, __pyx_L5_except_error)
32374  __Pyx_GOTREF(__pyx_t_7);
32375  __Pyx_GOTREF(__pyx_t_10);
32376  __Pyx_GOTREF(__pyx_t_8);
32377 
32378  /* "WaveTools.py":1696
32379  *
32380  * except:
32381  * logEvent('ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ') # <<<<<<<<<<<<<<
32382  * sys.exit(1)
32383  * # Initialize numpy arrays for complete reconstruction
32384  */
32385  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1696, __pyx_L5_except_error)
32386  __Pyx_GOTREF(__pyx_t_12);
32387  __pyx_t_13 = NULL;
32388  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
32389  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
32390  if (likely(__pyx_t_13)) {
32391  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
32392  __Pyx_INCREF(__pyx_t_13);
32393  __Pyx_INCREF(function);
32394  __Pyx_DECREF_SET(__pyx_t_12, function);
32395  }
32396  }
32397  __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_kp_s_ERROR_Wavetools_py_Parameters_pa) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_s_ERROR_Wavetools_py_Parameters_pa);
32398  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
32399  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1696, __pyx_L5_except_error)
32400  __Pyx_GOTREF(__pyx_t_11);
32401  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
32402  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32403 
32404  /* "WaveTools.py":1697
32405  * except:
32406  * logEvent('ERROR! Wavetools.py: Parameters passed in MultiSpectraRandomWaves must be in array or list form with length Nspectra ')
32407  * sys.exit(1) # <<<<<<<<<<<<<<
32408  * # Initialize numpy arrays for complete reconstruction
32409  * self.Nall = 0
32410  */
32411  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1697, __pyx_L5_except_error)
32412  __Pyx_GOTREF(__pyx_t_12);
32413  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exit); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1697, __pyx_L5_except_error)
32414  __Pyx_GOTREF(__pyx_t_13);
32415  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
32416  __pyx_t_12 = NULL;
32417  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
32418  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
32419  if (likely(__pyx_t_12)) {
32420  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
32421  __Pyx_INCREF(__pyx_t_12);
32422  __Pyx_INCREF(function);
32423  __Pyx_DECREF_SET(__pyx_t_13, function);
32424  }
32425  }
32426  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_12, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_int_1);
32427  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
32428  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1697, __pyx_L5_except_error)
32429  __Pyx_GOTREF(__pyx_t_11);
32430  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
32431  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32432  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
32433  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32434  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
32435  goto __pyx_L4_exception_handled;
32436  }
32437  __pyx_L5_except_error:;
32438 
32439  /* "WaveTools.py":1687
32440  * # Checking length of arrays / lists to be equal to NSpectra
32441  * self.fast = fast
32442  * try: # <<<<<<<<<<<<<<
32443  * if (len(Tp) != Nspectra) or (len(Hs) != Nspectra) or (len(waveDir) != Nspectra) or \
32444  * (len(N) != Nspectra) or (len(bandFactor) != Nspectra) or \
32445  */
32446  __Pyx_XGIVEREF(__pyx_t_2);
32447  __Pyx_XGIVEREF(__pyx_t_3);
32448  __Pyx_XGIVEREF(__pyx_t_4);
32449  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
32450  goto __pyx_L1_error;
32451  __pyx_L4_exception_handled:;
32452  __Pyx_XGIVEREF(__pyx_t_2);
32453  __Pyx_XGIVEREF(__pyx_t_3);
32454  __Pyx_XGIVEREF(__pyx_t_4);
32455  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
32456  __pyx_L8_try_end:;
32457  }
32458 
32459  /* "WaveTools.py":1699
32460  * sys.exit(1)
32461  * # Initialize numpy arrays for complete reconstruction
32462  * self.Nall = 0 # <<<<<<<<<<<<<<
32463  * self.mwl = mwl
32464  * self.depth = depth
32465  */
32466  __pyx_v_self->Nall = 0;
32467 
32468  /* "WaveTools.py":1700
32469  * # Initialize numpy arrays for complete reconstruction
32470  * self.Nall = 0
32471  * self.mwl = mwl # <<<<<<<<<<<<<<
32472  * self.depth = depth
32473  * self.g = np.array(g)
32474  */
32475  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1700, __pyx_L1_error)
32476  __pyx_v_self->mwl = __pyx_t_14;
32477 
32478  /* "WaveTools.py":1701
32479  * self.Nall = 0
32480  * self.mwl = mwl
32481  * self.depth = depth # <<<<<<<<<<<<<<
32482  * self.g = np.array(g)
32483  * self.vDir = setVertDir(g)
32484  */
32485  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1701, __pyx_L1_error)
32486  __pyx_v_self->depth = __pyx_t_14;
32487 
32488  /* "WaveTools.py":1702
32489  * self.mwl = mwl
32490  * self.depth = depth
32491  * self.g = np.array(g) # <<<<<<<<<<<<<<
32492  * self.vDir = setVertDir(g)
32493  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
32494  */
32495  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1702, __pyx_L1_error)
32496  __Pyx_GOTREF(__pyx_t_10);
32497  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1702, __pyx_L1_error)
32498  __Pyx_GOTREF(__pyx_t_7);
32499  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32500  __pyx_t_10 = NULL;
32501  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
32502  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
32503  if (likely(__pyx_t_10)) {
32504  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
32505  __Pyx_INCREF(__pyx_t_10);
32506  __Pyx_INCREF(function);
32507  __Pyx_DECREF_SET(__pyx_t_7, function);
32508  }
32509  }
32510  __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_g);
32511  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32512  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1702, __pyx_L1_error)
32513  __Pyx_GOTREF(__pyx_t_8);
32514  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32515  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1702, __pyx_L1_error)
32516  __Pyx_GIVEREF(__pyx_t_8);
32517  __Pyx_GOTREF(__pyx_v_self->g);
32518  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
32519  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_8);
32520  __pyx_t_8 = 0;
32521 
32522  /* "WaveTools.py":1703
32523  * self.depth = depth
32524  * self.g = np.array(g)
32525  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
32526  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
32527  *
32528  */
32529  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1703, __pyx_L1_error)
32530  __Pyx_GOTREF(__pyx_t_7);
32531  __pyx_t_10 = NULL;
32532  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
32533  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
32534  if (likely(__pyx_t_10)) {
32535  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
32536  __Pyx_INCREF(__pyx_t_10);
32537  __Pyx_INCREF(function);
32538  __Pyx_DECREF_SET(__pyx_t_7, function);
32539  }
32540  }
32541  __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_g);
32542  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32543  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1703, __pyx_L1_error)
32544  __Pyx_GOTREF(__pyx_t_8);
32545  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32546  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1703, __pyx_L1_error)
32547  __Pyx_GIVEREF(__pyx_t_8);
32548  __Pyx_GOTREF(__pyx_v_self->vDir);
32549  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
32550  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_8);
32551  __pyx_t_8 = 0;
32552 
32553  /* "WaveTools.py":1704
32554  * self.g = np.array(g)
32555  * self.vDir = setVertDir(g)
32556  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]) # <<<<<<<<<<<<<<
32557  *
32558  * for nn in N:
32559  */
32560  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_g, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1704, __pyx_L1_error)
32561  __Pyx_GOTREF(__pyx_t_8);
32562  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_g, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1704, __pyx_L1_error)
32563  __Pyx_GOTREF(__pyx_t_7);
32564  __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1704, __pyx_L1_error)
32565  __Pyx_GOTREF(__pyx_t_10);
32566  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32567  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32568  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_g, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1704, __pyx_L1_error)
32569  __Pyx_GOTREF(__pyx_t_7);
32570  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_g, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1704, __pyx_L1_error)
32571  __Pyx_GOTREF(__pyx_t_8);
32572  __pyx_t_11 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1704, __pyx_L1_error)
32573  __Pyx_GOTREF(__pyx_t_11);
32574  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32575  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32576  __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1704, __pyx_L1_error)
32577  __Pyx_GOTREF(__pyx_t_8);
32578  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32579  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32580  __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_g, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1704, __pyx_L1_error)
32581  __Pyx_GOTREF(__pyx_t_11);
32582  __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_g, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1704, __pyx_L1_error)
32583  __Pyx_GOTREF(__pyx_t_10);
32584  __pyx_t_7 = PyNumber_Multiply(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1704, __pyx_L1_error)
32585  __Pyx_GOTREF(__pyx_t_7);
32586  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32587  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32588  __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1704, __pyx_L1_error)
32589  __Pyx_GOTREF(__pyx_t_10);
32590  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32591  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32592  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1704, __pyx_L1_error)
32593  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32594  __pyx_v_self->gAbs = sqrt(__pyx_t_14);
32595 
32596  /* "WaveTools.py":1706
32597  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
32598  *
32599  * for nn in N: # <<<<<<<<<<<<<<
32600  * self.Nall+=nn
32601  * if(self.Nall > 10000):
32602  */
32603  if (likely(PyList_CheckExact(__pyx_v_N)) || PyTuple_CheckExact(__pyx_v_N)) {
32604  __pyx_t_10 = __pyx_v_N; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0;
32605  __pyx_t_15 = NULL;
32606  } else {
32607  __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_v_N); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1706, __pyx_L1_error)
32608  __Pyx_GOTREF(__pyx_t_10);
32609  __pyx_t_15 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1706, __pyx_L1_error)
32610  }
32611  for (;;) {
32612  if (likely(!__pyx_t_15)) {
32613  if (likely(PyList_CheckExact(__pyx_t_10))) {
32614  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
32615  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32616  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1706, __pyx_L1_error)
32617  #else
32618  __pyx_t_7 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1706, __pyx_L1_error)
32619  __Pyx_GOTREF(__pyx_t_7);
32620  #endif
32621  } else {
32622  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
32623  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
32624  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1706, __pyx_L1_error)
32625  #else
32626  __pyx_t_7 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1706, __pyx_L1_error)
32627  __Pyx_GOTREF(__pyx_t_7);
32628  #endif
32629  }
32630  } else {
32631  __pyx_t_7 = __pyx_t_15(__pyx_t_10);
32632  if (unlikely(!__pyx_t_7)) {
32633  PyObject* exc_type = PyErr_Occurred();
32634  if (exc_type) {
32635  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
32636  else __PYX_ERR(0, 1706, __pyx_L1_error)
32637  }
32638  break;
32639  }
32640  __Pyx_GOTREF(__pyx_t_7);
32641  }
32642  __Pyx_XDECREF_SET(__pyx_v_nn, __pyx_t_7);
32643  __pyx_t_7 = 0;
32644 
32645  /* "WaveTools.py":1707
32646  *
32647  * for nn in N:
32648  * self.Nall+=nn # <<<<<<<<<<<<<<
32649  * if(self.Nall > 10000):
32650  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for MultispectraRandomWaves is 10000 ",level=0)
32651  */
32652  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1707, __pyx_L1_error)
32653  __Pyx_GOTREF(__pyx_t_7);
32654  __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_v_nn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1707, __pyx_L1_error)
32655  __Pyx_GOTREF(__pyx_t_8);
32656  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32657  __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
32658  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32659  __pyx_v_self->Nall = __pyx_t_16;
32660 
32661  /* "WaveTools.py":1706
32662  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
32663  *
32664  * for nn in N: # <<<<<<<<<<<<<<
32665  * self.Nall+=nn
32666  * if(self.Nall > 10000):
32667  */
32668  }
32669  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32670 
32671  /* "WaveTools.py":1708
32672  * for nn in N:
32673  * self.Nall+=nn
32674  * if(self.Nall > 10000): # <<<<<<<<<<<<<<
32675  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for MultispectraRandomWaves is 10000 ",level=0)
32676  *
32677  */
32678  __pyx_t_5 = ((__pyx_v_self->Nall > 0x2710) != 0);
32679  if (__pyx_t_5) {
32680 
32681  /* "WaveTools.py":1709
32682  * self.Nall+=nn
32683  * if(self.Nall > 10000):
32684  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for MultispectraRandomWaves is 10000 ",level=0) # <<<<<<<<<<<<<<
32685  *
32686  *
32687  */
32688  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1709, __pyx_L1_error)
32689  __Pyx_GOTREF(__pyx_t_10);
32690  __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1709, __pyx_L1_error)
32691  __Pyx_GOTREF(__pyx_t_8);
32692  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 1709, __pyx_L1_error)
32693  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__32, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1709, __pyx_L1_error)
32694  __Pyx_GOTREF(__pyx_t_7);
32695  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32696  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32697  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
32698 
32699  /* "WaveTools.py":1708
32700  * for nn in N:
32701  * self.Nall+=nn
32702  * if(self.Nall > 10000): # <<<<<<<<<<<<<<
32703  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for MultispectraRandomWaves is 10000 ",level=0)
32704  *
32705  */
32706  }
32707 
32708  /* "WaveTools.py":1712
32709  *
32710  *
32711  * self.tanhFM = np.zeros(self.Nall,"d") # <<<<<<<<<<<<<<
32712  * self.omegaM = np.zeros(self.Nall,"d")
32713  * self.kiM = np.zeros(self.Nall,"d")
32714  */
32715  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1712, __pyx_L1_error)
32716  __Pyx_GOTREF(__pyx_t_8);
32717  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1712, __pyx_L1_error)
32718  __Pyx_GOTREF(__pyx_t_10);
32719  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32720  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1712, __pyx_L1_error)
32721  __Pyx_GOTREF(__pyx_t_8);
32722  __pyx_t_11 = NULL;
32723  __pyx_t_16 = 0;
32724  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
32725  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
32726  if (likely(__pyx_t_11)) {
32727  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
32728  __Pyx_INCREF(__pyx_t_11);
32729  __Pyx_INCREF(function);
32730  __Pyx_DECREF_SET(__pyx_t_10, function);
32731  __pyx_t_16 = 1;
32732  }
32733  }
32734  #if CYTHON_FAST_PYCALL
32735  if (PyFunction_Check(__pyx_t_10)) {
32736  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_8, __pyx_n_s_d};
32737  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1712, __pyx_L1_error)
32738  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
32739  __Pyx_GOTREF(__pyx_t_7);
32740  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32741  } else
32742  #endif
32743  #if CYTHON_FAST_PYCCALL
32744  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
32745  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_8, __pyx_n_s_d};
32746  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1712, __pyx_L1_error)
32747  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
32748  __Pyx_GOTREF(__pyx_t_7);
32749  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32750  } else
32751  #endif
32752  {
32753  __pyx_t_13 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1712, __pyx_L1_error)
32754  __Pyx_GOTREF(__pyx_t_13);
32755  if (__pyx_t_11) {
32756  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __pyx_t_11 = NULL;
32757  }
32758  __Pyx_GIVEREF(__pyx_t_8);
32759  PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_16, __pyx_t_8);
32760  __Pyx_INCREF(__pyx_n_s_d);
32761  __Pyx_GIVEREF(__pyx_n_s_d);
32762  PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_16, __pyx_n_s_d);
32763  __pyx_t_8 = 0;
32764  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1712, __pyx_L1_error)
32765  __Pyx_GOTREF(__pyx_t_7);
32766  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
32767  }
32768  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32769  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1712, __pyx_L1_error)
32770  __Pyx_GIVEREF(__pyx_t_7);
32771  __Pyx_GOTREF(__pyx_v_self->tanhFM);
32772  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhFM));
32773  __pyx_v_self->tanhFM = ((PyArrayObject *)__pyx_t_7);
32774  __pyx_t_7 = 0;
32775 
32776  /* "WaveTools.py":1713
32777  *
32778  * self.tanhFM = np.zeros(self.Nall,"d")
32779  * self.omegaM = np.zeros(self.Nall,"d") # <<<<<<<<<<<<<<
32780  * self.kiM = np.zeros(self.Nall,"d")
32781  * self.aiM = np.zeros(self.Nall,"d")
32782  */
32783  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1713, __pyx_L1_error)
32784  __Pyx_GOTREF(__pyx_t_10);
32785  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1713, __pyx_L1_error)
32786  __Pyx_GOTREF(__pyx_t_13);
32787  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32788  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1713, __pyx_L1_error)
32789  __Pyx_GOTREF(__pyx_t_10);
32790  __pyx_t_8 = NULL;
32791  __pyx_t_16 = 0;
32792  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
32793  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_13);
32794  if (likely(__pyx_t_8)) {
32795  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
32796  __Pyx_INCREF(__pyx_t_8);
32797  __Pyx_INCREF(function);
32798  __Pyx_DECREF_SET(__pyx_t_13, function);
32799  __pyx_t_16 = 1;
32800  }
32801  }
32802  #if CYTHON_FAST_PYCALL
32803  if (PyFunction_Check(__pyx_t_13)) {
32804  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_10, __pyx_n_s_d};
32805  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1713, __pyx_L1_error)
32806  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
32807  __Pyx_GOTREF(__pyx_t_7);
32808  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32809  } else
32810  #endif
32811  #if CYTHON_FAST_PYCCALL
32812  if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
32813  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_10, __pyx_n_s_d};
32814  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1713, __pyx_L1_error)
32815  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
32816  __Pyx_GOTREF(__pyx_t_7);
32817  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32818  } else
32819  #endif
32820  {
32821  __pyx_t_11 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1713, __pyx_L1_error)
32822  __Pyx_GOTREF(__pyx_t_11);
32823  if (__pyx_t_8) {
32824  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
32825  }
32826  __Pyx_GIVEREF(__pyx_t_10);
32827  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_16, __pyx_t_10);
32828  __Pyx_INCREF(__pyx_n_s_d);
32829  __Pyx_GIVEREF(__pyx_n_s_d);
32830  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_16, __pyx_n_s_d);
32831  __pyx_t_10 = 0;
32832  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1713, __pyx_L1_error)
32833  __Pyx_GOTREF(__pyx_t_7);
32834  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32835  }
32836  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
32837  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1713, __pyx_L1_error)
32838  __Pyx_GIVEREF(__pyx_t_7);
32839  __Pyx_GOTREF(__pyx_v_self->omegaM);
32840  __Pyx_DECREF(((PyObject *)__pyx_v_self->omegaM));
32841  __pyx_v_self->omegaM = ((PyArrayObject *)__pyx_t_7);
32842  __pyx_t_7 = 0;
32843 
32844  /* "WaveTools.py":1714
32845  * self.tanhFM = np.zeros(self.Nall,"d")
32846  * self.omegaM = np.zeros(self.Nall,"d")
32847  * self.kiM = np.zeros(self.Nall,"d") # <<<<<<<<<<<<<<
32848  * self.aiM = np.zeros(self.Nall,"d")
32849  * self.kDirM = np.zeros((self.Nall,3),"d")
32850  */
32851  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1714, __pyx_L1_error)
32852  __Pyx_GOTREF(__pyx_t_13);
32853  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1714, __pyx_L1_error)
32854  __Pyx_GOTREF(__pyx_t_11);
32855  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
32856  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1714, __pyx_L1_error)
32857  __Pyx_GOTREF(__pyx_t_13);
32858  __pyx_t_10 = NULL;
32859  __pyx_t_16 = 0;
32860  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
32861  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
32862  if (likely(__pyx_t_10)) {
32863  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
32864  __Pyx_INCREF(__pyx_t_10);
32865  __Pyx_INCREF(function);
32866  __Pyx_DECREF_SET(__pyx_t_11, function);
32867  __pyx_t_16 = 1;
32868  }
32869  }
32870  #if CYTHON_FAST_PYCALL
32871  if (PyFunction_Check(__pyx_t_11)) {
32872  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_13, __pyx_n_s_d};
32873  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1714, __pyx_L1_error)
32874  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32875  __Pyx_GOTREF(__pyx_t_7);
32876  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
32877  } else
32878  #endif
32879  #if CYTHON_FAST_PYCCALL
32880  if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
32881  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_13, __pyx_n_s_d};
32882  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1714, __pyx_L1_error)
32883  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
32884  __Pyx_GOTREF(__pyx_t_7);
32885  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
32886  } else
32887  #endif
32888  {
32889  __pyx_t_8 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1714, __pyx_L1_error)
32890  __Pyx_GOTREF(__pyx_t_8);
32891  if (__pyx_t_10) {
32892  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
32893  }
32894  __Pyx_GIVEREF(__pyx_t_13);
32895  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_16, __pyx_t_13);
32896  __Pyx_INCREF(__pyx_n_s_d);
32897  __Pyx_GIVEREF(__pyx_n_s_d);
32898  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_16, __pyx_n_s_d);
32899  __pyx_t_13 = 0;
32900  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1714, __pyx_L1_error)
32901  __Pyx_GOTREF(__pyx_t_7);
32902  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32903  }
32904  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32905  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1714, __pyx_L1_error)
32906  __Pyx_GIVEREF(__pyx_t_7);
32907  __Pyx_GOTREF(__pyx_v_self->kiM);
32908  __Pyx_DECREF(((PyObject *)__pyx_v_self->kiM));
32909  __pyx_v_self->kiM = ((PyArrayObject *)__pyx_t_7);
32910  __pyx_t_7 = 0;
32911 
32912  /* "WaveTools.py":1715
32913  * self.omegaM = np.zeros(self.Nall,"d")
32914  * self.kiM = np.zeros(self.Nall,"d")
32915  * self.aiM = np.zeros(self.Nall,"d") # <<<<<<<<<<<<<<
32916  * self.kDirM = np.zeros((self.Nall,3),"d")
32917  * self.phiM= np.zeros(self.Nall,"d")
32918  */
32919  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1715, __pyx_L1_error)
32920  __Pyx_GOTREF(__pyx_t_11);
32921  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1715, __pyx_L1_error)
32922  __Pyx_GOTREF(__pyx_t_8);
32923  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32924  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1715, __pyx_L1_error)
32925  __Pyx_GOTREF(__pyx_t_11);
32926  __pyx_t_13 = NULL;
32927  __pyx_t_16 = 0;
32928  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
32929  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
32930  if (likely(__pyx_t_13)) {
32931  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
32932  __Pyx_INCREF(__pyx_t_13);
32933  __Pyx_INCREF(function);
32934  __Pyx_DECREF_SET(__pyx_t_8, function);
32935  __pyx_t_16 = 1;
32936  }
32937  }
32938  #if CYTHON_FAST_PYCALL
32939  if (PyFunction_Check(__pyx_t_8)) {
32940  PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_n_s_d};
32941  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1715, __pyx_L1_error)
32942  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
32943  __Pyx_GOTREF(__pyx_t_7);
32944  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32945  } else
32946  #endif
32947  #if CYTHON_FAST_PYCCALL
32948  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
32949  PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_n_s_d};
32950  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1715, __pyx_L1_error)
32951  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
32952  __Pyx_GOTREF(__pyx_t_7);
32953  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
32954  } else
32955  #endif
32956  {
32957  __pyx_t_10 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1715, __pyx_L1_error)
32958  __Pyx_GOTREF(__pyx_t_10);
32959  if (__pyx_t_13) {
32960  __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13); __pyx_t_13 = NULL;
32961  }
32962  __Pyx_GIVEREF(__pyx_t_11);
32963  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_16, __pyx_t_11);
32964  __Pyx_INCREF(__pyx_n_s_d);
32965  __Pyx_GIVEREF(__pyx_n_s_d);
32966  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_16, __pyx_n_s_d);
32967  __pyx_t_11 = 0;
32968  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1715, __pyx_L1_error)
32969  __Pyx_GOTREF(__pyx_t_7);
32970  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
32971  }
32972  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32973  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1715, __pyx_L1_error)
32974  __Pyx_GIVEREF(__pyx_t_7);
32975  __Pyx_GOTREF(__pyx_v_self->aiM);
32976  __Pyx_DECREF(((PyObject *)__pyx_v_self->aiM));
32977  __pyx_v_self->aiM = ((PyArrayObject *)__pyx_t_7);
32978  __pyx_t_7 = 0;
32979 
32980  /* "WaveTools.py":1716
32981  * self.kiM = np.zeros(self.Nall,"d")
32982  * self.aiM = np.zeros(self.Nall,"d")
32983  * self.kDirM = np.zeros((self.Nall,3),"d") # <<<<<<<<<<<<<<
32984  * self.phiM= np.zeros(self.Nall,"d")
32985  * self.waveDir = np.zeros((self.Nall,3),"d")
32986  */
32987  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1716, __pyx_L1_error)
32988  __Pyx_GOTREF(__pyx_t_8);
32989  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1716, __pyx_L1_error)
32990  __Pyx_GOTREF(__pyx_t_10);
32991  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
32992  __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1716, __pyx_L1_error)
32993  __Pyx_GOTREF(__pyx_t_8);
32994  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1716, __pyx_L1_error)
32995  __Pyx_GOTREF(__pyx_t_11);
32996  __Pyx_GIVEREF(__pyx_t_8);
32997  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
32998  __Pyx_INCREF(__pyx_int_3);
32999  __Pyx_GIVEREF(__pyx_int_3);
33000  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_int_3);
33001  __pyx_t_8 = 0;
33002  __pyx_t_8 = NULL;
33003  __pyx_t_16 = 0;
33004  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
33005  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
33006  if (likely(__pyx_t_8)) {
33007  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
33008  __Pyx_INCREF(__pyx_t_8);
33009  __Pyx_INCREF(function);
33010  __Pyx_DECREF_SET(__pyx_t_10, function);
33011  __pyx_t_16 = 1;
33012  }
33013  }
33014  #if CYTHON_FAST_PYCALL
33015  if (PyFunction_Check(__pyx_t_10)) {
33016  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_11, __pyx_n_s_d};
33017  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1716, __pyx_L1_error)
33018  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
33019  __Pyx_GOTREF(__pyx_t_7);
33020  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
33021  } else
33022  #endif
33023  #if CYTHON_FAST_PYCCALL
33024  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
33025  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_11, __pyx_n_s_d};
33026  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1716, __pyx_L1_error)
33027  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
33028  __Pyx_GOTREF(__pyx_t_7);
33029  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
33030  } else
33031  #endif
33032  {
33033  __pyx_t_13 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1716, __pyx_L1_error)
33034  __Pyx_GOTREF(__pyx_t_13);
33035  if (__pyx_t_8) {
33036  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __pyx_t_8 = NULL;
33037  }
33038  __Pyx_GIVEREF(__pyx_t_11);
33039  PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_16, __pyx_t_11);
33040  __Pyx_INCREF(__pyx_n_s_d);
33041  __Pyx_GIVEREF(__pyx_n_s_d);
33042  PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_16, __pyx_n_s_d);
33043  __pyx_t_11 = 0;
33044  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1716, __pyx_L1_error)
33045  __Pyx_GOTREF(__pyx_t_7);
33046  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
33047  }
33048  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33049  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1716, __pyx_L1_error)
33050  __Pyx_GIVEREF(__pyx_t_7);
33051  __Pyx_GOTREF(__pyx_v_self->kDirM);
33052  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDirM));
33053  __pyx_v_self->kDirM = ((PyArrayObject *)__pyx_t_7);
33054  __pyx_t_7 = 0;
33055 
33056  /* "WaveTools.py":1717
33057  * self.aiM = np.zeros(self.Nall,"d")
33058  * self.kDirM = np.zeros((self.Nall,3),"d")
33059  * self.phiM= np.zeros(self.Nall,"d") # <<<<<<<<<<<<<<
33060  * self.waveDir = np.zeros((self.Nall,3),"d")
33061  *
33062  */
33063  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1717, __pyx_L1_error)
33064  __Pyx_GOTREF(__pyx_t_10);
33065  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1717, __pyx_L1_error)
33066  __Pyx_GOTREF(__pyx_t_13);
33067  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33068  __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1717, __pyx_L1_error)
33069  __Pyx_GOTREF(__pyx_t_10);
33070  __pyx_t_11 = NULL;
33071  __pyx_t_16 = 0;
33072  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
33073  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
33074  if (likely(__pyx_t_11)) {
33075  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
33076  __Pyx_INCREF(__pyx_t_11);
33077  __Pyx_INCREF(function);
33078  __Pyx_DECREF_SET(__pyx_t_13, function);
33079  __pyx_t_16 = 1;
33080  }
33081  }
33082  #if CYTHON_FAST_PYCALL
33083  if (PyFunction_Check(__pyx_t_13)) {
33084  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_10, __pyx_n_s_d};
33085  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1717, __pyx_L1_error)
33086  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
33087  __Pyx_GOTREF(__pyx_t_7);
33088  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33089  } else
33090  #endif
33091  #if CYTHON_FAST_PYCCALL
33092  if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
33093  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_10, __pyx_n_s_d};
33094  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1717, __pyx_L1_error)
33095  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
33096  __Pyx_GOTREF(__pyx_t_7);
33097  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33098  } else
33099  #endif
33100  {
33101  __pyx_t_8 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1717, __pyx_L1_error)
33102  __Pyx_GOTREF(__pyx_t_8);
33103  if (__pyx_t_11) {
33104  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11); __pyx_t_11 = NULL;
33105  }
33106  __Pyx_GIVEREF(__pyx_t_10);
33107  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_16, __pyx_t_10);
33108  __Pyx_INCREF(__pyx_n_s_d);
33109  __Pyx_GIVEREF(__pyx_n_s_d);
33110  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_16, __pyx_n_s_d);
33111  __pyx_t_10 = 0;
33112  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1717, __pyx_L1_error)
33113  __Pyx_GOTREF(__pyx_t_7);
33114  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33115  }
33116  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
33117  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1717, __pyx_L1_error)
33118  __Pyx_GIVEREF(__pyx_t_7);
33119  __Pyx_GOTREF(__pyx_v_self->phiM);
33120  __Pyx_DECREF(((PyObject *)__pyx_v_self->phiM));
33121  __pyx_v_self->phiM = ((PyArrayObject *)__pyx_t_7);
33122  __pyx_t_7 = 0;
33123 
33124  /* "WaveTools.py":1718
33125  * self.kDirM = np.zeros((self.Nall,3),"d")
33126  * self.phiM= np.zeros(self.Nall,"d")
33127  * self.waveDir = np.zeros((self.Nall,3),"d") # <<<<<<<<<<<<<<
33128  *
33129  *
33130  */
33131  __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_np); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1718, __pyx_L1_error)
33132  __Pyx_GOTREF(__pyx_t_13);
33133  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1718, __pyx_L1_error)
33134  __Pyx_GOTREF(__pyx_t_8);
33135  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
33136  __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1718, __pyx_L1_error)
33137  __Pyx_GOTREF(__pyx_t_13);
33138  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1718, __pyx_L1_error)
33139  __Pyx_GOTREF(__pyx_t_10);
33140  __Pyx_GIVEREF(__pyx_t_13);
33141  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_13);
33142  __Pyx_INCREF(__pyx_int_3);
33143  __Pyx_GIVEREF(__pyx_int_3);
33144  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_3);
33145  __pyx_t_13 = 0;
33146  __pyx_t_13 = NULL;
33147  __pyx_t_16 = 0;
33148  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
33149  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
33150  if (likely(__pyx_t_13)) {
33151  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
33152  __Pyx_INCREF(__pyx_t_13);
33153  __Pyx_INCREF(function);
33154  __Pyx_DECREF_SET(__pyx_t_8, function);
33155  __pyx_t_16 = 1;
33156  }
33157  }
33158  #if CYTHON_FAST_PYCALL
33159  if (PyFunction_Check(__pyx_t_8)) {
33160  PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_10, __pyx_n_s_d};
33161  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1718, __pyx_L1_error)
33162  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
33163  __Pyx_GOTREF(__pyx_t_7);
33164  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33165  } else
33166  #endif
33167  #if CYTHON_FAST_PYCCALL
33168  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
33169  PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_10, __pyx_n_s_d};
33170  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1718, __pyx_L1_error)
33171  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
33172  __Pyx_GOTREF(__pyx_t_7);
33173  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33174  } else
33175  #endif
33176  {
33177  __pyx_t_11 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1718, __pyx_L1_error)
33178  __Pyx_GOTREF(__pyx_t_11);
33179  if (__pyx_t_13) {
33180  __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); __pyx_t_13 = NULL;
33181  }
33182  __Pyx_GIVEREF(__pyx_t_10);
33183  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_16, __pyx_t_10);
33184  __Pyx_INCREF(__pyx_n_s_d);
33185  __Pyx_GIVEREF(__pyx_n_s_d);
33186  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_16, __pyx_n_s_d);
33187  __pyx_t_10 = 0;
33188  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1718, __pyx_L1_error)
33189  __Pyx_GOTREF(__pyx_t_7);
33190  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
33191  }
33192  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33193  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1718, __pyx_L1_error)
33194  __Pyx_GIVEREF(__pyx_t_7);
33195  __Pyx_GOTREF(__pyx_v_self->waveDir);
33196  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
33197  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_7);
33198  __pyx_t_7 = 0;
33199 
33200  /* "WaveTools.py":1721
33201  *
33202  *
33203  * NN = 0 # <<<<<<<<<<<<<<
33204  * for kk in range(Nspectra):
33205  * logEvent("INFO Wavetools.py: Reading spectra No %s" %kk)
33206  */
33207  __Pyx_INCREF(__pyx_int_0);
33208  __pyx_v_NN = __pyx_int_0;
33209 
33210  /* "WaveTools.py":1722
33211  *
33212  * NN = 0
33213  * for kk in range(Nspectra): # <<<<<<<<<<<<<<
33214  * logEvent("INFO Wavetools.py: Reading spectra No %s" %kk)
33215  * NN1 = NN
33216  */
33217  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1722, __pyx_L1_error)
33218  __Pyx_GOTREF(__pyx_t_8);
33219  __pyx_t_11 = NULL;
33220  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
33221  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
33222  if (likely(__pyx_t_11)) {
33223  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
33224  __Pyx_INCREF(__pyx_t_11);
33225  __Pyx_INCREF(function);
33226  __Pyx_DECREF_SET(__pyx_t_8, function);
33227  }
33228  }
33229  __pyx_t_7 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_v_Nspectra) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_Nspectra);
33230  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
33231  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1722, __pyx_L1_error)
33232  __Pyx_GOTREF(__pyx_t_7);
33233  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33234  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
33235  __pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
33236  __pyx_t_15 = NULL;
33237  } else {
33238  __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1722, __pyx_L1_error)
33239  __Pyx_GOTREF(__pyx_t_8);
33240  __pyx_t_15 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1722, __pyx_L1_error)
33241  }
33242  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33243  for (;;) {
33244  if (likely(!__pyx_t_15)) {
33245  if (likely(PyList_CheckExact(__pyx_t_8))) {
33246  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
33247  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33248  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1722, __pyx_L1_error)
33249  #else
33250  __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1722, __pyx_L1_error)
33251  __Pyx_GOTREF(__pyx_t_7);
33252  #endif
33253  } else {
33254  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
33255  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33256  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1722, __pyx_L1_error)
33257  #else
33258  __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1722, __pyx_L1_error)
33259  __Pyx_GOTREF(__pyx_t_7);
33260  #endif
33261  }
33262  } else {
33263  __pyx_t_7 = __pyx_t_15(__pyx_t_8);
33264  if (unlikely(!__pyx_t_7)) {
33265  PyObject* exc_type = PyErr_Occurred();
33266  if (exc_type) {
33267  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
33268  else __PYX_ERR(0, 1722, __pyx_L1_error)
33269  }
33270  break;
33271  }
33272  __Pyx_GOTREF(__pyx_t_7);
33273  }
33274  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_7);
33275  __pyx_t_7 = 0;
33276 
33277  /* "WaveTools.py":1723
33278  * NN = 0
33279  * for kk in range(Nspectra):
33280  * logEvent("INFO Wavetools.py: Reading spectra No %s" %kk) # <<<<<<<<<<<<<<
33281  * NN1 = NN
33282  * NN +=N[kk]
33283  */
33284  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1723, __pyx_L1_error)
33285  __Pyx_GOTREF(__pyx_t_11);
33286  __pyx_t_10 = __Pyx_PyString_FormatSafe(__pyx_kp_s_INFO_Wavetools_py_Reading_spectr, __pyx_v_kk); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1723, __pyx_L1_error)
33287  __Pyx_GOTREF(__pyx_t_10);
33288  __pyx_t_13 = NULL;
33289  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
33290  __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
33291  if (likely(__pyx_t_13)) {
33292  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
33293  __Pyx_INCREF(__pyx_t_13);
33294  __Pyx_INCREF(function);
33295  __Pyx_DECREF_SET(__pyx_t_11, function);
33296  }
33297  }
33298  __pyx_t_7 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_13, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
33299  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
33300  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
33301  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1723, __pyx_L1_error)
33302  __Pyx_GOTREF(__pyx_t_7);
33303  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
33304  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33305 
33306  /* "WaveTools.py":1724
33307  * for kk in range(Nspectra):
33308  * logEvent("INFO Wavetools.py: Reading spectra No %s" %kk)
33309  * NN1 = NN # <<<<<<<<<<<<<<
33310  * NN +=N[kk]
33311  * RW = RandomWaves(
33312  */
33313  __Pyx_INCREF(__pyx_v_NN);
33314  __Pyx_XDECREF_SET(__pyx_v_NN1, __pyx_v_NN);
33315 
33316  /* "WaveTools.py":1725
33317  * logEvent("INFO Wavetools.py: Reading spectra No %s" %kk)
33318  * NN1 = NN
33319  * NN +=N[kk] # <<<<<<<<<<<<<<
33320  * RW = RandomWaves(
33321  * Tp[kk], # np array with
33322  */
33323  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_N, __pyx_v_kk); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1725, __pyx_L1_error)
33324  __Pyx_GOTREF(__pyx_t_7);
33325  __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_NN, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1725, __pyx_L1_error)
33326  __Pyx_GOTREF(__pyx_t_11);
33327  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
33328  __Pyx_DECREF_SET(__pyx_v_NN, __pyx_t_11);
33329  __pyx_t_11 = 0;
33330 
33331  /* "WaveTools.py":1727
33332  * NN +=N[kk]
33333  * RW = RandomWaves(
33334  * Tp[kk], # np array with # <<<<<<<<<<<<<<
33335  * Hs[kk],
33336  * mwl,#m significant wave height
33337  */
33338  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_Tp, __pyx_v_kk); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1727, __pyx_L1_error)
33339  __Pyx_GOTREF(__pyx_t_11);
33340 
33341  /* "WaveTools.py":1728
33342  * RW = RandomWaves(
33343  * Tp[kk], # np array with
33344  * Hs[kk], # <<<<<<<<<<<<<<
33345  * mwl,#m significant wave height
33346  * depth, #m depth
33347  */
33348  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_Hs, __pyx_v_kk); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1728, __pyx_L1_error)
33349  __Pyx_GOTREF(__pyx_t_7);
33350 
33351  /* "WaveTools.py":1731
33352  * mwl,#m significant wave height
33353  * depth, #m depth
33354  * waveDir[kk], # <<<<<<<<<<<<<<
33355  * g, #peak frequency
33356  * N[kk],
33357  */
33358  __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_waveDir, __pyx_v_kk); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1731, __pyx_L1_error)
33359  __Pyx_GOTREF(__pyx_t_10);
33360 
33361  /* "WaveTools.py":1733
33362  * waveDir[kk],
33363  * g, #peak frequency
33364  * N[kk], # <<<<<<<<<<<<<<
33365  * bandFactor[kk], #accelerationof gravity
33366  * spectName[kk],# random words will result in error and return the available spectra
33367  */
33368  __pyx_t_13 = __Pyx_PyObject_GetItem(__pyx_v_N, __pyx_v_kk); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1733, __pyx_L1_error)
33369  __Pyx_GOTREF(__pyx_t_13);
33370 
33371  /* "WaveTools.py":1734
33372  * g, #peak frequency
33373  * N[kk],
33374  * bandFactor[kk], #accelerationof gravity # <<<<<<<<<<<<<<
33375  * spectName[kk],# random words will result in error and return the available spectra
33376  * spectral_params[kk], #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
33377  */
33378  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_bandFactor, __pyx_v_kk); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1734, __pyx_L1_error)
33379  __Pyx_GOTREF(__pyx_t_12);
33380 
33381  /* "WaveTools.py":1735
33382  * N[kk],
33383  * bandFactor[kk], #accelerationof gravity
33384  * spectName[kk],# random words will result in error and return the available spectra # <<<<<<<<<<<<<<
33385  * spectral_params[kk], #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
33386  * phi[kk],
33387  */
33388  __pyx_t_17 = __Pyx_PyObject_GetItem(__pyx_v_spectName, __pyx_v_kk); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1735, __pyx_L1_error)
33389  __Pyx_GOTREF(__pyx_t_17);
33390 
33391  /* "WaveTools.py":1736
33392  * bandFactor[kk], #accelerationof gravity
33393  * spectName[kk],# random words will result in error and return the available spectra
33394  * spectral_params[kk], #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth} # <<<<<<<<<<<<<<
33395  * phi[kk],
33396  * self.fast
33397  */
33398  __pyx_t_18 = __Pyx_PyObject_GetItem(__pyx_v_spectral_params, __pyx_v_kk); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1736, __pyx_L1_error)
33399  __Pyx_GOTREF(__pyx_t_18);
33400 
33401  /* "WaveTools.py":1737
33402  * spectName[kk],# random words will result in error and return the available spectra
33403  * spectral_params[kk], #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
33404  * phi[kk], # <<<<<<<<<<<<<<
33405  * self.fast
33406  * )
33407  */
33408  __pyx_t_19 = __Pyx_PyObject_GetItem(__pyx_v_phi, __pyx_v_kk); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1737, __pyx_L1_error)
33409  __Pyx_GOTREF(__pyx_t_19);
33410 
33411  /* "WaveTools.py":1738
33412  * spectral_params[kk], #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
33413  * phi[kk],
33414  * self.fast # <<<<<<<<<<<<<<
33415  * )
33416  * self.tanhFM[NN1:NN] = RW.tanhF
33417  */
33418  __pyx_t_20 = __Pyx_PyBool_FromLong(__pyx_v_self->fast); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1738, __pyx_L1_error)
33419  __Pyx_GOTREF(__pyx_t_20);
33420 
33421  /* "WaveTools.py":1726
33422  * NN1 = NN
33423  * NN +=N[kk]
33424  * RW = RandomWaves( # <<<<<<<<<<<<<<
33425  * Tp[kk], # np array with
33426  * Hs[kk],
33427  */
33428  __pyx_t_21 = PyTuple_New(12); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1726, __pyx_L1_error)
33429  __Pyx_GOTREF(__pyx_t_21);
33430  __Pyx_GIVEREF(__pyx_t_11);
33431  PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_11);
33432  __Pyx_GIVEREF(__pyx_t_7);
33433  PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_7);
33434  __Pyx_INCREF(__pyx_v_mwl);
33435  __Pyx_GIVEREF(__pyx_v_mwl);
33436  PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_v_mwl);
33437  __Pyx_INCREF(__pyx_v_depth);
33438  __Pyx_GIVEREF(__pyx_v_depth);
33439  PyTuple_SET_ITEM(__pyx_t_21, 3, __pyx_v_depth);
33440  __Pyx_GIVEREF(__pyx_t_10);
33441  PyTuple_SET_ITEM(__pyx_t_21, 4, __pyx_t_10);
33442  __Pyx_INCREF(__pyx_v_g);
33443  __Pyx_GIVEREF(__pyx_v_g);
33444  PyTuple_SET_ITEM(__pyx_t_21, 5, __pyx_v_g);
33445  __Pyx_GIVEREF(__pyx_t_13);
33446  PyTuple_SET_ITEM(__pyx_t_21, 6, __pyx_t_13);
33447  __Pyx_GIVEREF(__pyx_t_12);
33448  PyTuple_SET_ITEM(__pyx_t_21, 7, __pyx_t_12);
33449  __Pyx_GIVEREF(__pyx_t_17);
33450  PyTuple_SET_ITEM(__pyx_t_21, 8, __pyx_t_17);
33451  __Pyx_GIVEREF(__pyx_t_18);
33452  PyTuple_SET_ITEM(__pyx_t_21, 9, __pyx_t_18);
33453  __Pyx_GIVEREF(__pyx_t_19);
33454  PyTuple_SET_ITEM(__pyx_t_21, 10, __pyx_t_19);
33455  __Pyx_GIVEREF(__pyx_t_20);
33456  PyTuple_SET_ITEM(__pyx_t_21, 11, __pyx_t_20);
33457  __pyx_t_11 = 0;
33458  __pyx_t_7 = 0;
33459  __pyx_t_10 = 0;
33460  __pyx_t_13 = 0;
33461  __pyx_t_12 = 0;
33462  __pyx_t_17 = 0;
33463  __pyx_t_18 = 0;
33464  __pyx_t_19 = 0;
33465  __pyx_t_20 = 0;
33466  __pyx_t_20 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_RandomWaves), __pyx_t_21, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1726, __pyx_L1_error)
33467  __Pyx_GOTREF(__pyx_t_20);
33468  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33469  __Pyx_XDECREF_SET(__pyx_v_RW, ((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_t_20));
33470  __pyx_t_20 = 0;
33471 
33472  /* "WaveTools.py":1740
33473  * self.fast
33474  * )
33475  * self.tanhFM[NN1:NN] = RW.tanhF # <<<<<<<<<<<<<<
33476  * self.omegaM[NN1:NN] = RW.omega
33477  * self.kiM[NN1:NN] = RW.ki
33478  */
33479  __pyx_t_20 = ((PyObject *)__pyx_v_RW->tanhF);
33480  __Pyx_INCREF(__pyx_t_20);
33481  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->tanhFM), __pyx_t_20, 0, 0, &__pyx_v_NN1, &__pyx_v_NN, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1740, __pyx_L1_error)
33482  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33483 
33484  /* "WaveTools.py":1741
33485  * )
33486  * self.tanhFM[NN1:NN] = RW.tanhF
33487  * self.omegaM[NN1:NN] = RW.omega # <<<<<<<<<<<<<<
33488  * self.kiM[NN1:NN] = RW.ki
33489  * self.aiM[NN1:NN] = RW.ai
33490  */
33491  __pyx_t_20 = ((PyObject *)__pyx_v_RW->omega);
33492  __Pyx_INCREF(__pyx_t_20);
33493  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->omegaM), __pyx_t_20, 0, 0, &__pyx_v_NN1, &__pyx_v_NN, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1741, __pyx_L1_error)
33494  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33495 
33496  /* "WaveTools.py":1742
33497  * self.tanhFM[NN1:NN] = RW.tanhF
33498  * self.omegaM[NN1:NN] = RW.omega
33499  * self.kiM[NN1:NN] = RW.ki # <<<<<<<<<<<<<<
33500  * self.aiM[NN1:NN] = RW.ai
33501  * self.kDirM[NN1:NN,:] =RW.kDir[:,:]
33502  */
33503  __pyx_t_20 = ((PyObject *)__pyx_v_RW->ki);
33504  __Pyx_INCREF(__pyx_t_20);
33505  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->kiM), __pyx_t_20, 0, 0, &__pyx_v_NN1, &__pyx_v_NN, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1742, __pyx_L1_error)
33506  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33507 
33508  /* "WaveTools.py":1743
33509  * self.omegaM[NN1:NN] = RW.omega
33510  * self.kiM[NN1:NN] = RW.ki
33511  * self.aiM[NN1:NN] = RW.ai # <<<<<<<<<<<<<<
33512  * self.kDirM[NN1:NN,:] =RW.kDir[:,:]
33513  * self.phiM[NN1:NN] = RW.phi
33514  */
33515  __pyx_t_20 = ((PyObject *)__pyx_v_RW->ai);
33516  __Pyx_INCREF(__pyx_t_20);
33517  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->aiM), __pyx_t_20, 0, 0, &__pyx_v_NN1, &__pyx_v_NN, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1743, __pyx_L1_error)
33518  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33519 
33520  /* "WaveTools.py":1744
33521  * self.kiM[NN1:NN] = RW.ki
33522  * self.aiM[NN1:NN] = RW.ai
33523  * self.kDirM[NN1:NN,:] =RW.kDir[:,:] # <<<<<<<<<<<<<<
33524  * self.phiM[NN1:NN] = RW.phi
33525  * for ij in range(3):
33526  */
33527  __pyx_t_20 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_RW->kDir), __pyx_tuple__33); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1744, __pyx_L1_error)
33528  __Pyx_GOTREF(__pyx_t_20);
33529  __pyx_t_21 = PySlice_New(__pyx_v_NN1, __pyx_v_NN, Py_None); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1744, __pyx_L1_error)
33530  __Pyx_GOTREF(__pyx_t_21);
33531  __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1744, __pyx_L1_error)
33532  __Pyx_GOTREF(__pyx_t_19);
33533  __Pyx_GIVEREF(__pyx_t_21);
33534  PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_21);
33535  __Pyx_INCREF(__pyx_slice__4);
33536  __Pyx_GIVEREF(__pyx_slice__4);
33537  PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_slice__4);
33538  __pyx_t_21 = 0;
33539  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->kDirM), __pyx_t_19, __pyx_t_20) < 0)) __PYX_ERR(0, 1744, __pyx_L1_error)
33540  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33541  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33542 
33543  /* "WaveTools.py":1745
33544  * self.aiM[NN1:NN] = RW.ai
33545  * self.kDirM[NN1:NN,:] =RW.kDir[:,:]
33546  * self.phiM[NN1:NN] = RW.phi # <<<<<<<<<<<<<<
33547  * for ij in range(3):
33548  * self.vDir_c[ij] = self.vDir[ij]
33549  */
33550  __pyx_t_20 = __pyx_v_RW->phi;
33551  __Pyx_INCREF(__pyx_t_20);
33552  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->phiM), __pyx_t_20, 0, 0, &__pyx_v_NN1, &__pyx_v_NN, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 1745, __pyx_L1_error)
33553  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33554 
33555  /* "WaveTools.py":1722
33556  *
33557  * NN = 0
33558  * for kk in range(Nspectra): # <<<<<<<<<<<<<<
33559  * logEvent("INFO Wavetools.py: Reading spectra No %s" %kk)
33560  * NN1 = NN
33561  */
33562  }
33563  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33564 
33565  /* "WaveTools.py":1746
33566  * self.kDirM[NN1:NN,:] =RW.kDir[:,:]
33567  * self.phiM[NN1:NN] = RW.phi
33568  * for ij in range(3): # <<<<<<<<<<<<<<
33569  * self.vDir_c[ij] = self.vDir[ij]
33570  * self.vDir_ = self.vDir_c
33571  */
33572  __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_range); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1746, __pyx_L1_error)
33573  __Pyx_GOTREF(__pyx_t_20);
33574  __pyx_t_19 = NULL;
33575  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_20))) {
33576  __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_20);
33577  if (likely(__pyx_t_19)) {
33578  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
33579  __Pyx_INCREF(__pyx_t_19);
33580  __Pyx_INCREF(function);
33581  __Pyx_DECREF_SET(__pyx_t_20, function);
33582  }
33583  }
33584  __pyx_t_8 = (__pyx_t_19) ? __Pyx_PyObject_Call2Args(__pyx_t_20, __pyx_t_19, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_int_3);
33585  __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
33586  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1746, __pyx_L1_error)
33587  __Pyx_GOTREF(__pyx_t_8);
33588  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33589  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
33590  __pyx_t_20 = __pyx_t_8; __Pyx_INCREF(__pyx_t_20); __pyx_t_6 = 0;
33591  __pyx_t_15 = NULL;
33592  } else {
33593  __pyx_t_6 = -1; __pyx_t_20 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1746, __pyx_L1_error)
33594  __Pyx_GOTREF(__pyx_t_20);
33595  __pyx_t_15 = Py_TYPE(__pyx_t_20)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1746, __pyx_L1_error)
33596  }
33597  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33598  for (;;) {
33599  if (likely(!__pyx_t_15)) {
33600  if (likely(PyList_CheckExact(__pyx_t_20))) {
33601  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_20)) break;
33602  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33603  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_20, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1746, __pyx_L1_error)
33604  #else
33605  __pyx_t_8 = PySequence_ITEM(__pyx_t_20, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1746, __pyx_L1_error)
33606  __Pyx_GOTREF(__pyx_t_8);
33607  #endif
33608  } else {
33609  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_20)) break;
33610  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33611  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_20, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1746, __pyx_L1_error)
33612  #else
33613  __pyx_t_8 = PySequence_ITEM(__pyx_t_20, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1746, __pyx_L1_error)
33614  __Pyx_GOTREF(__pyx_t_8);
33615  #endif
33616  }
33617  } else {
33618  __pyx_t_8 = __pyx_t_15(__pyx_t_20);
33619  if (unlikely(!__pyx_t_8)) {
33620  PyObject* exc_type = PyErr_Occurred();
33621  if (exc_type) {
33622  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
33623  else __PYX_ERR(0, 1746, __pyx_L1_error)
33624  }
33625  break;
33626  }
33627  __Pyx_GOTREF(__pyx_t_8);
33628  }
33629  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_8);
33630  __pyx_t_8 = 0;
33631 
33632  /* "WaveTools.py":1747
33633  * self.phiM[NN1:NN] = RW.phi
33634  * for ij in range(3):
33635  * self.vDir_c[ij] = self.vDir[ij] # <<<<<<<<<<<<<<
33636  * self.vDir_ = self.vDir_c
33637  *
33638  */
33639  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->vDir), __pyx_v_ij); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1747, __pyx_L1_error)
33640  __Pyx_GOTREF(__pyx_t_8);
33641  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L1_error)
33642  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33643  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1747, __pyx_L1_error)
33644  (__pyx_v_self->vDir_c[__pyx_t_22]) = __pyx_t_14;
33645 
33646  /* "WaveTools.py":1746
33647  * self.kDirM[NN1:NN,:] =RW.kDir[:,:]
33648  * self.phiM[NN1:NN] = RW.phi
33649  * for ij in range(3): # <<<<<<<<<<<<<<
33650  * self.vDir_c[ij] = self.vDir[ij]
33651  * self.vDir_ = self.vDir_c
33652  */
33653  }
33654  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33655 
33656  /* "WaveTools.py":1748
33657  * for ij in range(3):
33658  * self.vDir_c[ij] = self.vDir[ij]
33659  * self.vDir_ = self.vDir_c # <<<<<<<<<<<<<<
33660  *
33661  *
33662  */
33663  __pyx_t_23 = __pyx_v_self->vDir_c;
33664  __pyx_v_self->vDir_ = __pyx_t_23;
33665 
33666  /* "WaveTools.py":1751
33667  *
33668  *
33669  * for ij in range(self.Nall): # <<<<<<<<<<<<<<
33670  * for kk in range(3):
33671  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk]
33672  */
33673  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1751, __pyx_L1_error)
33674  __Pyx_GOTREF(__pyx_t_8);
33675  __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_self->Nall); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1751, __pyx_L1_error)
33676  __Pyx_GOTREF(__pyx_t_19);
33677  __pyx_t_21 = NULL;
33678  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
33679  __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_8);
33680  if (likely(__pyx_t_21)) {
33681  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
33682  __Pyx_INCREF(__pyx_t_21);
33683  __Pyx_INCREF(function);
33684  __Pyx_DECREF_SET(__pyx_t_8, function);
33685  }
33686  }
33687  __pyx_t_20 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_21, __pyx_t_19) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_19);
33688  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
33689  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33690  if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1751, __pyx_L1_error)
33691  __Pyx_GOTREF(__pyx_t_20);
33692  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
33693  if (likely(PyList_CheckExact(__pyx_t_20)) || PyTuple_CheckExact(__pyx_t_20)) {
33694  __pyx_t_8 = __pyx_t_20; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
33695  __pyx_t_15 = NULL;
33696  } else {
33697  __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1751, __pyx_L1_error)
33698  __Pyx_GOTREF(__pyx_t_8);
33699  __pyx_t_15 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1751, __pyx_L1_error)
33700  }
33701  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33702  for (;;) {
33703  if (likely(!__pyx_t_15)) {
33704  if (likely(PyList_CheckExact(__pyx_t_8))) {
33705  if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
33706  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33707  __pyx_t_20 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_20); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1751, __pyx_L1_error)
33708  #else
33709  __pyx_t_20 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1751, __pyx_L1_error)
33710  __Pyx_GOTREF(__pyx_t_20);
33711  #endif
33712  } else {
33713  if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
33714  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33715  __pyx_t_20 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_20); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1751, __pyx_L1_error)
33716  #else
33717  __pyx_t_20 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1751, __pyx_L1_error)
33718  __Pyx_GOTREF(__pyx_t_20);
33719  #endif
33720  }
33721  } else {
33722  __pyx_t_20 = __pyx_t_15(__pyx_t_8);
33723  if (unlikely(!__pyx_t_20)) {
33724  PyObject* exc_type = PyErr_Occurred();
33725  if (exc_type) {
33726  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
33727  else __PYX_ERR(0, 1751, __pyx_L1_error)
33728  }
33729  break;
33730  }
33731  __Pyx_GOTREF(__pyx_t_20);
33732  }
33733  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_20);
33734  __pyx_t_20 = 0;
33735 
33736  /* "WaveTools.py":1752
33737  *
33738  * for ij in range(self.Nall):
33739  * for kk in range(3): # <<<<<<<<<<<<<<
33740  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk]
33741  * self.waveDir_cM[3*ij+kk] = old_div(self.kDirM[ij,kk], self.kiM[ij])
33742  */
33743  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_range); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1752, __pyx_L1_error)
33744  __Pyx_GOTREF(__pyx_t_19);
33745  __pyx_t_21 = NULL;
33746  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_19))) {
33747  __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_19);
33748  if (likely(__pyx_t_21)) {
33749  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_19);
33750  __Pyx_INCREF(__pyx_t_21);
33751  __Pyx_INCREF(function);
33752  __Pyx_DECREF_SET(__pyx_t_19, function);
33753  }
33754  }
33755  __pyx_t_20 = (__pyx_t_21) ? __Pyx_PyObject_Call2Args(__pyx_t_19, __pyx_t_21, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_19, __pyx_int_3);
33756  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
33757  if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1752, __pyx_L1_error)
33758  __Pyx_GOTREF(__pyx_t_20);
33759  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33760  if (likely(PyList_CheckExact(__pyx_t_20)) || PyTuple_CheckExact(__pyx_t_20)) {
33761  __pyx_t_19 = __pyx_t_20; __Pyx_INCREF(__pyx_t_19); __pyx_t_22 = 0;
33762  __pyx_t_24 = NULL;
33763  } else {
33764  __pyx_t_22 = -1; __pyx_t_19 = PyObject_GetIter(__pyx_t_20); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1752, __pyx_L1_error)
33765  __Pyx_GOTREF(__pyx_t_19);
33766  __pyx_t_24 = Py_TYPE(__pyx_t_19)->tp_iternext; if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1752, __pyx_L1_error)
33767  }
33768  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33769  for (;;) {
33770  if (likely(!__pyx_t_24)) {
33771  if (likely(PyList_CheckExact(__pyx_t_19))) {
33772  if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_19)) break;
33773  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33774  __pyx_t_20 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_22); __Pyx_INCREF(__pyx_t_20); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 1752, __pyx_L1_error)
33775  #else
33776  __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1752, __pyx_L1_error)
33777  __Pyx_GOTREF(__pyx_t_20);
33778  #endif
33779  } else {
33780  if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_19)) break;
33781  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33782  __pyx_t_20 = PyTuple_GET_ITEM(__pyx_t_19, __pyx_t_22); __Pyx_INCREF(__pyx_t_20); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 1752, __pyx_L1_error)
33783  #else
33784  __pyx_t_20 = PySequence_ITEM(__pyx_t_19, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1752, __pyx_L1_error)
33785  __Pyx_GOTREF(__pyx_t_20);
33786  #endif
33787  }
33788  } else {
33789  __pyx_t_20 = __pyx_t_24(__pyx_t_19);
33790  if (unlikely(!__pyx_t_20)) {
33791  PyObject* exc_type = PyErr_Occurred();
33792  if (exc_type) {
33793  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
33794  else __PYX_ERR(0, 1752, __pyx_L1_error)
33795  }
33796  break;
33797  }
33798  __Pyx_GOTREF(__pyx_t_20);
33799  }
33800  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_20);
33801  __pyx_t_20 = 0;
33802 
33803  /* "WaveTools.py":1753
33804  * for ij in range(self.Nall):
33805  * for kk in range(3):
33806  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk] # <<<<<<<<<<<<<<
33807  * self.waveDir_cM[3*ij+kk] = old_div(self.kDirM[ij,kk], self.kiM[ij])
33808  * self.omega_cM[ij] = self.omegaM[ij]
33809  */
33810  __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1753, __pyx_L1_error)
33811  __Pyx_GOTREF(__pyx_t_20);
33812  __Pyx_INCREF(__pyx_v_ij);
33813  __Pyx_GIVEREF(__pyx_v_ij);
33814  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_ij);
33815  __Pyx_INCREF(__pyx_v_kk);
33816  __Pyx_GIVEREF(__pyx_v_kk);
33817  PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_v_kk);
33818  __pyx_t_21 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDirM), __pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1753, __pyx_L1_error)
33819  __Pyx_GOTREF(__pyx_t_21);
33820  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33821  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_21); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L1_error)
33822  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33823  __pyx_t_21 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1753, __pyx_L1_error)
33824  __Pyx_GOTREF(__pyx_t_21);
33825  __pyx_t_20 = PyNumber_Add(__pyx_t_21, __pyx_v_kk); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1753, __pyx_L1_error)
33826  __Pyx_GOTREF(__pyx_t_20);
33827  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33828  __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_t_20); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1753, __pyx_L1_error)
33829  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33830  (__pyx_v_self->kDir_cM[__pyx_t_25]) = __pyx_t_14;
33831 
33832  /* "WaveTools.py":1754
33833  * for kk in range(3):
33834  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk]
33835  * self.waveDir_cM[3*ij+kk] = old_div(self.kDirM[ij,kk], self.kiM[ij]) # <<<<<<<<<<<<<<
33836  * self.omega_cM[ij] = self.omegaM[ij]
33837  * self.ki_cM[ij] =self.kiM[ij]
33838  */
33839  __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_n_s_old_div); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1754, __pyx_L1_error)
33840  __Pyx_GOTREF(__pyx_t_21);
33841  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1754, __pyx_L1_error)
33842  __Pyx_GOTREF(__pyx_t_18);
33843  __Pyx_INCREF(__pyx_v_ij);
33844  __Pyx_GIVEREF(__pyx_v_ij);
33845  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_v_ij);
33846  __Pyx_INCREF(__pyx_v_kk);
33847  __Pyx_GIVEREF(__pyx_v_kk);
33848  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_v_kk);
33849  __pyx_t_17 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDirM), __pyx_t_18); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1754, __pyx_L1_error)
33850  __Pyx_GOTREF(__pyx_t_17);
33851  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
33852  __pyx_t_18 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kiM), __pyx_v_ij); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1754, __pyx_L1_error)
33853  __Pyx_GOTREF(__pyx_t_18);
33854  __pyx_t_12 = NULL;
33855  __pyx_t_16 = 0;
33856  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_21))) {
33857  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_21);
33858  if (likely(__pyx_t_12)) {
33859  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
33860  __Pyx_INCREF(__pyx_t_12);
33861  __Pyx_INCREF(function);
33862  __Pyx_DECREF_SET(__pyx_t_21, function);
33863  __pyx_t_16 = 1;
33864  }
33865  }
33866  #if CYTHON_FAST_PYCALL
33867  if (PyFunction_Check(__pyx_t_21)) {
33868  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_17, __pyx_t_18};
33869  __pyx_t_20 = __Pyx_PyFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1754, __pyx_L1_error)
33870  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
33871  __Pyx_GOTREF(__pyx_t_20);
33872  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
33873  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
33874  } else
33875  #endif
33876  #if CYTHON_FAST_PYCCALL
33877  if (__Pyx_PyFastCFunction_Check(__pyx_t_21)) {
33878  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_17, __pyx_t_18};
33879  __pyx_t_20 = __Pyx_PyCFunction_FastCall(__pyx_t_21, __pyx_temp+1-__pyx_t_16, 2+__pyx_t_16); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1754, __pyx_L1_error)
33880  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
33881  __Pyx_GOTREF(__pyx_t_20);
33882  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
33883  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
33884  } else
33885  #endif
33886  {
33887  __pyx_t_13 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1754, __pyx_L1_error)
33888  __Pyx_GOTREF(__pyx_t_13);
33889  if (__pyx_t_12) {
33890  __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
33891  }
33892  __Pyx_GIVEREF(__pyx_t_17);
33893  PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_16, __pyx_t_17);
33894  __Pyx_GIVEREF(__pyx_t_18);
33895  PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_16, __pyx_t_18);
33896  __pyx_t_17 = 0;
33897  __pyx_t_18 = 0;
33898  __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_13, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1754, __pyx_L1_error)
33899  __Pyx_GOTREF(__pyx_t_20);
33900  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
33901  }
33902  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33903  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_20); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1754, __pyx_L1_error)
33904  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33905  __pyx_t_20 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1754, __pyx_L1_error)
33906  __Pyx_GOTREF(__pyx_t_20);
33907  __pyx_t_21 = PyNumber_Add(__pyx_t_20, __pyx_v_kk); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1754, __pyx_L1_error)
33908  __Pyx_GOTREF(__pyx_t_21);
33909  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
33910  __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_t_21); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1754, __pyx_L1_error)
33911  __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
33912  (__pyx_v_self->waveDir_cM[__pyx_t_25]) = __pyx_t_14;
33913 
33914  /* "WaveTools.py":1752
33915  *
33916  * for ij in range(self.Nall):
33917  * for kk in range(3): # <<<<<<<<<<<<<<
33918  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk]
33919  * self.waveDir_cM[3*ij+kk] = old_div(self.kDirM[ij,kk], self.kiM[ij])
33920  */
33921  }
33922  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33923 
33924  /* "WaveTools.py":1755
33925  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk]
33926  * self.waveDir_cM[3*ij+kk] = old_div(self.kDirM[ij,kk], self.kiM[ij])
33927  * self.omega_cM[ij] = self.omegaM[ij] # <<<<<<<<<<<<<<
33928  * self.ki_cM[ij] =self.kiM[ij]
33929  * self.tanh_cM[ij] = self.tanhFM[ij]
33930  */
33931  __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omegaM), __pyx_v_ij); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1755, __pyx_L1_error)
33932  __Pyx_GOTREF(__pyx_t_19);
33933  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L1_error)
33934  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33935  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L1_error)
33936  (__pyx_v_self->omega_cM[__pyx_t_22]) = __pyx_t_14;
33937 
33938  /* "WaveTools.py":1756
33939  * self.waveDir_cM[3*ij+kk] = old_div(self.kDirM[ij,kk], self.kiM[ij])
33940  * self.omega_cM[ij] = self.omegaM[ij]
33941  * self.ki_cM[ij] =self.kiM[ij] # <<<<<<<<<<<<<<
33942  * self.tanh_cM[ij] = self.tanhFM[ij]
33943  * self.ai_cM[ij] = self.aiM[ij]
33944  */
33945  __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kiM), __pyx_v_ij); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1756, __pyx_L1_error)
33946  __Pyx_GOTREF(__pyx_t_19);
33947  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1756, __pyx_L1_error)
33948  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33949  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1756, __pyx_L1_error)
33950  (__pyx_v_self->ki_cM[__pyx_t_22]) = __pyx_t_14;
33951 
33952  /* "WaveTools.py":1757
33953  * self.omega_cM[ij] = self.omegaM[ij]
33954  * self.ki_cM[ij] =self.kiM[ij]
33955  * self.tanh_cM[ij] = self.tanhFM[ij] # <<<<<<<<<<<<<<
33956  * self.ai_cM[ij] = self.aiM[ij]
33957  * self.phi_cM[ij] = self.phiM[ij]
33958  */
33959  __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->tanhFM), __pyx_v_ij); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1757, __pyx_L1_error)
33960  __Pyx_GOTREF(__pyx_t_19);
33961  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1757, __pyx_L1_error)
33962  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33963  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1757, __pyx_L1_error)
33964  (__pyx_v_self->tanh_cM[__pyx_t_22]) = __pyx_t_14;
33965 
33966  /* "WaveTools.py":1758
33967  * self.ki_cM[ij] =self.kiM[ij]
33968  * self.tanh_cM[ij] = self.tanhFM[ij]
33969  * self.ai_cM[ij] = self.aiM[ij] # <<<<<<<<<<<<<<
33970  * self.phi_cM[ij] = self.phiM[ij]
33971  *
33972  */
33973  __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->aiM), __pyx_v_ij); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1758, __pyx_L1_error)
33974  __Pyx_GOTREF(__pyx_t_19);
33975  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L1_error)
33976  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33977  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L1_error)
33978  (__pyx_v_self->ai_cM[__pyx_t_22]) = __pyx_t_14;
33979 
33980  /* "WaveTools.py":1759
33981  * self.tanh_cM[ij] = self.tanhFM[ij]
33982  * self.ai_cM[ij] = self.aiM[ij]
33983  * self.phi_cM[ij] = self.phiM[ij] # <<<<<<<<<<<<<<
33984  *
33985  * self.kDirM_ = self.kDir_cM
33986  */
33987  __pyx_t_19 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->phiM), __pyx_v_ij); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1759, __pyx_L1_error)
33988  __Pyx_GOTREF(__pyx_t_19);
33989  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_19); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1759, __pyx_L1_error)
33990  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
33991  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1759, __pyx_L1_error)
33992  (__pyx_v_self->phi_cM[__pyx_t_22]) = __pyx_t_14;
33993 
33994  /* "WaveTools.py":1751
33995  *
33996  *
33997  * for ij in range(self.Nall): # <<<<<<<<<<<<<<
33998  * for kk in range(3):
33999  * self.kDir_cM[3*ij+kk] = self.kDirM[ij,kk]
34000  */
34001  }
34002  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
34003 
34004  /* "WaveTools.py":1761
34005  * self.phi_cM[ij] = self.phiM[ij]
34006  *
34007  * self.kDirM_ = self.kDir_cM # <<<<<<<<<<<<<<
34008  * self.omegaM_ = self.omega_cM
34009  * self.kiM_ =self.ki_cM
34010  */
34011  __pyx_t_23 = __pyx_v_self->kDir_cM;
34012  __pyx_v_self->kDirM_ = __pyx_t_23;
34013 
34014  /* "WaveTools.py":1762
34015  *
34016  * self.kDirM_ = self.kDir_cM
34017  * self.omegaM_ = self.omega_cM # <<<<<<<<<<<<<<
34018  * self.kiM_ =self.ki_cM
34019  * self.aiM_ = self.ai_cM
34020  */
34021  __pyx_t_23 = __pyx_v_self->omega_cM;
34022  __pyx_v_self->omegaM_ = __pyx_t_23;
34023 
34024  /* "WaveTools.py":1763
34025  * self.kDirM_ = self.kDir_cM
34026  * self.omegaM_ = self.omega_cM
34027  * self.kiM_ =self.ki_cM # <<<<<<<<<<<<<<
34028  * self.aiM_ = self.ai_cM
34029  * self.tanhM_ = self.tanh_cM
34030  */
34031  __pyx_t_23 = __pyx_v_self->ki_cM;
34032  __pyx_v_self->kiM_ = __pyx_t_23;
34033 
34034  /* "WaveTools.py":1764
34035  * self.omegaM_ = self.omega_cM
34036  * self.kiM_ =self.ki_cM
34037  * self.aiM_ = self.ai_cM # <<<<<<<<<<<<<<
34038  * self.tanhM_ = self.tanh_cM
34039  * self.phiM_ = self.phi_cM
34040  */
34041  __pyx_t_23 = __pyx_v_self->ai_cM;
34042  __pyx_v_self->aiM_ = __pyx_t_23;
34043 
34044  /* "WaveTools.py":1765
34045  * self.kiM_ =self.ki_cM
34046  * self.aiM_ = self.ai_cM
34047  * self.tanhM_ = self.tanh_cM # <<<<<<<<<<<<<<
34048  * self.phiM_ = self.phi_cM
34049  * self.waveDirM_ = self.waveDir_cM
34050  */
34051  __pyx_t_23 = __pyx_v_self->tanh_cM;
34052  __pyx_v_self->tanhM_ = __pyx_t_23;
34053 
34054  /* "WaveTools.py":1766
34055  * self.aiM_ = self.ai_cM
34056  * self.tanhM_ = self.tanh_cM
34057  * self.phiM_ = self.phi_cM # <<<<<<<<<<<<<<
34058  * self.waveDirM_ = self.waveDir_cM
34059  *
34060  */
34061  __pyx_t_23 = __pyx_v_self->phi_cM;
34062  __pyx_v_self->phiM_ = __pyx_t_23;
34063 
34064  /* "WaveTools.py":1767
34065  * self.tanhM_ = self.tanh_cM
34066  * self.phiM_ = self.phi_cM
34067  * self.waveDirM_ = self.waveDir_cM # <<<<<<<<<<<<<<
34068  *
34069  *
34070  */
34071  __pyx_t_23 = __pyx_v_self->waveDir_cM;
34072  __pyx_v_self->waveDirM_ = __pyx_t_23;
34073 
34074  /* "WaveTools.py":1670
34075  * Switch for optimised functions
34076  * """
34077  * def __cinit__(self, # <<<<<<<<<<<<<<
34078  * Nspectra,
34079  * Tp, # np array with
34080  */
34081 
34082  /* function exit code */
34083  __pyx_r = 0;
34084  goto __pyx_L0;
34085  __pyx_L1_error:;
34086  __Pyx_XDECREF(__pyx_t_7);
34087  __Pyx_XDECREF(__pyx_t_8);
34088  __Pyx_XDECREF(__pyx_t_10);
34089  __Pyx_XDECREF(__pyx_t_11);
34090  __Pyx_XDECREF(__pyx_t_12);
34091  __Pyx_XDECREF(__pyx_t_13);
34092  __Pyx_XDECREF(__pyx_t_17);
34093  __Pyx_XDECREF(__pyx_t_18);
34094  __Pyx_XDECREF(__pyx_t_19);
34095  __Pyx_XDECREF(__pyx_t_20);
34096  __Pyx_XDECREF(__pyx_t_21);
34097  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34098  __pyx_r = -1;
34099  __pyx_L0:;
34100  __Pyx_XDECREF(__pyx_v_nn);
34101  __Pyx_XDECREF(__pyx_v_NN);
34102  __Pyx_XDECREF(__pyx_v_kk);
34103  __Pyx_XDECREF(__pyx_v_NN1);
34104  __Pyx_XDECREF((PyObject *)__pyx_v_RW);
34105  __Pyx_XDECREF(__pyx_v_ij);
34106  __Pyx_RefNannyFinishContext();
34107  return __pyx_r;
34108 }
34109 
34110 /* "WaveTools.py":1770
34111  *
34112  *
34113  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
34114  *
34115  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast)
34116  */
34117 
34118 static double __pyx_f_9WaveTools_23MultiSpectraRandomWaves__cpp_eta(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
34119  double __pyx_r;
34120  __Pyx_RefNannyDeclarations
34121  __Pyx_RefNannySetupContext("_cpp_eta", 0);
34122 
34123  /* "WaveTools.py":1772
34124  * def _cpp_eta(self, x, t):
34125  *
34126  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast) # <<<<<<<<<<<<<<
34127  *
34128  * def eta(self, x, t):
34129  */
34130  __pyx_r = proteus::__cpp_etaRandom(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDirM_, __pyx_v_self->omegaM_, __pyx_v_self->phiM_, __pyx_v_self->aiM_, __pyx_v_self->Nall, __pyx_v_self->fast);
34131  goto __pyx_L0;
34132 
34133  /* "WaveTools.py":1770
34134  *
34135  *
34136  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
34137  *
34138  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast)
34139  */
34140 
34141  /* function exit code */
34142  __pyx_L0:;
34143  __Pyx_RefNannyFinishContext();
34144  return __pyx_r;
34145 }
34146 
34147 /* "WaveTools.py":1774
34148  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast)
34149  *
34150  * def eta(self, x, t): # <<<<<<<<<<<<<<
34151  * """Calculates free surface elevation (RandomWaves class)
34152  * Parameters
34153  */
34154 
34155 /* Python wrapper */
34156 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
34157 static char __pyx_doc_9WaveTools_23MultiSpectraRandomWaves_2eta[] = "Calculates free surface elevation (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
34158 static PyMethodDef __pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_23MultiSpectraRandomWaves_2eta};
34159 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
34160  PyObject *__pyx_v_x = 0;
34161  PyObject *__pyx_v_t = 0;
34162  PyObject *__pyx_r = 0;
34163  __Pyx_RefNannyDeclarations
34164  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
34165  {
34166  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
34167  PyObject* values[2] = {0,0};
34168  if (unlikely(__pyx_kwds)) {
34169  Py_ssize_t kw_args;
34170  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
34171  switch (pos_args) {
34172  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
34173  CYTHON_FALLTHROUGH;
34174  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
34175  CYTHON_FALLTHROUGH;
34176  case 0: break;
34177  default: goto __pyx_L5_argtuple_error;
34178  }
34179  kw_args = PyDict_Size(__pyx_kwds);
34180  switch (pos_args) {
34181  case 0:
34182  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
34183  else goto __pyx_L5_argtuple_error;
34184  CYTHON_FALLTHROUGH;
34185  case 1:
34186  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
34187  else {
34188  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 1774, __pyx_L3_error)
34189  }
34190  }
34191  if (unlikely(kw_args > 0)) {
34192  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 1774, __pyx_L3_error)
34193  }
34194  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
34195  goto __pyx_L5_argtuple_error;
34196  } else {
34197  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
34198  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
34199  }
34200  __pyx_v_x = values[0];
34201  __pyx_v_t = values[1];
34202  }
34203  goto __pyx_L4_argument_unpacking_done;
34204  __pyx_L5_argtuple_error:;
34205  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1774, __pyx_L3_error)
34206  __pyx_L3_error:;
34207  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
34208  __Pyx_RefNannyFinishContext();
34209  return NULL;
34210  __pyx_L4_argument_unpacking_done:;
34211  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_2eta(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
34212 
34213  /* function exit code */
34214  __Pyx_RefNannyFinishContext();
34215  return __pyx_r;
34216 }
34217 
34218 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_2eta(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
34219  double __pyx_v_xx[3];
34220  PyObject *__pyx_r = NULL;
34221  __Pyx_RefNannyDeclarations
34222  PyObject *__pyx_t_1 = NULL;
34223  double __pyx_t_2;
34224  __Pyx_RefNannySetupContext("eta", 0);
34225 
34226  /* "WaveTools.py":1790
34227  * """
34228  * cython.declare(xx=cython.double[3])
34229  * xx[0] = x[0] # <<<<<<<<<<<<<<
34230  * xx[1] = x[1]
34231  * xx[2] = x[2]
34232  */
34233  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1790, __pyx_L1_error)
34234  __Pyx_GOTREF(__pyx_t_1);
34235  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1790, __pyx_L1_error)
34236  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34237  (__pyx_v_xx[0]) = __pyx_t_2;
34238 
34239  /* "WaveTools.py":1791
34240  * cython.declare(xx=cython.double[3])
34241  * xx[0] = x[0]
34242  * xx[1] = x[1] # <<<<<<<<<<<<<<
34243  * xx[2] = x[2]
34244  * return self._cpp_eta(xx,t)
34245  */
34246  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error)
34247  __Pyx_GOTREF(__pyx_t_1);
34248  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1791, __pyx_L1_error)
34249  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34250  (__pyx_v_xx[1]) = __pyx_t_2;
34251 
34252  /* "WaveTools.py":1792
34253  * xx[0] = x[0]
34254  * xx[1] = x[1]
34255  * xx[2] = x[2] # <<<<<<<<<<<<<<
34256  * return self._cpp_eta(xx,t)
34257  *
34258  */
34259  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __pyx_L1_error)
34260  __Pyx_GOTREF(__pyx_t_1);
34261  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1792, __pyx_L1_error)
34262  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34263  (__pyx_v_xx[2]) = __pyx_t_2;
34264 
34265  /* "WaveTools.py":1793
34266  * xx[1] = x[1]
34267  * xx[2] = x[2]
34268  * return self._cpp_eta(xx,t) # <<<<<<<<<<<<<<
34269  *
34270  * def _cpp_u(self, U, x, t):
34271  */
34272  __Pyx_XDECREF(__pyx_r);
34273  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1793, __pyx_L1_error)
34274  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1793, __pyx_L1_error)
34275  __Pyx_GOTREF(__pyx_t_1);
34276  __pyx_r = __pyx_t_1;
34277  __pyx_t_1 = 0;
34278  goto __pyx_L0;
34279 
34280  /* "WaveTools.py":1774
34281  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast)
34282  *
34283  * def eta(self, x, t): # <<<<<<<<<<<<<<
34284  * """Calculates free surface elevation (RandomWaves class)
34285  * Parameters
34286  */
34287 
34288  /* function exit code */
34289  __pyx_L1_error:;
34290  __Pyx_XDECREF(__pyx_t_1);
34291  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
34292  __pyx_r = NULL;
34293  __pyx_L0:;
34294  __Pyx_XGIVEREF(__pyx_r);
34295  __Pyx_RefNannyFinishContext();
34296  return __pyx_r;
34297 }
34298 
34299 /* "WaveTools.py":1795
34300  * return self._cpp_eta(xx,t)
34301  *
34302  * def _cpp_u(self, U, x, t): # <<<<<<<<<<<<<<
34303  *
34304  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast)
34305  */
34306 
34307 static void __pyx_f_9WaveTools_23MultiSpectraRandomWaves__cpp_u(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
34308  __Pyx_RefNannyDeclarations
34309  __Pyx_RefNannySetupContext("_cpp_u", 0);
34310 
34311  /* "WaveTools.py":1797
34312  * def _cpp_u(self, U, x, t):
34313  *
34314  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast) # <<<<<<<<<<<<<<
34315  *
34316  * def u(self, x, t):
34317  */
34318  proteus::__cpp_uDir(__pyx_v_U, __pyx_v_x, __pyx_v_t, __pyx_v_self->kDirM_, __pyx_v_self->kiM_, __pyx_v_self->omegaM_, __pyx_v_self->phiM_, __pyx_v_self->aiM_, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->Nall, __pyx_v_self->waveDirM_, __pyx_v_self->vDir_, __pyx_v_self->tanhM_, __pyx_v_self->gAbs, __pyx_v_self->fast);
34319 
34320  /* "WaveTools.py":1795
34321  * return self._cpp_eta(xx,t)
34322  *
34323  * def _cpp_u(self, U, x, t): # <<<<<<<<<<<<<<
34324  *
34325  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast)
34326  */
34327 
34328  /* function exit code */
34329  __Pyx_RefNannyFinishContext();
34330 }
34331 
34332 /* "WaveTools.py":1799
34333  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast)
34334  *
34335  * def u(self, x, t): # <<<<<<<<<<<<<<
34336  * """Calculates wave velocity vector (RandomWaves class)
34337  * Parameters
34338  */
34339 
34340 /* Python wrapper */
34341 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
34342 static char __pyx_doc_9WaveTools_23MultiSpectraRandomWaves_4u[] = "Calculates wave velocity vector (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
34343 static PyMethodDef __pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_23MultiSpectraRandomWaves_4u};
34344 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
34345  PyObject *__pyx_v_x = 0;
34346  PyObject *__pyx_v_t = 0;
34347  PyObject *__pyx_r = 0;
34348  __Pyx_RefNannyDeclarations
34349  __Pyx_RefNannySetupContext("u (wrapper)", 0);
34350  {
34351  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
34352  PyObject* values[2] = {0,0};
34353  if (unlikely(__pyx_kwds)) {
34354  Py_ssize_t kw_args;
34355  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
34356  switch (pos_args) {
34357  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
34358  CYTHON_FALLTHROUGH;
34359  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
34360  CYTHON_FALLTHROUGH;
34361  case 0: break;
34362  default: goto __pyx_L5_argtuple_error;
34363  }
34364  kw_args = PyDict_Size(__pyx_kwds);
34365  switch (pos_args) {
34366  case 0:
34367  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
34368  else goto __pyx_L5_argtuple_error;
34369  CYTHON_FALLTHROUGH;
34370  case 1:
34371  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
34372  else {
34373  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 1799, __pyx_L3_error)
34374  }
34375  }
34376  if (unlikely(kw_args > 0)) {
34377  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 1799, __pyx_L3_error)
34378  }
34379  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
34380  goto __pyx_L5_argtuple_error;
34381  } else {
34382  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
34383  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
34384  }
34385  __pyx_v_x = values[0];
34386  __pyx_v_t = values[1];
34387  }
34388  goto __pyx_L4_argument_unpacking_done;
34389  __pyx_L5_argtuple_error:;
34390  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1799, __pyx_L3_error)
34391  __pyx_L3_error:;
34392  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
34393  __Pyx_RefNannyFinishContext();
34394  return NULL;
34395  __pyx_L4_argument_unpacking_done:;
34396  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_4u(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
34397 
34398  /* function exit code */
34399  __Pyx_RefNannyFinishContext();
34400  return __pyx_r;
34401 }
34402 
34403 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_4u(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
34404  double __pyx_v_xx[3];
34405  double __pyx_v_cppU[3];
34406  PyObject *__pyx_v_ii = NULL;
34407  PyObject *__pyx_v_U = NULL;
34408  PyObject *__pyx_r = NULL;
34409  __Pyx_RefNannyDeclarations
34410  PyObject *__pyx_t_1 = NULL;
34411  PyObject *__pyx_t_2 = NULL;
34412  PyObject *__pyx_t_3 = NULL;
34413  Py_ssize_t __pyx_t_4;
34414  PyObject *(*__pyx_t_5)(PyObject *);
34415  double __pyx_t_6;
34416  Py_ssize_t __pyx_t_7;
34417  __Pyx_RefNannySetupContext("u", 0);
34418 
34419  /* "WaveTools.py":1817
34420  * cython.declare(xx=cython.double[3])
34421  * cython.declare(cppU=cython.double[3])
34422  * for ii in range(3): # <<<<<<<<<<<<<<
34423  * xx[ii] = x[ii]
34424  * cppU[ii] = 0.
34425  */
34426  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __pyx_L1_error)
34427  __Pyx_GOTREF(__pyx_t_2);
34428  __pyx_t_3 = NULL;
34429  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
34430  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
34431  if (likely(__pyx_t_3)) {
34432  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
34433  __Pyx_INCREF(__pyx_t_3);
34434  __Pyx_INCREF(function);
34435  __Pyx_DECREF_SET(__pyx_t_2, function);
34436  }
34437  }
34438  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
34439  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
34440  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
34441  __Pyx_GOTREF(__pyx_t_1);
34442  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34443  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
34444  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
34445  __pyx_t_5 = NULL;
34446  } else {
34447  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1817, __pyx_L1_error)
34448  __Pyx_GOTREF(__pyx_t_2);
34449  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1817, __pyx_L1_error)
34450  }
34451  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34452  for (;;) {
34453  if (likely(!__pyx_t_5)) {
34454  if (likely(PyList_CheckExact(__pyx_t_2))) {
34455  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
34456  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34457  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1817, __pyx_L1_error)
34458  #else
34459  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
34460  __Pyx_GOTREF(__pyx_t_1);
34461  #endif
34462  } else {
34463  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
34464  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
34465  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1817, __pyx_L1_error)
34466  #else
34467  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error)
34468  __Pyx_GOTREF(__pyx_t_1);
34469  #endif
34470  }
34471  } else {
34472  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
34473  if (unlikely(!__pyx_t_1)) {
34474  PyObject* exc_type = PyErr_Occurred();
34475  if (exc_type) {
34476  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
34477  else __PYX_ERR(0, 1817, __pyx_L1_error)
34478  }
34479  break;
34480  }
34481  __Pyx_GOTREF(__pyx_t_1);
34482  }
34483  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
34484  __pyx_t_1 = 0;
34485 
34486  /* "WaveTools.py":1818
34487  * cython.declare(cppU=cython.double[3])
34488  * for ii in range(3):
34489  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
34490  * cppU[ii] = 0.
34491  * U = np.zeros(3,)
34492  */
34493  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error)
34494  __Pyx_GOTREF(__pyx_t_1);
34495  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L1_error)
34496  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34497  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L1_error)
34498  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
34499 
34500  /* "WaveTools.py":1819
34501  * for ii in range(3):
34502  * xx[ii] = x[ii]
34503  * cppU[ii] = 0. # <<<<<<<<<<<<<<
34504  * U = np.zeros(3,)
34505  * self._cpp_u(cppU,xx,t)
34506  */
34507  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1819, __pyx_L1_error)
34508  (__pyx_v_cppU[__pyx_t_7]) = 0.;
34509 
34510  /* "WaveTools.py":1817
34511  * cython.declare(xx=cython.double[3])
34512  * cython.declare(cppU=cython.double[3])
34513  * for ii in range(3): # <<<<<<<<<<<<<<
34514  * xx[ii] = x[ii]
34515  * cppU[ii] = 0.
34516  */
34517  }
34518  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34519 
34520  /* "WaveTools.py":1820
34521  * xx[ii] = x[ii]
34522  * cppU[ii] = 0.
34523  * U = np.zeros(3,) # <<<<<<<<<<<<<<
34524  * self._cpp_u(cppU,xx,t)
34525  * U[0] = cppU[0]
34526  */
34527  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
34528  __Pyx_GOTREF(__pyx_t_1);
34529  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1820, __pyx_L1_error)
34530  __Pyx_GOTREF(__pyx_t_3);
34531  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34532  __pyx_t_1 = NULL;
34533  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
34534  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
34535  if (likely(__pyx_t_1)) {
34536  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
34537  __Pyx_INCREF(__pyx_t_1);
34538  __Pyx_INCREF(function);
34539  __Pyx_DECREF_SET(__pyx_t_3, function);
34540  }
34541  }
34542  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
34543  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
34544  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
34545  __Pyx_GOTREF(__pyx_t_2);
34546  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34547  __pyx_v_U = __pyx_t_2;
34548  __pyx_t_2 = 0;
34549 
34550  /* "WaveTools.py":1821
34551  * cppU[ii] = 0.
34552  * U = np.zeros(3,)
34553  * self._cpp_u(cppU,xx,t) # <<<<<<<<<<<<<<
34554  * U[0] = cppU[0]
34555  * U[1] = cppU[1]
34556  */
34557  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1821, __pyx_L1_error)
34558  ((struct __pyx_vtabstruct_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self->__pyx_vtab)->_cpp_u(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
34559 
34560  /* "WaveTools.py":1822
34561  * U = np.zeros(3,)
34562  * self._cpp_u(cppU,xx,t)
34563  * U[0] = cppU[0] # <<<<<<<<<<<<<<
34564  * U[1] = cppU[1]
34565  * U[2] = cppU[2]
34566  */
34567  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error)
34568  __Pyx_GOTREF(__pyx_t_2);
34569  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1822, __pyx_L1_error)
34570  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34571 
34572  /* "WaveTools.py":1823
34573  * self._cpp_u(cppU,xx,t)
34574  * U[0] = cppU[0]
34575  * U[1] = cppU[1] # <<<<<<<<<<<<<<
34576  * U[2] = cppU[2]
34577  * return U
34578  */
34579  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1823, __pyx_L1_error)
34580  __Pyx_GOTREF(__pyx_t_2);
34581  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1823, __pyx_L1_error)
34582  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34583 
34584  /* "WaveTools.py":1824
34585  * U[0] = cppU[0]
34586  * U[1] = cppU[1]
34587  * U[2] = cppU[2] # <<<<<<<<<<<<<<
34588  * return U
34589  *
34590  */
34591  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
34592  __Pyx_GOTREF(__pyx_t_2);
34593  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 1824, __pyx_L1_error)
34594  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34595 
34596  /* "WaveTools.py":1825
34597  * U[1] = cppU[1]
34598  * U[2] = cppU[2]
34599  * return U # <<<<<<<<<<<<<<
34600  *
34601  *
34602  */
34603  __Pyx_XDECREF(__pyx_r);
34604  __Pyx_INCREF(__pyx_v_U);
34605  __pyx_r = __pyx_v_U;
34606  goto __pyx_L0;
34607 
34608  /* "WaveTools.py":1799
34609  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast)
34610  *
34611  * def u(self, x, t): # <<<<<<<<<<<<<<
34612  * """Calculates wave velocity vector (RandomWaves class)
34613  * Parameters
34614  */
34615 
34616  /* function exit code */
34617  __pyx_L1_error:;
34618  __Pyx_XDECREF(__pyx_t_1);
34619  __Pyx_XDECREF(__pyx_t_2);
34620  __Pyx_XDECREF(__pyx_t_3);
34621  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
34622  __pyx_r = NULL;
34623  __pyx_L0:;
34624  __Pyx_XDECREF(__pyx_v_ii);
34625  __Pyx_XDECREF(__pyx_v_U);
34626  __Pyx_XGIVEREF(__pyx_r);
34627  __Pyx_RefNannyFinishContext();
34628  return __pyx_r;
34629 }
34630 
34631 /* "WaveTools.pxd":154
34632  * cdef double[10000] phi_cM
34633  * cdef public:
34634  * double mwl,depth # <<<<<<<<<<<<<<
34635  * cdef double _cpp_eta(self, double* x, double t)
34636  * cdef void _cpp_u(self, double* U, double* x, double t)
34637  */
34638 
34639 /* Python wrapper */
34640 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
34641 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3mwl_1__get__(PyObject *__pyx_v_self) {
34642  PyObject *__pyx_r = 0;
34643  __Pyx_RefNannyDeclarations
34644  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
34645  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_3mwl___get__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self));
34646 
34647  /* function exit code */
34648  __Pyx_RefNannyFinishContext();
34649  return __pyx_r;
34650 }
34651 
34652 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_3mwl___get__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self) {
34653  PyObject *__pyx_r = NULL;
34654  __Pyx_RefNannyDeclarations
34655  PyObject *__pyx_t_1 = NULL;
34656  __Pyx_RefNannySetupContext("__get__", 0);
34657  __Pyx_XDECREF(__pyx_r);
34658  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 154, __pyx_L1_error)
34659  __Pyx_GOTREF(__pyx_t_1);
34660  __pyx_r = __pyx_t_1;
34661  __pyx_t_1 = 0;
34662  goto __pyx_L0;
34663 
34664  /* function exit code */
34665  __pyx_L1_error:;
34666  __Pyx_XDECREF(__pyx_t_1);
34667  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34668  __pyx_r = NULL;
34669  __pyx_L0:;
34670  __Pyx_XGIVEREF(__pyx_r);
34671  __Pyx_RefNannyFinishContext();
34672  return __pyx_r;
34673 }
34674 
34675 /* Python wrapper */
34676 static int __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
34677 static int __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
34678  int __pyx_r;
34679  __Pyx_RefNannyDeclarations
34680  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
34681  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_3mwl_2__set__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
34682 
34683  /* function exit code */
34684  __Pyx_RefNannyFinishContext();
34685  return __pyx_r;
34686 }
34687 
34688 static int __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
34689  int __pyx_r;
34690  __Pyx_RefNannyDeclarations
34691  double __pyx_t_1;
34692  __Pyx_RefNannySetupContext("__set__", 0);
34693  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 154, __pyx_L1_error)
34694  __pyx_v_self->mwl = __pyx_t_1;
34695 
34696  /* function exit code */
34697  __pyx_r = 0;
34698  goto __pyx_L0;
34699  __pyx_L1_error:;
34700  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34701  __pyx_r = -1;
34702  __pyx_L0:;
34703  __Pyx_RefNannyFinishContext();
34704  return __pyx_r;
34705 }
34706 
34707 /* Python wrapper */
34708 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
34709 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5depth_1__get__(PyObject *__pyx_v_self) {
34710  PyObject *__pyx_r = 0;
34711  __Pyx_RefNannyDeclarations
34712  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
34713  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_5depth___get__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self));
34714 
34715  /* function exit code */
34716  __Pyx_RefNannyFinishContext();
34717  return __pyx_r;
34718 }
34719 
34720 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_5depth___get__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self) {
34721  PyObject *__pyx_r = NULL;
34722  __Pyx_RefNannyDeclarations
34723  PyObject *__pyx_t_1 = NULL;
34724  __Pyx_RefNannySetupContext("__get__", 0);
34725  __Pyx_XDECREF(__pyx_r);
34726  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 154, __pyx_L1_error)
34727  __Pyx_GOTREF(__pyx_t_1);
34728  __pyx_r = __pyx_t_1;
34729  __pyx_t_1 = 0;
34730  goto __pyx_L0;
34731 
34732  /* function exit code */
34733  __pyx_L1_error:;
34734  __Pyx_XDECREF(__pyx_t_1);
34735  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34736  __pyx_r = NULL;
34737  __pyx_L0:;
34738  __Pyx_XGIVEREF(__pyx_r);
34739  __Pyx_RefNannyFinishContext();
34740  return __pyx_r;
34741 }
34742 
34743 /* Python wrapper */
34744 static int __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
34745 static int __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
34746  int __pyx_r;
34747  __Pyx_RefNannyDeclarations
34748  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
34749  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_5depth_2__set__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
34750 
34751  /* function exit code */
34752  __Pyx_RefNannyFinishContext();
34753  return __pyx_r;
34754 }
34755 
34756 static int __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_5depth_2__set__(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, PyObject *__pyx_v_value) {
34757  int __pyx_r;
34758  __Pyx_RefNannyDeclarations
34759  double __pyx_t_1;
34760  __Pyx_RefNannySetupContext("__set__", 0);
34761  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 154, __pyx_L1_error)
34762  __pyx_v_self->depth = __pyx_t_1;
34763 
34764  /* function exit code */
34765  __pyx_r = 0;
34766  goto __pyx_L0;
34767  __pyx_L1_error:;
34768  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.depth.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34769  __pyx_r = -1;
34770  __pyx_L0:;
34771  __Pyx_RefNannyFinishContext();
34772  return __pyx_r;
34773 }
34774 
34775 /* "(tree fragment)":1
34776  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
34777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34778  * def __setstate_cython__(self, __pyx_state):
34779  */
34780 
34781 /* Python wrapper */
34782 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
34783 static PyMethodDef __pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_7__reduce_cython__, METH_NOARGS, 0};
34784 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
34785  PyObject *__pyx_r = 0;
34786  __Pyx_RefNannyDeclarations
34787  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
34788  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_6__reduce_cython__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self));
34789 
34790  /* function exit code */
34791  __Pyx_RefNannyFinishContext();
34792  return __pyx_r;
34793 }
34794 
34795 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self) {
34796  PyObject *__pyx_r = NULL;
34797  __Pyx_RefNannyDeclarations
34798  PyObject *__pyx_t_1 = NULL;
34799  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
34800 
34801  /* "(tree fragment)":2
34802  * def __reduce_cython__(self):
34803  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
34804  * def __setstate_cython__(self, __pyx_state):
34805  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34806  */
34807  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
34808  __Pyx_GOTREF(__pyx_t_1);
34809  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
34810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34811  __PYX_ERR(1, 2, __pyx_L1_error)
34812 
34813  /* "(tree fragment)":1
34814  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
34815  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34816  * def __setstate_cython__(self, __pyx_state):
34817  */
34818 
34819  /* function exit code */
34820  __pyx_L1_error:;
34821  __Pyx_XDECREF(__pyx_t_1);
34822  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34823  __pyx_r = NULL;
34824  __Pyx_XGIVEREF(__pyx_r);
34825  __Pyx_RefNannyFinishContext();
34826  return __pyx_r;
34827 }
34828 
34829 /* "(tree fragment)":3
34830  * def __reduce_cython__(self):
34831  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34832  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
34833  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34834  */
34835 
34836 /* Python wrapper */
34837 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
34838 static PyMethodDef __pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_9__setstate_cython__, METH_O, 0};
34839 static PyObject *__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
34840  PyObject *__pyx_r = 0;
34841  __Pyx_RefNannyDeclarations
34842  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
34843  __pyx_r = __pyx_pf_9WaveTools_23MultiSpectraRandomWaves_8__setstate_cython__(((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
34844 
34845  /* function exit code */
34846  __Pyx_RefNannyFinishContext();
34847  return __pyx_r;
34848 }
34849 
34850 static PyObject *__pyx_pf_9WaveTools_23MultiSpectraRandomWaves_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
34851  PyObject *__pyx_r = NULL;
34852  __Pyx_RefNannyDeclarations
34853  PyObject *__pyx_t_1 = NULL;
34854  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
34855 
34856  /* "(tree fragment)":4
34857  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34858  * def __setstate_cython__(self, __pyx_state):
34859  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
34860  */
34861  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
34862  __Pyx_GOTREF(__pyx_t_1);
34863  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
34864  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34865  __PYX_ERR(1, 4, __pyx_L1_error)
34866 
34867  /* "(tree fragment)":3
34868  * def __reduce_cython__(self):
34869  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34870  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
34871  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
34872  */
34873 
34874  /* function exit code */
34875  __pyx_L1_error:;
34876  __Pyx_XDECREF(__pyx_t_1);
34877  __Pyx_AddTraceback("WaveTools.MultiSpectraRandomWaves.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
34878  __pyx_r = NULL;
34879  __Pyx_XGIVEREF(__pyx_r);
34880  __Pyx_RefNannyFinishContext();
34881  return __pyx_r;
34882 }
34883 
34884 /* "WaveTools.py":1873
34885  *
34886  * """
34887  * def __cinit__(self, # <<<<<<<<<<<<<<
34888  * M, #half bin of frequencies
34889  * Tp, # np array with
34890  */
34891 
34892 /* Python wrapper */
34893 static int __pyx_pw_9WaveTools_16DirectionalWaves_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
34894 static int __pyx_pw_9WaveTools_16DirectionalWaves_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
34895  PyObject *__pyx_v_M = 0;
34896  PyObject *__pyx_v_Tp = 0;
34897  PyObject *__pyx_v_Hs = 0;
34898  PyObject *__pyx_v_mwl = 0;
34899  PyObject *__pyx_v_depth = 0;
34900  PyObject *__pyx_v_waveDir0 = 0;
34901  PyObject *__pyx_v_g = 0;
34902  PyObject *__pyx_v_N = 0;
34903  PyObject *__pyx_v_bandFactor = 0;
34904  PyObject *__pyx_v_spectName = 0;
34905  PyObject *__pyx_v_spreadName = 0;
34906  PyObject *__pyx_v_spectral_params = 0;
34907  PyObject *__pyx_v_spread_params = 0;
34908  PyObject *__pyx_v_phi = 0;
34909  PyObject *__pyx_v_phiSymm = 0;
34910  PyObject *__pyx_v_fast = 0;
34911  int __pyx_r;
34912  __Pyx_RefNannyDeclarations
34913  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
34914  {
34915  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_M,&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir0,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spreadName,&__pyx_n_s_spectral_params,&__pyx_n_s_spread_params,&__pyx_n_s_phi,&__pyx_n_s_phiSymm,&__pyx_n_s_fast,0};
34916  PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
34917 
34918  /* "WaveTools.py":1885
34919  * spectName ,# random words will result in error and return the available spectra
34920  * spreadName ,# random words will result in error and return the available spectra
34921  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth} # <<<<<<<<<<<<<<
34922  * spread_params = None,
34923  * phi=None, # phi must be an (2*M+1)*N numpy array
34924  */
34925  values[11] = ((PyObject *)Py_None);
34926 
34927  /* "WaveTools.py":1886
34928  * spreadName ,# random words will result in error and return the available spectra
34929  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
34930  * spread_params = None, # <<<<<<<<<<<<<<
34931  * phi=None, # phi must be an (2*M+1)*N numpy array
34932  * phiSymm = False, # When true, phi[-pi/2,0] is symmetric to phi[0,pi/2]
34933  */
34934  values[12] = ((PyObject *)Py_None);
34935 
34936  /* "WaveTools.py":1887
34937  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
34938  * spread_params = None,
34939  * phi=None, # phi must be an (2*M+1)*N numpy array # <<<<<<<<<<<<<<
34940  * phiSymm = False, # When true, phi[-pi/2,0] is symmetric to phi[0,pi/2]
34941  * fast = True ):
34942  */
34943  values[13] = ((PyObject *)Py_None);
34944 
34945  /* "WaveTools.py":1888
34946  * spread_params = None,
34947  * phi=None, # phi must be an (2*M+1)*N numpy array
34948  * phiSymm = False, # When true, phi[-pi/2,0] is symmetric to phi[0,pi/2] # <<<<<<<<<<<<<<
34949  * fast = True ):
34950  * self.fast = fast
34951  */
34952  values[14] = ((PyObject *)Py_False);
34953 
34954  /* "WaveTools.py":1889
34955  * phi=None, # phi must be an (2*M+1)*N numpy array
34956  * phiSymm = False, # When true, phi[-pi/2,0] is symmetric to phi[0,pi/2]
34957  * fast = True ): # <<<<<<<<<<<<<<
34958  * self.fast = fast
34959  * validSpread = [cos2s,mitsuyasu]
34960  */
34961  values[15] = ((PyObject *)Py_True);
34962  if (unlikely(__pyx_kwds)) {
34963  Py_ssize_t kw_args;
34964  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
34965  switch (pos_args) {
34966  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
34967  CYTHON_FALLTHROUGH;
34968  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
34969  CYTHON_FALLTHROUGH;
34970  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
34971  CYTHON_FALLTHROUGH;
34972  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
34973  CYTHON_FALLTHROUGH;
34974  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
34975  CYTHON_FALLTHROUGH;
34976  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
34977  CYTHON_FALLTHROUGH;
34978  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
34979  CYTHON_FALLTHROUGH;
34980  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
34981  CYTHON_FALLTHROUGH;
34982  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
34983  CYTHON_FALLTHROUGH;
34984  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
34985  CYTHON_FALLTHROUGH;
34986  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
34987  CYTHON_FALLTHROUGH;
34988  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
34989  CYTHON_FALLTHROUGH;
34990  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
34991  CYTHON_FALLTHROUGH;
34992  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
34993  CYTHON_FALLTHROUGH;
34994  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
34995  CYTHON_FALLTHROUGH;
34996  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
34997  CYTHON_FALLTHROUGH;
34998  case 0: break;
34999  default: goto __pyx_L5_argtuple_error;
35000  }
35001  kw_args = PyDict_Size(__pyx_kwds);
35002  switch (pos_args) {
35003  case 0:
35004  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_M)) != 0)) kw_args--;
35005  else goto __pyx_L5_argtuple_error;
35006  CYTHON_FALLTHROUGH;
35007  case 1:
35008  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
35009  else {
35010  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 1); __PYX_ERR(0, 1873, __pyx_L3_error)
35011  }
35012  CYTHON_FALLTHROUGH;
35013  case 2:
35014  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
35015  else {
35016  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 2); __PYX_ERR(0, 1873, __pyx_L3_error)
35017  }
35018  CYTHON_FALLTHROUGH;
35019  case 3:
35020  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
35021  else {
35022  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 3); __PYX_ERR(0, 1873, __pyx_L3_error)
35023  }
35024  CYTHON_FALLTHROUGH;
35025  case 4:
35026  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
35027  else {
35028  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 4); __PYX_ERR(0, 1873, __pyx_L3_error)
35029  }
35030  CYTHON_FALLTHROUGH;
35031  case 5:
35032  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir0)) != 0)) kw_args--;
35033  else {
35034  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 5); __PYX_ERR(0, 1873, __pyx_L3_error)
35035  }
35036  CYTHON_FALLTHROUGH;
35037  case 6:
35038  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
35039  else {
35040  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 6); __PYX_ERR(0, 1873, __pyx_L3_error)
35041  }
35042  CYTHON_FALLTHROUGH;
35043  case 7:
35044  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
35045  else {
35046  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 7); __PYX_ERR(0, 1873, __pyx_L3_error)
35047  }
35048  CYTHON_FALLTHROUGH;
35049  case 8:
35050  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
35051  else {
35052  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 8); __PYX_ERR(0, 1873, __pyx_L3_error)
35053  }
35054  CYTHON_FALLTHROUGH;
35055  case 9:
35056  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
35057  else {
35058  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 9); __PYX_ERR(0, 1873, __pyx_L3_error)
35059  }
35060  CYTHON_FALLTHROUGH;
35061  case 10:
35062  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spreadName)) != 0)) kw_args--;
35063  else {
35064  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, 10); __PYX_ERR(0, 1873, __pyx_L3_error)
35065  }
35066  CYTHON_FALLTHROUGH;
35067  case 11:
35068  if (kw_args > 0) {
35069  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params);
35070  if (value) { values[11] = value; kw_args--; }
35071  }
35072  CYTHON_FALLTHROUGH;
35073  case 12:
35074  if (kw_args > 0) {
35075  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spread_params);
35076  if (value) { values[12] = value; kw_args--; }
35077  }
35078  CYTHON_FALLTHROUGH;
35079  case 13:
35080  if (kw_args > 0) {
35081  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi);
35082  if (value) { values[13] = value; kw_args--; }
35083  }
35084  CYTHON_FALLTHROUGH;
35085  case 14:
35086  if (kw_args > 0) {
35087  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phiSymm);
35088  if (value) { values[14] = value; kw_args--; }
35089  }
35090  CYTHON_FALLTHROUGH;
35091  case 15:
35092  if (kw_args > 0) {
35093  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
35094  if (value) { values[15] = value; kw_args--; }
35095  }
35096  }
35097  if (unlikely(kw_args > 0)) {
35098  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1873, __pyx_L3_error)
35099  }
35100  } else {
35101  switch (PyTuple_GET_SIZE(__pyx_args)) {
35102  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
35103  CYTHON_FALLTHROUGH;
35104  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
35105  CYTHON_FALLTHROUGH;
35106  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
35107  CYTHON_FALLTHROUGH;
35108  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
35109  CYTHON_FALLTHROUGH;
35110  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
35111  CYTHON_FALLTHROUGH;
35112  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
35113  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
35114  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
35115  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
35116  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
35117  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
35118  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
35119  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
35120  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
35121  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
35122  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
35123  break;
35124  default: goto __pyx_L5_argtuple_error;
35125  }
35126  }
35127  __pyx_v_M = values[0];
35128  __pyx_v_Tp = values[1];
35129  __pyx_v_Hs = values[2];
35130  __pyx_v_mwl = values[3];
35131  __pyx_v_depth = values[4];
35132  __pyx_v_waveDir0 = values[5];
35133  __pyx_v_g = values[6];
35134  __pyx_v_N = values[7];
35135  __pyx_v_bandFactor = values[8];
35136  __pyx_v_spectName = values[9];
35137  __pyx_v_spreadName = values[10];
35138  __pyx_v_spectral_params = values[11];
35139  __pyx_v_spread_params = values[12];
35140  __pyx_v_phi = values[13];
35141  __pyx_v_phiSymm = values[14];
35142  __pyx_v_fast = values[15];
35143  }
35144  goto __pyx_L4_argument_unpacking_done;
35145  __pyx_L5_argtuple_error:;
35146  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 11, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1873, __pyx_L3_error)
35147  __pyx_L3_error:;
35148  __Pyx_AddTraceback("WaveTools.DirectionalWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
35149  __Pyx_RefNannyFinishContext();
35150  return -1;
35151  __pyx_L4_argument_unpacking_done:;
35152  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves___cinit__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self), __pyx_v_M, __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir0, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spreadName, __pyx_v_spectral_params, __pyx_v_spread_params, __pyx_v_phi, __pyx_v_phiSymm, __pyx_v_fast);
35153 
35154  /* "WaveTools.py":1873
35155  *
35156  * """
35157  * def __cinit__(self, # <<<<<<<<<<<<<<
35158  * M, #half bin of frequencies
35159  * Tp, # np array with
35160  */
35161 
35162  /* function exit code */
35163  __Pyx_RefNannyFinishContext();
35164  return __pyx_r;
35165 }
35166 
35167 static int __pyx_pf_9WaveTools_16DirectionalWaves___cinit__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_M, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir0, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spreadName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_spread_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_phiSymm, PyObject *__pyx_v_fast) {
35168  PyObject *__pyx_v_validSpread = NULL;
35169  PyObject *__pyx_v_spread_fun = NULL;
35170  struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_RW = NULL;
35171  PyObject *__pyx_v_rotation3D = NULL;
35172  PyObject *__pyx_v_thetas = NULL;
35173  PyObject *__pyx_v_dth = NULL;
35174  PyObject *__pyx_v_temp_array = NULL;
35175  PyObject *__pyx_v_directions = NULL;
35176  PyObject *__pyx_v_rr = NULL;
35177  PyObject *__pyx_v_theta = NULL;
35178  PyObject *__pyx_v_i = NULL;
35179  PyObject *__pyx_v_theta_m = NULL;
35180  PyObject *__pyx_v_Si_Sp = NULL;
35181  PyObject *__pyx_v_freq = NULL;
35182  PyObject *__pyx_v_ii = NULL;
35183  PyObject *__pyx_v_nn = NULL;
35184  PyObject *__pyx_v_mm = NULL;
35185  PyObject *__pyx_v_ij = NULL;
35186  PyObject *__pyx_v_kk = NULL;
35187  int __pyx_r;
35188  __Pyx_RefNannyDeclarations
35189  bool __pyx_t_1;
35190  PyObject *__pyx_t_2 = NULL;
35191  PyObject *__pyx_t_3 = NULL;
35192  PyObject *__pyx_t_4 = NULL;
35193  int __pyx_t_5;
35194  PyObject *__pyx_t_6 = NULL;
35195  int __pyx_t_7;
35196  PyObject *__pyx_t_8 = NULL;
35197  PyObject *__pyx_t_9 = NULL;
35198  PyObject *__pyx_t_10 = NULL;
35199  PyObject *__pyx_t_11 = NULL;
35200  double __pyx_t_12;
35201  Py_ssize_t __pyx_t_13;
35202  int __pyx_t_14;
35203  PyObject *(*__pyx_t_15)(PyObject *);
35204  PyObject *__pyx_t_16 = NULL;
35205  PyObject *__pyx_t_17 = NULL;
35206  PyObject *__pyx_t_18 = NULL;
35207  Py_ssize_t __pyx_t_19;
35208  PyObject *(*__pyx_t_20)(PyObject *);
35209  double *__pyx_t_21;
35210  Py_ssize_t __pyx_t_22;
35211  PyObject *(*__pyx_t_23)(PyObject *);
35212  Py_ssize_t __pyx_t_24;
35213  __Pyx_RefNannySetupContext("__cinit__", 0);
35214 
35215  /* "WaveTools.py":1890
35216  * phiSymm = False, # When true, phi[-pi/2,0] is symmetric to phi[0,pi/2]
35217  * fast = True ):
35218  * self.fast = fast # <<<<<<<<<<<<<<
35219  * validSpread = [cos2s,mitsuyasu]
35220  * spread_fun = loadExistingFunction(spreadName, validSpread)
35221  */
35222  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1890, __pyx_L1_error)
35223  __pyx_v_self->fast = __pyx_t_1;
35224 
35225  /* "WaveTools.py":1891
35226  * fast = True ):
35227  * self.fast = fast
35228  * validSpread = [cos2s,mitsuyasu] # <<<<<<<<<<<<<<
35229  * spread_fun = loadExistingFunction(spreadName, validSpread)
35230  * self.Mtot = 2*M+1
35231  */
35232  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cos2s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1891, __pyx_L1_error)
35233  __Pyx_GOTREF(__pyx_t_2);
35234  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_mitsuyasu); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1891, __pyx_L1_error)
35235  __Pyx_GOTREF(__pyx_t_3);
35236  __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1891, __pyx_L1_error)
35237  __Pyx_GOTREF(__pyx_t_4);
35238  __Pyx_GIVEREF(__pyx_t_2);
35239  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
35240  __Pyx_GIVEREF(__pyx_t_3);
35241  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
35242  __pyx_t_2 = 0;
35243  __pyx_t_3 = 0;
35244  __pyx_v_validSpread = ((PyObject*)__pyx_t_4);
35245  __pyx_t_4 = 0;
35246 
35247  /* "WaveTools.py":1892
35248  * self.fast = fast
35249  * validSpread = [cos2s,mitsuyasu]
35250  * spread_fun = loadExistingFunction(spreadName, validSpread) # <<<<<<<<<<<<<<
35251  * self.Mtot = 2*M+1
35252  * self.N = N
35253  */
35254  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_loadExistingFunction); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1892, __pyx_L1_error)
35255  __Pyx_GOTREF(__pyx_t_3);
35256  __pyx_t_2 = NULL;
35257  __pyx_t_5 = 0;
35258  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
35259  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
35260  if (likely(__pyx_t_2)) {
35261  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
35262  __Pyx_INCREF(__pyx_t_2);
35263  __Pyx_INCREF(function);
35264  __Pyx_DECREF_SET(__pyx_t_3, function);
35265  __pyx_t_5 = 1;
35266  }
35267  }
35268  #if CYTHON_FAST_PYCALL
35269  if (PyFunction_Check(__pyx_t_3)) {
35270  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_spreadName, __pyx_v_validSpread};
35271  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __pyx_L1_error)
35272  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
35273  __Pyx_GOTREF(__pyx_t_4);
35274  } else
35275  #endif
35276  #if CYTHON_FAST_PYCCALL
35277  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
35278  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_spreadName, __pyx_v_validSpread};
35279  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __pyx_L1_error)
35280  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
35281  __Pyx_GOTREF(__pyx_t_4);
35282  } else
35283  #endif
35284  {
35285  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1892, __pyx_L1_error)
35286  __Pyx_GOTREF(__pyx_t_6);
35287  if (__pyx_t_2) {
35288  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
35289  }
35290  __Pyx_INCREF(__pyx_v_spreadName);
35291  __Pyx_GIVEREF(__pyx_v_spreadName);
35292  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_spreadName);
35293  __Pyx_INCREF(__pyx_v_validSpread);
35294  __Pyx_GIVEREF(__pyx_v_validSpread);
35295  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_validSpread);
35296  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __pyx_L1_error)
35297  __Pyx_GOTREF(__pyx_t_4);
35298  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35299  }
35300  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35301  __pyx_v_spread_fun = __pyx_t_4;
35302  __pyx_t_4 = 0;
35303 
35304  /* "WaveTools.py":1893
35305  * validSpread = [cos2s,mitsuyasu]
35306  * spread_fun = loadExistingFunction(spreadName, validSpread)
35307  * self.Mtot = 2*M+1 # <<<<<<<<<<<<<<
35308  * self.N = N
35309  * self.Nall = self.Mtot*self.N
35310  */
35311  __pyx_t_4 = PyNumber_Multiply(__pyx_int_2, __pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1893, __pyx_L1_error)
35312  __Pyx_GOTREF(__pyx_t_4);
35313  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error)
35314  __Pyx_GOTREF(__pyx_t_3);
35315  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35316  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1893, __pyx_L1_error)
35317  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35318  __pyx_v_self->Mtot = __pyx_t_5;
35319 
35320  /* "WaveTools.py":1894
35321  * spread_fun = loadExistingFunction(spreadName, validSpread)
35322  * self.Mtot = 2*M+1
35323  * self.N = N # <<<<<<<<<<<<<<
35324  * self.Nall = self.Mtot*self.N
35325  * self.waveDir0 = setDirVector(waveDir0)
35326  */
35327  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1894, __pyx_L1_error)
35328  __pyx_v_self->N = __pyx_t_5;
35329 
35330  /* "WaveTools.py":1895
35331  * self.Mtot = 2*M+1
35332  * self.N = N
35333  * self.Nall = self.Mtot*self.N # <<<<<<<<<<<<<<
35334  * self.waveDir0 = setDirVector(waveDir0)
35335  * self.vDir = setVertDir(g)
35336  */
35337  __pyx_v_self->Nall = (__pyx_v_self->Mtot * __pyx_v_self->N);
35338 
35339  /* "WaveTools.py":1896
35340  * self.N = N
35341  * self.Nall = self.Mtot*self.N
35342  * self.waveDir0 = setDirVector(waveDir0) # <<<<<<<<<<<<<<
35343  * self.vDir = setVertDir(g)
35344  * if(self.Nall > 100000):
35345  */
35346  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L1_error)
35347  __Pyx_GOTREF(__pyx_t_4);
35348  __pyx_t_6 = NULL;
35349  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
35350  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
35351  if (likely(__pyx_t_6)) {
35352  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35353  __Pyx_INCREF(__pyx_t_6);
35354  __Pyx_INCREF(function);
35355  __Pyx_DECREF_SET(__pyx_t_4, function);
35356  }
35357  }
35358  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_waveDir0) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_waveDir0);
35359  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
35360  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1896, __pyx_L1_error)
35361  __Pyx_GOTREF(__pyx_t_3);
35362  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35363  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1896, __pyx_L1_error)
35364  __Pyx_GIVEREF(__pyx_t_3);
35365  __Pyx_GOTREF(__pyx_v_self->waveDir0);
35366  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir0));
35367  __pyx_v_self->waveDir0 = ((PyArrayObject *)__pyx_t_3);
35368  __pyx_t_3 = 0;
35369 
35370  /* "WaveTools.py":1897
35371  * self.Nall = self.Mtot*self.N
35372  * self.waveDir0 = setDirVector(waveDir0)
35373  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
35374  * if(self.Nall > 100000):
35375  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for DirectionalWaves is 100000 ",level=0)
35376  */
35377  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1897, __pyx_L1_error)
35378  __Pyx_GOTREF(__pyx_t_4);
35379  __pyx_t_6 = NULL;
35380  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
35381  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
35382  if (likely(__pyx_t_6)) {
35383  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35384  __Pyx_INCREF(__pyx_t_6);
35385  __Pyx_INCREF(function);
35386  __Pyx_DECREF_SET(__pyx_t_4, function);
35387  }
35388  }
35389  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_g);
35390  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
35391  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1897, __pyx_L1_error)
35392  __Pyx_GOTREF(__pyx_t_3);
35393  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35394  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1897, __pyx_L1_error)
35395  __Pyx_GIVEREF(__pyx_t_3);
35396  __Pyx_GOTREF(__pyx_v_self->vDir);
35397  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
35398  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_3);
35399  __pyx_t_3 = 0;
35400 
35401  /* "WaveTools.py":1898
35402  * self.waveDir0 = setDirVector(waveDir0)
35403  * self.vDir = setVertDir(g)
35404  * if(self.Nall > 100000): # <<<<<<<<<<<<<<
35405  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for DirectionalWaves is 100000 ",level=0)
35406  *
35407  */
35408  __pyx_t_7 = ((__pyx_v_self->Nall > 0x186A0) != 0);
35409  if (__pyx_t_7) {
35410 
35411  /* "WaveTools.py":1899
35412  * self.vDir = setVertDir(g)
35413  * if(self.Nall > 100000):
35414  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for DirectionalWaves is 100000 ",level=0) # <<<<<<<<<<<<<<
35415  *
35416  *
35417  */
35418  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __pyx_L1_error)
35419  __Pyx_GOTREF(__pyx_t_3);
35420  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1899, __pyx_L1_error)
35421  __Pyx_GOTREF(__pyx_t_4);
35422  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 1899, __pyx_L1_error)
35423  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__36, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1899, __pyx_L1_error)
35424  __Pyx_GOTREF(__pyx_t_6);
35425  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35426  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35427  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35428 
35429  /* "WaveTools.py":1898
35430  * self.waveDir0 = setDirVector(waveDir0)
35431  * self.vDir = setVertDir(g)
35432  * if(self.Nall > 100000): # <<<<<<<<<<<<<<
35433  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for DirectionalWaves is 100000 ",level=0)
35434  *
35435  */
35436  }
35437 
35438  /* "WaveTools.py":1904
35439  *
35440  * # Loading Random waves to get the frequency array the wavelegnths and the frequency spectrum
35441  * RW = RandomWaves( # <<<<<<<<<<<<<<
35442  * Tp, # np array with
35443  * Hs,
35444  */
35445  __pyx_t_6 = PyTuple_New(10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1904, __pyx_L1_error)
35446  __Pyx_GOTREF(__pyx_t_6);
35447  __Pyx_INCREF(__pyx_v_Tp);
35448  __Pyx_GIVEREF(__pyx_v_Tp);
35449  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_Tp);
35450  __Pyx_INCREF(__pyx_v_Hs);
35451  __Pyx_GIVEREF(__pyx_v_Hs);
35452  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_Hs);
35453  __Pyx_INCREF(__pyx_v_mwl);
35454  __Pyx_GIVEREF(__pyx_v_mwl);
35455  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_mwl);
35456  __Pyx_INCREF(__pyx_v_depth);
35457  __Pyx_GIVEREF(__pyx_v_depth);
35458  PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_depth);
35459  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir0));
35460  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->waveDir0));
35461  PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_self->waveDir0));
35462  __Pyx_INCREF(__pyx_v_g);
35463  __Pyx_GIVEREF(__pyx_v_g);
35464  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_g);
35465  __Pyx_INCREF(__pyx_v_N);
35466  __Pyx_GIVEREF(__pyx_v_N);
35467  PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_N);
35468  __Pyx_INCREF(__pyx_v_bandFactor);
35469  __Pyx_GIVEREF(__pyx_v_bandFactor);
35470  PyTuple_SET_ITEM(__pyx_t_6, 7, __pyx_v_bandFactor);
35471  __Pyx_INCREF(__pyx_v_spectName);
35472  __Pyx_GIVEREF(__pyx_v_spectName);
35473  PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_v_spectName);
35474  __Pyx_INCREF(__pyx_v_spectral_params);
35475  __Pyx_GIVEREF(__pyx_v_spectral_params);
35476  PyTuple_SET_ITEM(__pyx_t_6, 9, __pyx_v_spectral_params);
35477 
35478  /* "WaveTools.py":1915
35479  * spectName,# random words will result in error and return the available spectra
35480  * spectral_params, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
35481  * phi = None # <<<<<<<<<<<<<<
35482  * )
35483  *
35484  */
35485  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1915, __pyx_L1_error)
35486  __Pyx_GOTREF(__pyx_t_4);
35487  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_phi, Py_None) < 0) __PYX_ERR(0, 1915, __pyx_L1_error)
35488 
35489  /* "WaveTools.py":1904
35490  *
35491  * # Loading Random waves to get the frequency array the wavelegnths and the frequency spectrum
35492  * RW = RandomWaves( # <<<<<<<<<<<<<<
35493  * Tp, # np array with
35494  * Hs,
35495  */
35496  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_RandomWaves), __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1904, __pyx_L1_error)
35497  __Pyx_GOTREF(__pyx_t_3);
35498  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35499  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35500  __pyx_v_RW = ((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_t_3);
35501  __pyx_t_3 = 0;
35502 
35503  /* "WaveTools.py":1921
35504  *
35505  * # Directional waves propagate usually in a plane -90 to 90 deg with respect to the direction vector, normal to the gavity direction. Rotating the waveDir0 vector around the g vector to produce the directional space
35506  * from .SpatialTools import rotation3D # <<<<<<<<<<<<<<
35507  * thetas = np.linspace(old_div(-M_PI,2),old_div(M_PI,2),2*M+1)
35508  * dth = (thetas[1] - thetas[0])
35509  */
35510  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1921, __pyx_L1_error)
35511  __Pyx_GOTREF(__pyx_t_3);
35512  __Pyx_INCREF(__pyx_n_s_rotation3D);
35513  __Pyx_GIVEREF(__pyx_n_s_rotation3D);
35514  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_rotation3D);
35515  __pyx_t_4 = __Pyx_Import(__pyx_n_s_SpatialTools, __pyx_t_3, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1921, __pyx_L1_error)
35516  __Pyx_GOTREF(__pyx_t_4);
35517  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35518  __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_rotation3D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1921, __pyx_L1_error)
35519  __Pyx_GOTREF(__pyx_t_3);
35520  __Pyx_INCREF(__pyx_t_3);
35521  __pyx_v_rotation3D = __pyx_t_3;
35522  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35523  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35524 
35525  /* "WaveTools.py":1922
35526  * # Directional waves propagate usually in a plane -90 to 90 deg with respect to the direction vector, normal to the gavity direction. Rotating the waveDir0 vector around the g vector to produce the directional space
35527  * from .SpatialTools import rotation3D
35528  * thetas = np.linspace(old_div(-M_PI,2),old_div(M_PI,2),2*M+1) # <<<<<<<<<<<<<<
35529  * dth = (thetas[1] - thetas[0])
35530  * self.waveDirs = np.zeros((2*M+1,3),)
35531  */
35532  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
35533  __Pyx_GOTREF(__pyx_t_3);
35534  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_linspace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1922, __pyx_L1_error)
35535  __Pyx_GOTREF(__pyx_t_6);
35536  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35537  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1922, __pyx_L1_error)
35538  __Pyx_GOTREF(__pyx_t_2);
35539  __pyx_t_8 = PyFloat_FromDouble((-M_PI)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1922, __pyx_L1_error)
35540  __Pyx_GOTREF(__pyx_t_8);
35541  __pyx_t_9 = NULL;
35542  __pyx_t_5 = 0;
35543  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
35544  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
35545  if (likely(__pyx_t_9)) {
35546  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
35547  __Pyx_INCREF(__pyx_t_9);
35548  __Pyx_INCREF(function);
35549  __Pyx_DECREF_SET(__pyx_t_2, function);
35550  __pyx_t_5 = 1;
35551  }
35552  }
35553  #if CYTHON_FAST_PYCALL
35554  if (PyFunction_Check(__pyx_t_2)) {
35555  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_int_2};
35556  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
35557  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
35558  __Pyx_GOTREF(__pyx_t_3);
35559  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35560  } else
35561  #endif
35562  #if CYTHON_FAST_PYCCALL
35563  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
35564  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_int_2};
35565  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
35566  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
35567  __Pyx_GOTREF(__pyx_t_3);
35568  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35569  } else
35570  #endif
35571  {
35572  __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1922, __pyx_L1_error)
35573  __Pyx_GOTREF(__pyx_t_10);
35574  if (__pyx_t_9) {
35575  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
35576  }
35577  __Pyx_GIVEREF(__pyx_t_8);
35578  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_8);
35579  __Pyx_INCREF(__pyx_int_2);
35580  __Pyx_GIVEREF(__pyx_int_2);
35581  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_int_2);
35582  __pyx_t_8 = 0;
35583  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error)
35584  __Pyx_GOTREF(__pyx_t_3);
35585  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
35586  }
35587  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35588  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_old_div); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1922, __pyx_L1_error)
35589  __Pyx_GOTREF(__pyx_t_10);
35590  __pyx_t_8 = PyFloat_FromDouble(M_PI); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1922, __pyx_L1_error)
35591  __Pyx_GOTREF(__pyx_t_8);
35592  __pyx_t_9 = NULL;
35593  __pyx_t_5 = 0;
35594  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
35595  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
35596  if (likely(__pyx_t_9)) {
35597  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
35598  __Pyx_INCREF(__pyx_t_9);
35599  __Pyx_INCREF(function);
35600  __Pyx_DECREF_SET(__pyx_t_10, function);
35601  __pyx_t_5 = 1;
35602  }
35603  }
35604  #if CYTHON_FAST_PYCALL
35605  if (PyFunction_Check(__pyx_t_10)) {
35606  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_int_2};
35607  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1922, __pyx_L1_error)
35608  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
35609  __Pyx_GOTREF(__pyx_t_2);
35610  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35611  } else
35612  #endif
35613  #if CYTHON_FAST_PYCCALL
35614  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
35615  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_int_2};
35616  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1922, __pyx_L1_error)
35617  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
35618  __Pyx_GOTREF(__pyx_t_2);
35619  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35620  } else
35621  #endif
35622  {
35623  __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1922, __pyx_L1_error)
35624  __Pyx_GOTREF(__pyx_t_11);
35625  if (__pyx_t_9) {
35626  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
35627  }
35628  __Pyx_GIVEREF(__pyx_t_8);
35629  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_8);
35630  __Pyx_INCREF(__pyx_int_2);
35631  __Pyx_GIVEREF(__pyx_int_2);
35632  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_int_2);
35633  __pyx_t_8 = 0;
35634  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1922, __pyx_L1_error)
35635  __Pyx_GOTREF(__pyx_t_2);
35636  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
35637  }
35638  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
35639  __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_v_M); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1922, __pyx_L1_error)
35640  __Pyx_GOTREF(__pyx_t_10);
35641  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1922, __pyx_L1_error)
35642  __Pyx_GOTREF(__pyx_t_11);
35643  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
35644  __pyx_t_10 = NULL;
35645  __pyx_t_5 = 0;
35646  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
35647  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
35648  if (likely(__pyx_t_10)) {
35649  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
35650  __Pyx_INCREF(__pyx_t_10);
35651  __Pyx_INCREF(function);
35652  __Pyx_DECREF_SET(__pyx_t_6, function);
35653  __pyx_t_5 = 1;
35654  }
35655  }
35656  #if CYTHON_FAST_PYCALL
35657  if (PyFunction_Check(__pyx_t_6)) {
35658  PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_t_3, __pyx_t_2, __pyx_t_11};
35659  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1922, __pyx_L1_error)
35660  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
35661  __Pyx_GOTREF(__pyx_t_4);
35662  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35663  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35664  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
35665  } else
35666  #endif
35667  #if CYTHON_FAST_PYCCALL
35668  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
35669  PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_t_3, __pyx_t_2, __pyx_t_11};
35670  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1922, __pyx_L1_error)
35671  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
35672  __Pyx_GOTREF(__pyx_t_4);
35673  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
35674  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35675  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
35676  } else
35677  #endif
35678  {
35679  __pyx_t_8 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1922, __pyx_L1_error)
35680  __Pyx_GOTREF(__pyx_t_8);
35681  if (__pyx_t_10) {
35682  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
35683  }
35684  __Pyx_GIVEREF(__pyx_t_3);
35685  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_3);
35686  __Pyx_GIVEREF(__pyx_t_2);
35687  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_t_2);
35688  __Pyx_GIVEREF(__pyx_t_11);
35689  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_5, __pyx_t_11);
35690  __pyx_t_3 = 0;
35691  __pyx_t_2 = 0;
35692  __pyx_t_11 = 0;
35693  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1922, __pyx_L1_error)
35694  __Pyx_GOTREF(__pyx_t_4);
35695  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35696  }
35697  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35698  __pyx_v_thetas = __pyx_t_4;
35699  __pyx_t_4 = 0;
35700 
35701  /* "WaveTools.py":1923
35702  * from .SpatialTools import rotation3D
35703  * thetas = np.linspace(old_div(-M_PI,2),old_div(M_PI,2),2*M+1)
35704  * dth = (thetas[1] - thetas[0]) # <<<<<<<<<<<<<<
35705  * self.waveDirs = np.zeros((2*M+1,3),)
35706  * self.phiDirs = np.zeros((2*M+1,N),)
35707  */
35708  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_thetas, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L1_error)
35709  __Pyx_GOTREF(__pyx_t_4);
35710  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_thetas, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1923, __pyx_L1_error)
35711  __Pyx_GOTREF(__pyx_t_6);
35712  __pyx_t_8 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1923, __pyx_L1_error)
35713  __Pyx_GOTREF(__pyx_t_8);
35714  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35715  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35716  __pyx_v_dth = __pyx_t_8;
35717  __pyx_t_8 = 0;
35718 
35719  /* "WaveTools.py":1924
35720  * thetas = np.linspace(old_div(-M_PI,2),old_div(M_PI,2),2*M+1)
35721  * dth = (thetas[1] - thetas[0])
35722  * self.waveDirs = np.zeros((2*M+1,3),) # <<<<<<<<<<<<<<
35723  * self.phiDirs = np.zeros((2*M+1,N),)
35724  * self.aiDirs = np.zeros((2*M+1,N),)
35725  */
35726  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1924, __pyx_L1_error)
35727  __Pyx_GOTREF(__pyx_t_6);
35728  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1924, __pyx_L1_error)
35729  __Pyx_GOTREF(__pyx_t_4);
35730  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35731  __pyx_t_6 = PyNumber_Multiply(__pyx_int_2, __pyx_v_M); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1924, __pyx_L1_error)
35732  __Pyx_GOTREF(__pyx_t_6);
35733  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1924, __pyx_L1_error)
35734  __Pyx_GOTREF(__pyx_t_11);
35735  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35736  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1924, __pyx_L1_error)
35737  __Pyx_GOTREF(__pyx_t_6);
35738  __Pyx_GIVEREF(__pyx_t_11);
35739  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11);
35740  __Pyx_INCREF(__pyx_int_3);
35741  __Pyx_GIVEREF(__pyx_int_3);
35742  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3);
35743  __pyx_t_11 = 0;
35744  __pyx_t_11 = NULL;
35745  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
35746  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
35747  if (likely(__pyx_t_11)) {
35748  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35749  __Pyx_INCREF(__pyx_t_11);
35750  __Pyx_INCREF(function);
35751  __Pyx_DECREF_SET(__pyx_t_4, function);
35752  }
35753  }
35754  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
35755  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
35756  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35757  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1924, __pyx_L1_error)
35758  __Pyx_GOTREF(__pyx_t_8);
35759  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35760  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1924, __pyx_L1_error)
35761  __Pyx_GIVEREF(__pyx_t_8);
35762  __Pyx_GOTREF(__pyx_v_self->waveDirs);
35763  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDirs));
35764  __pyx_v_self->waveDirs = ((PyArrayObject *)__pyx_t_8);
35765  __pyx_t_8 = 0;
35766 
35767  /* "WaveTools.py":1925
35768  * dth = (thetas[1] - thetas[0])
35769  * self.waveDirs = np.zeros((2*M+1,3),)
35770  * self.phiDirs = np.zeros((2*M+1,N),) # <<<<<<<<<<<<<<
35771  * self.aiDirs = np.zeros((2*M+1,N),)
35772  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
35773  */
35774  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error)
35775  __Pyx_GOTREF(__pyx_t_4);
35776  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1925, __pyx_L1_error)
35777  __Pyx_GOTREF(__pyx_t_6);
35778  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35779  __pyx_t_4 = PyNumber_Multiply(__pyx_int_2, __pyx_v_M); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error)
35780  __Pyx_GOTREF(__pyx_t_4);
35781  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1925, __pyx_L1_error)
35782  __Pyx_GOTREF(__pyx_t_11);
35783  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35784  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1925, __pyx_L1_error)
35785  __Pyx_GOTREF(__pyx_t_4);
35786  __Pyx_GIVEREF(__pyx_t_11);
35787  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11);
35788  __Pyx_INCREF(__pyx_v_N);
35789  __Pyx_GIVEREF(__pyx_v_N);
35790  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_N);
35791  __pyx_t_11 = 0;
35792  __pyx_t_11 = NULL;
35793  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
35794  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
35795  if (likely(__pyx_t_11)) {
35796  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
35797  __Pyx_INCREF(__pyx_t_11);
35798  __Pyx_INCREF(function);
35799  __Pyx_DECREF_SET(__pyx_t_6, function);
35800  }
35801  }
35802  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
35803  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
35804  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35805  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1925, __pyx_L1_error)
35806  __Pyx_GOTREF(__pyx_t_8);
35807  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35808  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1925, __pyx_L1_error)
35809  __Pyx_GIVEREF(__pyx_t_8);
35810  __Pyx_GOTREF(__pyx_v_self->phiDirs);
35811  __Pyx_DECREF(((PyObject *)__pyx_v_self->phiDirs));
35812  __pyx_v_self->phiDirs = ((PyArrayObject *)__pyx_t_8);
35813  __pyx_t_8 = 0;
35814 
35815  /* "WaveTools.py":1926
35816  * self.waveDirs = np.zeros((2*M+1,3),)
35817  * self.phiDirs = np.zeros((2*M+1,N),)
35818  * self.aiDirs = np.zeros((2*M+1,N),) # <<<<<<<<<<<<<<
35819  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
35820  *
35821  */
35822  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1926, __pyx_L1_error)
35823  __Pyx_GOTREF(__pyx_t_6);
35824  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1926, __pyx_L1_error)
35825  __Pyx_GOTREF(__pyx_t_4);
35826  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35827  __pyx_t_6 = PyNumber_Multiply(__pyx_int_2, __pyx_v_M); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1926, __pyx_L1_error)
35828  __Pyx_GOTREF(__pyx_t_6);
35829  __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1926, __pyx_L1_error)
35830  __Pyx_GOTREF(__pyx_t_11);
35831  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35832  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1926, __pyx_L1_error)
35833  __Pyx_GOTREF(__pyx_t_6);
35834  __Pyx_GIVEREF(__pyx_t_11);
35835  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11);
35836  __Pyx_INCREF(__pyx_v_N);
35837  __Pyx_GIVEREF(__pyx_v_N);
35838  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_N);
35839  __pyx_t_11 = 0;
35840  __pyx_t_11 = NULL;
35841  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
35842  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
35843  if (likely(__pyx_t_11)) {
35844  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
35845  __Pyx_INCREF(__pyx_t_11);
35846  __Pyx_INCREF(function);
35847  __Pyx_DECREF_SET(__pyx_t_4, function);
35848  }
35849  }
35850  __pyx_t_8 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
35851  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
35852  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35853  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1926, __pyx_L1_error)
35854  __Pyx_GOTREF(__pyx_t_8);
35855  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35856  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1926, __pyx_L1_error)
35857  __Pyx_GIVEREF(__pyx_t_8);
35858  __Pyx_GOTREF(__pyx_v_self->aiDirs);
35859  __Pyx_DECREF(((PyObject *)__pyx_v_self->aiDirs));
35860  __pyx_v_self->aiDirs = ((PyArrayObject *)__pyx_t_8);
35861  __pyx_t_8 = 0;
35862 
35863  /* "WaveTools.py":1927
35864  * self.phiDirs = np.zeros((2*M+1,N),)
35865  * self.aiDirs = np.zeros((2*M+1,N),)
35866  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2]) # <<<<<<<<<<<<<<
35867  *
35868  * temp_array = np.zeros((1,3),)
35869  */
35870  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_g, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1927, __pyx_L1_error)
35871  __Pyx_GOTREF(__pyx_t_8);
35872  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_g, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L1_error)
35873  __Pyx_GOTREF(__pyx_t_4);
35874  __pyx_t_6 = PyNumber_Multiply(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1927, __pyx_L1_error)
35875  __Pyx_GOTREF(__pyx_t_6);
35876  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35877  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35878  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_g, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L1_error)
35879  __Pyx_GOTREF(__pyx_t_4);
35880  __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_g, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1927, __pyx_L1_error)
35881  __Pyx_GOTREF(__pyx_t_8);
35882  __pyx_t_11 = PyNumber_Multiply(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1927, __pyx_L1_error)
35883  __Pyx_GOTREF(__pyx_t_11);
35884  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35885  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35886  __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1927, __pyx_L1_error)
35887  __Pyx_GOTREF(__pyx_t_8);
35888  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35889  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
35890  __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_g, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1927, __pyx_L1_error)
35891  __Pyx_GOTREF(__pyx_t_11);
35892  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_g, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1927, __pyx_L1_error)
35893  __Pyx_GOTREF(__pyx_t_6);
35894  __pyx_t_4 = PyNumber_Multiply(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1927, __pyx_L1_error)
35895  __Pyx_GOTREF(__pyx_t_4);
35896  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
35897  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35898  __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1927, __pyx_L1_error)
35899  __Pyx_GOTREF(__pyx_t_6);
35900  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35901  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35902  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L1_error)
35903  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
35904  __pyx_v_self->gAbs = sqrt(__pyx_t_12);
35905 
35906  /* "WaveTools.py":1929
35907  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
35908  *
35909  * temp_array = np.zeros((1,3),) # <<<<<<<<<<<<<<
35910  * temp_array[0,:] = waveDir0
35911  * directions = list(range(0,self.Mtot))
35912  */
35913  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1929, __pyx_L1_error)
35914  __Pyx_GOTREF(__pyx_t_4);
35915  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1929, __pyx_L1_error)
35916  __Pyx_GOTREF(__pyx_t_8);
35917  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35918  __pyx_t_4 = NULL;
35919  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
35920  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
35921  if (likely(__pyx_t_4)) {
35922  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
35923  __Pyx_INCREF(__pyx_t_4);
35924  __Pyx_INCREF(function);
35925  __Pyx_DECREF_SET(__pyx_t_8, function);
35926  }
35927  }
35928  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_4, __pyx_tuple__37) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_tuple__37);
35929  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
35930  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1929, __pyx_L1_error)
35931  __Pyx_GOTREF(__pyx_t_6);
35932  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
35933  __pyx_v_temp_array = __pyx_t_6;
35934  __pyx_t_6 = 0;
35935 
35936  /* "WaveTools.py":1930
35937  *
35938  * temp_array = np.zeros((1,3),)
35939  * temp_array[0,:] = waveDir0 # <<<<<<<<<<<<<<
35940  * directions = list(range(0,self.Mtot))
35941  *
35942  */
35943  if (unlikely(PyObject_SetItem(__pyx_v_temp_array, __pyx_tuple__11, __pyx_v_waveDir0) < 0)) __PYX_ERR(0, 1930, __pyx_L1_error)
35944 
35945  /* "WaveTools.py":1931
35946  * temp_array = np.zeros((1,3),)
35947  * temp_array[0,:] = waveDir0
35948  * directions = list(range(0,self.Mtot)) # <<<<<<<<<<<<<<
35949  *
35950  * # initialising wave directions
35951  */
35952  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1931, __pyx_L1_error)
35953  __Pyx_GOTREF(__pyx_t_8);
35954  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->Mtot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1931, __pyx_L1_error)
35955  __Pyx_GOTREF(__pyx_t_4);
35956  __pyx_t_11 = NULL;
35957  __pyx_t_5 = 0;
35958  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
35959  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
35960  if (likely(__pyx_t_11)) {
35961  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
35962  __Pyx_INCREF(__pyx_t_11);
35963  __Pyx_INCREF(function);
35964  __Pyx_DECREF_SET(__pyx_t_8, function);
35965  __pyx_t_5 = 1;
35966  }
35967  }
35968  #if CYTHON_FAST_PYCALL
35969  if (PyFunction_Check(__pyx_t_8)) {
35970  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_int_0, __pyx_t_4};
35971  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error)
35972  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
35973  __Pyx_GOTREF(__pyx_t_6);
35974  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35975  } else
35976  #endif
35977  #if CYTHON_FAST_PYCCALL
35978  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
35979  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_int_0, __pyx_t_4};
35980  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error)
35981  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
35982  __Pyx_GOTREF(__pyx_t_6);
35983  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
35984  } else
35985  #endif
35986  {
35987  __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1931, __pyx_L1_error)
35988  __Pyx_GOTREF(__pyx_t_2);
35989  if (__pyx_t_11) {
35990  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); __pyx_t_11 = NULL;
35991  }
35992  __Pyx_INCREF(__pyx_int_0);
35993  __Pyx_GIVEREF(__pyx_int_0);
35994  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_int_0);
35995  __Pyx_GIVEREF(__pyx_t_4);
35996  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_t_4);
35997  __pyx_t_4 = 0;
35998  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1931, __pyx_L1_error)
35999  __Pyx_GOTREF(__pyx_t_6);
36000  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36001  }
36002  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36003  __pyx_t_8 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1931, __pyx_L1_error)
36004  __Pyx_GOTREF(__pyx_t_8);
36005  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36006  __pyx_v_directions = ((PyObject*)__pyx_t_8);
36007  __pyx_t_8 = 0;
36008 
36009  /* "WaveTools.py":1934
36010  *
36011  * # initialising wave directions
36012  * for rr in directions: # <<<<<<<<<<<<<<
36013  * theta = thetas[rr]
36014  * self.waveDirs[rr,:] = rotation3D(temp_array,theta,self.vDir)[0,:]
36015  */
36016  __pyx_t_8 = __pyx_v_directions; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0;
36017  for (;;) {
36018  if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_8)) break;
36019  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36020  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1934, __pyx_L1_error)
36021  #else
36022  __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1934, __pyx_L1_error)
36023  __Pyx_GOTREF(__pyx_t_6);
36024  #endif
36025  __Pyx_XDECREF_SET(__pyx_v_rr, __pyx_t_6);
36026  __pyx_t_6 = 0;
36027 
36028  /* "WaveTools.py":1935
36029  * # initialising wave directions
36030  * for rr in directions:
36031  * theta = thetas[rr] # <<<<<<<<<<<<<<
36032  * self.waveDirs[rr,:] = rotation3D(temp_array,theta,self.vDir)[0,:]
36033  * self.waveDirs[rr,:]=setDirVector( self.waveDirs[rr,:])
36034  */
36035  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_thetas, __pyx_v_rr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1935, __pyx_L1_error)
36036  __Pyx_GOTREF(__pyx_t_6);
36037  __Pyx_XDECREF_SET(__pyx_v_theta, __pyx_t_6);
36038  __pyx_t_6 = 0;
36039 
36040  /* "WaveTools.py":1936
36041  * for rr in directions:
36042  * theta = thetas[rr]
36043  * self.waveDirs[rr,:] = rotation3D(temp_array,theta,self.vDir)[0,:] # <<<<<<<<<<<<<<
36044  * self.waveDirs[rr,:]=setDirVector( self.waveDirs[rr,:])
36045  *
36046  */
36047  __Pyx_INCREF(__pyx_v_rotation3D);
36048  __pyx_t_2 = __pyx_v_rotation3D; __pyx_t_4 = NULL;
36049  __pyx_t_5 = 0;
36050  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
36051  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
36052  if (likely(__pyx_t_4)) {
36053  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
36054  __Pyx_INCREF(__pyx_t_4);
36055  __Pyx_INCREF(function);
36056  __Pyx_DECREF_SET(__pyx_t_2, function);
36057  __pyx_t_5 = 1;
36058  }
36059  }
36060  #if CYTHON_FAST_PYCALL
36061  if (PyFunction_Check(__pyx_t_2)) {
36062  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_temp_array, __pyx_v_theta, ((PyObject *)__pyx_v_self->vDir)};
36063  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1936, __pyx_L1_error)
36064  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
36065  __Pyx_GOTREF(__pyx_t_6);
36066  } else
36067  #endif
36068  #if CYTHON_FAST_PYCCALL
36069  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
36070  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_temp_array, __pyx_v_theta, ((PyObject *)__pyx_v_self->vDir)};
36071  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1936, __pyx_L1_error)
36072  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
36073  __Pyx_GOTREF(__pyx_t_6);
36074  } else
36075  #endif
36076  {
36077  __pyx_t_11 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1936, __pyx_L1_error)
36078  __Pyx_GOTREF(__pyx_t_11);
36079  if (__pyx_t_4) {
36080  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
36081  }
36082  __Pyx_INCREF(__pyx_v_temp_array);
36083  __Pyx_GIVEREF(__pyx_v_temp_array);
36084  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_v_temp_array);
36085  __Pyx_INCREF(__pyx_v_theta);
36086  __Pyx_GIVEREF(__pyx_v_theta);
36087  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_v_theta);
36088  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
36089  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->vDir));
36090  PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, ((PyObject *)__pyx_v_self->vDir));
36091  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1936, __pyx_L1_error)
36092  __Pyx_GOTREF(__pyx_t_6);
36093  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36094  }
36095  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36096  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_tuple__11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1936, __pyx_L1_error)
36097  __Pyx_GOTREF(__pyx_t_2);
36098  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36099  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1936, __pyx_L1_error)
36100  __Pyx_GOTREF(__pyx_t_6);
36101  __Pyx_INCREF(__pyx_v_rr);
36102  __Pyx_GIVEREF(__pyx_v_rr);
36103  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_rr);
36104  __Pyx_INCREF(__pyx_slice__4);
36105  __Pyx_GIVEREF(__pyx_slice__4);
36106  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4);
36107  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->waveDirs), __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 1936, __pyx_L1_error)
36108  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36109  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36110 
36111  /* "WaveTools.py":1937
36112  * theta = thetas[rr]
36113  * self.waveDirs[rr,:] = rotation3D(temp_array,theta,self.vDir)[0,:]
36114  * self.waveDirs[rr,:]=setDirVector( self.waveDirs[rr,:]) # <<<<<<<<<<<<<<
36115  *
36116  *
36117  */
36118  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1937, __pyx_L1_error)
36119  __Pyx_GOTREF(__pyx_t_6);
36120  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1937, __pyx_L1_error)
36121  __Pyx_GOTREF(__pyx_t_11);
36122  __Pyx_INCREF(__pyx_v_rr);
36123  __Pyx_GIVEREF(__pyx_v_rr);
36124  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_rr);
36125  __Pyx_INCREF(__pyx_slice__4);
36126  __Pyx_GIVEREF(__pyx_slice__4);
36127  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_slice__4);
36128  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDirs), __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1937, __pyx_L1_error)
36129  __Pyx_GOTREF(__pyx_t_4);
36130  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36131  __pyx_t_11 = NULL;
36132  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
36133  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_6);
36134  if (likely(__pyx_t_11)) {
36135  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
36136  __Pyx_INCREF(__pyx_t_11);
36137  __Pyx_INCREF(function);
36138  __Pyx_DECREF_SET(__pyx_t_6, function);
36139  }
36140  }
36141  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_11, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
36142  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
36143  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36144  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1937, __pyx_L1_error)
36145  __Pyx_GOTREF(__pyx_t_2);
36146  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36147  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1937, __pyx_L1_error)
36148  __Pyx_GOTREF(__pyx_t_6);
36149  __Pyx_INCREF(__pyx_v_rr);
36150  __Pyx_GIVEREF(__pyx_v_rr);
36151  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_rr);
36152  __Pyx_INCREF(__pyx_slice__4);
36153  __Pyx_GIVEREF(__pyx_slice__4);
36154  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4);
36155  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->waveDirs), __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 1937, __pyx_L1_error)
36156  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36157  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36158 
36159  /* "WaveTools.py":1934
36160  *
36161  * # initialising wave directions
36162  * for rr in directions: # <<<<<<<<<<<<<<
36163  * theta = thetas[rr]
36164  * self.waveDirs[rr,:] = rotation3D(temp_array,theta,self.vDir)[0,:]
36165  */
36166  }
36167  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36168 
36169  /* "WaveTools.py":1941
36170  *
36171  * # Initialising phasing
36172  * if phi is None: # <<<<<<<<<<<<<<
36173  * self.phiDirs = 2.0*M_PI*np.random.rand(self.Mtot,RW.fi.shape[0])
36174  * elif np.shape(phi) == (2*M+1,RW.fi.shape[0]):
36175  */
36176  __pyx_t_7 = (__pyx_v_phi == Py_None);
36177  __pyx_t_14 = (__pyx_t_7 != 0);
36178  if (__pyx_t_14) {
36179 
36180  /* "WaveTools.py":1942
36181  * # Initialising phasing
36182  * if phi is None:
36183  * self.phiDirs = 2.0*M_PI*np.random.rand(self.Mtot,RW.fi.shape[0]) # <<<<<<<<<<<<<<
36184  * elif np.shape(phi) == (2*M+1,RW.fi.shape[0]):
36185  * self.phiDirs = phi
36186  */
36187  __pyx_t_8 = PyFloat_FromDouble((2.0 * M_PI)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1942, __pyx_L1_error)
36188  __Pyx_GOTREF(__pyx_t_8);
36189  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1942, __pyx_L1_error)
36190  __Pyx_GOTREF(__pyx_t_6);
36191  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_random); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L1_error)
36192  __Pyx_GOTREF(__pyx_t_4);
36193  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36194  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_rand); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1942, __pyx_L1_error)
36195  __Pyx_GOTREF(__pyx_t_6);
36196  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36197  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->Mtot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1942, __pyx_L1_error)
36198  __Pyx_GOTREF(__pyx_t_4);
36199  __pyx_t_11 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_RW->fi->dimensions[0])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1942, __pyx_L1_error)
36200  __Pyx_GOTREF(__pyx_t_11);
36201  __pyx_t_3 = NULL;
36202  __pyx_t_5 = 0;
36203  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
36204  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
36205  if (likely(__pyx_t_3)) {
36206  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
36207  __Pyx_INCREF(__pyx_t_3);
36208  __Pyx_INCREF(function);
36209  __Pyx_DECREF_SET(__pyx_t_6, function);
36210  __pyx_t_5 = 1;
36211  }
36212  }
36213  #if CYTHON_FAST_PYCALL
36214  if (PyFunction_Check(__pyx_t_6)) {
36215  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_11};
36216  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
36217  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
36218  __Pyx_GOTREF(__pyx_t_2);
36219  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36220  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36221  } else
36222  #endif
36223  #if CYTHON_FAST_PYCCALL
36224  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
36225  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_t_11};
36226  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
36227  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
36228  __Pyx_GOTREF(__pyx_t_2);
36229  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36230  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36231  } else
36232  #endif
36233  {
36234  __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1942, __pyx_L1_error)
36235  __Pyx_GOTREF(__pyx_t_10);
36236  if (__pyx_t_3) {
36237  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
36238  }
36239  __Pyx_GIVEREF(__pyx_t_4);
36240  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_t_4);
36241  __Pyx_GIVEREF(__pyx_t_11);
36242  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_11);
36243  __pyx_t_4 = 0;
36244  __pyx_t_11 = 0;
36245  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1942, __pyx_L1_error)
36246  __Pyx_GOTREF(__pyx_t_2);
36247  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36248  }
36249  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36250  __pyx_t_6 = PyNumber_Multiply(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1942, __pyx_L1_error)
36251  __Pyx_GOTREF(__pyx_t_6);
36252  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36253  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36254  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1942, __pyx_L1_error)
36255  __Pyx_GIVEREF(__pyx_t_6);
36256  __Pyx_GOTREF(__pyx_v_self->phiDirs);
36257  __Pyx_DECREF(((PyObject *)__pyx_v_self->phiDirs));
36258  __pyx_v_self->phiDirs = ((PyArrayObject *)__pyx_t_6);
36259  __pyx_t_6 = 0;
36260 
36261  /* "WaveTools.py":1941
36262  *
36263  * # Initialising phasing
36264  * if phi is None: # <<<<<<<<<<<<<<
36265  * self.phiDirs = 2.0*M_PI*np.random.rand(self.Mtot,RW.fi.shape[0])
36266  * elif np.shape(phi) == (2*M+1,RW.fi.shape[0]):
36267  */
36268  goto __pyx_L6;
36269  }
36270 
36271  /* "WaveTools.py":1943
36272  * if phi is None:
36273  * self.phiDirs = 2.0*M_PI*np.random.rand(self.Mtot,RW.fi.shape[0])
36274  * elif np.shape(phi) == (2*M+1,RW.fi.shape[0]): # <<<<<<<<<<<<<<
36275  * self.phiDirs = phi
36276  * else:
36277  */
36278  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1943, __pyx_L1_error)
36279  __Pyx_GOTREF(__pyx_t_2);
36280  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1943, __pyx_L1_error)
36281  __Pyx_GOTREF(__pyx_t_8);
36282  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36283  __pyx_t_2 = NULL;
36284  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
36285  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
36286  if (likely(__pyx_t_2)) {
36287  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
36288  __Pyx_INCREF(__pyx_t_2);
36289  __Pyx_INCREF(function);
36290  __Pyx_DECREF_SET(__pyx_t_8, function);
36291  }
36292  }
36293  __pyx_t_6 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_2, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_phi);
36294  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36295  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1943, __pyx_L1_error)
36296  __Pyx_GOTREF(__pyx_t_6);
36297  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36298  __pyx_t_8 = PyNumber_Multiply(__pyx_int_2, __pyx_v_M); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1943, __pyx_L1_error)
36299  __Pyx_GOTREF(__pyx_t_8);
36300  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1943, __pyx_L1_error)
36301  __Pyx_GOTREF(__pyx_t_2);
36302  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36303  __pyx_t_8 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_RW->fi->dimensions[0])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1943, __pyx_L1_error)
36304  __Pyx_GOTREF(__pyx_t_8);
36305  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1943, __pyx_L1_error)
36306  __Pyx_GOTREF(__pyx_t_10);
36307  __Pyx_GIVEREF(__pyx_t_2);
36308  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
36309  __Pyx_GIVEREF(__pyx_t_8);
36310  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8);
36311  __pyx_t_2 = 0;
36312  __pyx_t_8 = 0;
36313  __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1943, __pyx_L1_error)
36314  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36315  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36316  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1943, __pyx_L1_error)
36317  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36318  if (__pyx_t_14) {
36319 
36320  /* "WaveTools.py":1944
36321  * self.phiDirs = 2.0*M_PI*np.random.rand(self.Mtot,RW.fi.shape[0])
36322  * elif np.shape(phi) == (2*M+1,RW.fi.shape[0]):
36323  * self.phiDirs = phi # <<<<<<<<<<<<<<
36324  * else:
36325  * logEvent("ERROR! Wavetools.py: phi in DirectionalWaves class must be given either as None or as a list with 2*M + 1 numpy arrays with length N")
36326  */
36327  if (!(likely(((__pyx_v_phi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_phi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1944, __pyx_L1_error)
36328  __pyx_t_8 = __pyx_v_phi;
36329  __Pyx_INCREF(__pyx_t_8);
36330  __Pyx_GIVEREF(__pyx_t_8);
36331  __Pyx_GOTREF(__pyx_v_self->phiDirs);
36332  __Pyx_DECREF(((PyObject *)__pyx_v_self->phiDirs));
36333  __pyx_v_self->phiDirs = ((PyArrayObject *)__pyx_t_8);
36334  __pyx_t_8 = 0;
36335 
36336  /* "WaveTools.py":1943
36337  * if phi is None:
36338  * self.phiDirs = 2.0*M_PI*np.random.rand(self.Mtot,RW.fi.shape[0])
36339  * elif np.shape(phi) == (2*M+1,RW.fi.shape[0]): # <<<<<<<<<<<<<<
36340  * self.phiDirs = phi
36341  * else:
36342  */
36343  goto __pyx_L6;
36344  }
36345 
36346  /* "WaveTools.py":1946
36347  * self.phiDirs = phi
36348  * else:
36349  * logEvent("ERROR! Wavetools.py: phi in DirectionalWaves class must be given either as None or as a list with 2*M + 1 numpy arrays with length N") # <<<<<<<<<<<<<<
36350  * sys.exit(1)
36351  *
36352  */
36353  /*else*/ {
36354  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1946, __pyx_L1_error)
36355  __Pyx_GOTREF(__pyx_t_10);
36356  __pyx_t_6 = NULL;
36357  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
36358  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
36359  if (likely(__pyx_t_6)) {
36360  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
36361  __Pyx_INCREF(__pyx_t_6);
36362  __Pyx_INCREF(function);
36363  __Pyx_DECREF_SET(__pyx_t_10, function);
36364  }
36365  }
36366  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_6, __pyx_kp_s_ERROR_Wavetools_py_phi_in_Direct) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_kp_s_ERROR_Wavetools_py_phi_in_Direct);
36367  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
36368  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1946, __pyx_L1_error)
36369  __Pyx_GOTREF(__pyx_t_8);
36370  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36371  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36372 
36373  /* "WaveTools.py":1947
36374  * else:
36375  * logEvent("ERROR! Wavetools.py: phi in DirectionalWaves class must be given either as None or as a list with 2*M + 1 numpy arrays with length N")
36376  * sys.exit(1) # <<<<<<<<<<<<<<
36377  *
36378  * if (phiSymm):
36379  */
36380  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_sys); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1947, __pyx_L1_error)
36381  __Pyx_GOTREF(__pyx_t_10);
36382  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1947, __pyx_L1_error)
36383  __Pyx_GOTREF(__pyx_t_6);
36384  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36385  __pyx_t_10 = NULL;
36386  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
36387  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
36388  if (likely(__pyx_t_10)) {
36389  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
36390  __Pyx_INCREF(__pyx_t_10);
36391  __Pyx_INCREF(function);
36392  __Pyx_DECREF_SET(__pyx_t_6, function);
36393  }
36394  }
36395  __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
36396  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
36397  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1947, __pyx_L1_error)
36398  __Pyx_GOTREF(__pyx_t_8);
36399  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36400  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36401  }
36402  __pyx_L6:;
36403 
36404  /* "WaveTools.py":1949
36405  * sys.exit(1)
36406  *
36407  * if (phiSymm): # <<<<<<<<<<<<<<
36408  * for i in range(0,M):
36409  * self.phiDirs[M+1+i,:] = self.phiDirs[self.M - 1 - i,:]
36410  */
36411  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_v_phiSymm); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 1949, __pyx_L1_error)
36412  if (__pyx_t_14) {
36413 
36414  /* "WaveTools.py":1950
36415  *
36416  * if (phiSymm):
36417  * for i in range(0,M): # <<<<<<<<<<<<<<
36418  * self.phiDirs[M+1+i,:] = self.phiDirs[self.M - 1 - i,:]
36419  *
36420  */
36421  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1950, __pyx_L1_error)
36422  __Pyx_GOTREF(__pyx_t_6);
36423  __pyx_t_10 = NULL;
36424  __pyx_t_5 = 0;
36425  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
36426  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
36427  if (likely(__pyx_t_10)) {
36428  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
36429  __Pyx_INCREF(__pyx_t_10);
36430  __Pyx_INCREF(function);
36431  __Pyx_DECREF_SET(__pyx_t_6, function);
36432  __pyx_t_5 = 1;
36433  }
36434  }
36435  #if CYTHON_FAST_PYCALL
36436  if (PyFunction_Check(__pyx_t_6)) {
36437  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_int_0, __pyx_v_M};
36438  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1950, __pyx_L1_error)
36439  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
36440  __Pyx_GOTREF(__pyx_t_8);
36441  } else
36442  #endif
36443  #if CYTHON_FAST_PYCCALL
36444  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
36445  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_int_0, __pyx_v_M};
36446  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1950, __pyx_L1_error)
36447  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
36448  __Pyx_GOTREF(__pyx_t_8);
36449  } else
36450  #endif
36451  {
36452  __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1950, __pyx_L1_error)
36453  __Pyx_GOTREF(__pyx_t_2);
36454  if (__pyx_t_10) {
36455  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
36456  }
36457  __Pyx_INCREF(__pyx_int_0);
36458  __Pyx_GIVEREF(__pyx_int_0);
36459  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_int_0);
36460  __Pyx_INCREF(__pyx_v_M);
36461  __Pyx_GIVEREF(__pyx_v_M);
36462  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_v_M);
36463  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1950, __pyx_L1_error)
36464  __Pyx_GOTREF(__pyx_t_8);
36465  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36466  }
36467  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36468  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
36469  __pyx_t_6 = __pyx_t_8; __Pyx_INCREF(__pyx_t_6); __pyx_t_13 = 0;
36470  __pyx_t_15 = NULL;
36471  } else {
36472  __pyx_t_13 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1950, __pyx_L1_error)
36473  __Pyx_GOTREF(__pyx_t_6);
36474  __pyx_t_15 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1950, __pyx_L1_error)
36475  }
36476  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36477  for (;;) {
36478  if (likely(!__pyx_t_15)) {
36479  if (likely(PyList_CheckExact(__pyx_t_6))) {
36480  if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_6)) break;
36481  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36482  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1950, __pyx_L1_error)
36483  #else
36484  __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1950, __pyx_L1_error)
36485  __Pyx_GOTREF(__pyx_t_8);
36486  #endif
36487  } else {
36488  if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
36489  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36490  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1950, __pyx_L1_error)
36491  #else
36492  __pyx_t_8 = PySequence_ITEM(__pyx_t_6, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1950, __pyx_L1_error)
36493  __Pyx_GOTREF(__pyx_t_8);
36494  #endif
36495  }
36496  } else {
36497  __pyx_t_8 = __pyx_t_15(__pyx_t_6);
36498  if (unlikely(!__pyx_t_8)) {
36499  PyObject* exc_type = PyErr_Occurred();
36500  if (exc_type) {
36501  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
36502  else __PYX_ERR(0, 1950, __pyx_L1_error)
36503  }
36504  break;
36505  }
36506  __Pyx_GOTREF(__pyx_t_8);
36507  }
36508  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
36509  __pyx_t_8 = 0;
36510 
36511  /* "WaveTools.py":1951
36512  * if (phiSymm):
36513  * for i in range(0,M):
36514  * self.phiDirs[M+1+i,:] = self.phiDirs[self.M - 1 - i,:] # <<<<<<<<<<<<<<
36515  *
36516  *
36517  */
36518  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_M); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1951, __pyx_L1_error)
36519  __Pyx_GOTREF(__pyx_t_8);
36520  __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_8, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error)
36521  __Pyx_GOTREF(__pyx_t_2);
36522  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36523  __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1951, __pyx_L1_error)
36524  __Pyx_GOTREF(__pyx_t_8);
36525  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36526  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error)
36527  __Pyx_GOTREF(__pyx_t_2);
36528  __Pyx_GIVEREF(__pyx_t_8);
36529  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
36530  __Pyx_INCREF(__pyx_slice__4);
36531  __Pyx_GIVEREF(__pyx_slice__4);
36532  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__4);
36533  __pyx_t_8 = 0;
36534  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->phiDirs), __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1951, __pyx_L1_error)
36535  __Pyx_GOTREF(__pyx_t_8);
36536  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36537  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_M, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error)
36538  __Pyx_GOTREF(__pyx_t_2);
36539  __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1951, __pyx_L1_error)
36540  __Pyx_GOTREF(__pyx_t_10);
36541  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36542  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error)
36543  __Pyx_GOTREF(__pyx_t_2);
36544  __Pyx_GIVEREF(__pyx_t_10);
36545  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
36546  __Pyx_INCREF(__pyx_slice__4);
36547  __Pyx_GIVEREF(__pyx_slice__4);
36548  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__4);
36549  __pyx_t_10 = 0;
36550  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->phiDirs), __pyx_t_2, __pyx_t_8) < 0)) __PYX_ERR(0, 1951, __pyx_L1_error)
36551  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36552  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36553 
36554  /* "WaveTools.py":1950
36555  *
36556  * if (phiSymm):
36557  * for i in range(0,M): # <<<<<<<<<<<<<<
36558  * self.phiDirs[M+1+i,:] = self.phiDirs[self.M - 1 - i,:]
36559  *
36560  */
36561  }
36562  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36563 
36564  /* "WaveTools.py":1949
36565  * sys.exit(1)
36566  *
36567  * if (phiSymm): # <<<<<<<<<<<<<<
36568  * for i in range(0,M):
36569  * self.phiDirs[M+1+i,:] = self.phiDirs[self.M - 1 - i,:]
36570  */
36571  }
36572 
36573  /* "WaveTools.py":1956
36574  *
36575  *
36576  * theta_m = reduceToIntervals(thetas,dth) # <<<<<<<<<<<<<<
36577  * if (spread_params is None):
36578  * Si_Sp = spread_fun(theta_m,RW.fim)
36579  */
36580  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_reduceToIntervals); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1956, __pyx_L1_error)
36581  __Pyx_GOTREF(__pyx_t_8);
36582  __pyx_t_2 = NULL;
36583  __pyx_t_5 = 0;
36584  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
36585  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
36586  if (likely(__pyx_t_2)) {
36587  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
36588  __Pyx_INCREF(__pyx_t_2);
36589  __Pyx_INCREF(function);
36590  __Pyx_DECREF_SET(__pyx_t_8, function);
36591  __pyx_t_5 = 1;
36592  }
36593  }
36594  #if CYTHON_FAST_PYCALL
36595  if (PyFunction_Check(__pyx_t_8)) {
36596  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_thetas, __pyx_v_dth};
36597  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1956, __pyx_L1_error)
36598  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36599  __Pyx_GOTREF(__pyx_t_6);
36600  } else
36601  #endif
36602  #if CYTHON_FAST_PYCCALL
36603  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
36604  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_thetas, __pyx_v_dth};
36605  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1956, __pyx_L1_error)
36606  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36607  __Pyx_GOTREF(__pyx_t_6);
36608  } else
36609  #endif
36610  {
36611  __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1956, __pyx_L1_error)
36612  __Pyx_GOTREF(__pyx_t_10);
36613  if (__pyx_t_2) {
36614  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
36615  }
36616  __Pyx_INCREF(__pyx_v_thetas);
36617  __Pyx_GIVEREF(__pyx_v_thetas);
36618  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_thetas);
36619  __Pyx_INCREF(__pyx_v_dth);
36620  __Pyx_GIVEREF(__pyx_v_dth);
36621  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_v_dth);
36622  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1956, __pyx_L1_error)
36623  __Pyx_GOTREF(__pyx_t_6);
36624  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36625  }
36626  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36627  __pyx_v_theta_m = __pyx_t_6;
36628  __pyx_t_6 = 0;
36629 
36630  /* "WaveTools.py":1957
36631  *
36632  * theta_m = reduceToIntervals(thetas,dth)
36633  * if (spread_params is None): # <<<<<<<<<<<<<<
36634  * Si_Sp = spread_fun(theta_m,RW.fim)
36635  * else:
36636  */
36637  __pyx_t_14 = (__pyx_v_spread_params == Py_None);
36638  __pyx_t_7 = (__pyx_t_14 != 0);
36639  if (__pyx_t_7) {
36640 
36641  /* "WaveTools.py":1958
36642  * theta_m = reduceToIntervals(thetas,dth)
36643  * if (spread_params is None):
36644  * Si_Sp = spread_fun(theta_m,RW.fim) # <<<<<<<<<<<<<<
36645  * else:
36646  * try:
36647  */
36648  __Pyx_INCREF(__pyx_v_spread_fun);
36649  __pyx_t_8 = __pyx_v_spread_fun; __pyx_t_10 = NULL;
36650  __pyx_t_5 = 0;
36651  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
36652  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
36653  if (likely(__pyx_t_10)) {
36654  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
36655  __Pyx_INCREF(__pyx_t_10);
36656  __Pyx_INCREF(function);
36657  __Pyx_DECREF_SET(__pyx_t_8, function);
36658  __pyx_t_5 = 1;
36659  }
36660  }
36661  #if CYTHON_FAST_PYCALL
36662  if (PyFunction_Check(__pyx_t_8)) {
36663  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_theta_m, ((PyObject *)__pyx_v_RW->fim)};
36664  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1958, __pyx_L1_error)
36665  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
36666  __Pyx_GOTREF(__pyx_t_6);
36667  } else
36668  #endif
36669  #if CYTHON_FAST_PYCCALL
36670  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
36671  PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_theta_m, ((PyObject *)__pyx_v_RW->fim)};
36672  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1958, __pyx_L1_error)
36673  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
36674  __Pyx_GOTREF(__pyx_t_6);
36675  } else
36676  #endif
36677  {
36678  __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1958, __pyx_L1_error)
36679  __Pyx_GOTREF(__pyx_t_2);
36680  if (__pyx_t_10) {
36681  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
36682  }
36683  __Pyx_INCREF(__pyx_v_theta_m);
36684  __Pyx_GIVEREF(__pyx_v_theta_m);
36685  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_theta_m);
36686  __Pyx_INCREF(((PyObject *)__pyx_v_RW->fim));
36687  __Pyx_GIVEREF(((PyObject *)__pyx_v_RW->fim));
36688  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, ((PyObject *)__pyx_v_RW->fim));
36689  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1958, __pyx_L1_error)
36690  __Pyx_GOTREF(__pyx_t_6);
36691  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36692  }
36693  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36694  __pyx_v_Si_Sp = __pyx_t_6;
36695  __pyx_t_6 = 0;
36696 
36697  /* "WaveTools.py":1957
36698  *
36699  * theta_m = reduceToIntervals(thetas,dth)
36700  * if (spread_params is None): # <<<<<<<<<<<<<<
36701  * Si_Sp = spread_fun(theta_m,RW.fim)
36702  * else:
36703  */
36704  goto __pyx_L10;
36705  }
36706 
36707  /* "WaveTools.py":1960
36708  * Si_Sp = spread_fun(theta_m,RW.fim)
36709  * else:
36710  * try: # <<<<<<<<<<<<<<
36711  * Si_Sp = spread_fun(theta_m,RW.fim, **spread_params)
36712  * except:
36713  */
36714  /*else*/ {
36715  {
36716  __Pyx_PyThreadState_declare
36717  __Pyx_PyThreadState_assign
36718  __Pyx_ExceptionSave(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
36719  __Pyx_XGOTREF(__pyx_t_16);
36720  __Pyx_XGOTREF(__pyx_t_17);
36721  __Pyx_XGOTREF(__pyx_t_18);
36722  /*try:*/ {
36723 
36724  /* "WaveTools.py":1961
36725  * else:
36726  * try:
36727  * Si_Sp = spread_fun(theta_m,RW.fim, **spread_params) # <<<<<<<<<<<<<<
36728  * except:
36729  * logEvent('ERROR! Wavetools.py: Additional spread parameters are not valid for the %s spectrum' %spectName)
36730  */
36731  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1961, __pyx_L11_error)
36732  __Pyx_GOTREF(__pyx_t_6);
36733  __Pyx_INCREF(__pyx_v_theta_m);
36734  __Pyx_GIVEREF(__pyx_v_theta_m);
36735  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_theta_m);
36736  __Pyx_INCREF(((PyObject *)__pyx_v_RW->fim));
36737  __Pyx_GIVEREF(((PyObject *)__pyx_v_RW->fim));
36738  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_RW->fim));
36739  if (unlikely(__pyx_v_spread_params == Py_None)) {
36740  PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
36741  __PYX_ERR(0, 1961, __pyx_L11_error)
36742  }
36743  if (likely(PyDict_CheckExact(__pyx_v_spread_params))) {
36744  __pyx_t_8 = PyDict_Copy(__pyx_v_spread_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1961, __pyx_L11_error)
36745  __Pyx_GOTREF(__pyx_t_8);
36746  } else {
36747  __pyx_t_8 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_spread_params, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1961, __pyx_L11_error)
36748  __Pyx_GOTREF(__pyx_t_8);
36749  }
36750  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_spread_fun, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1961, __pyx_L11_error)
36751  __Pyx_GOTREF(__pyx_t_2);
36752  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36753  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36754  __pyx_v_Si_Sp = __pyx_t_2;
36755  __pyx_t_2 = 0;
36756 
36757  /* "WaveTools.py":1960
36758  * Si_Sp = spread_fun(theta_m,RW.fim)
36759  * else:
36760  * try: # <<<<<<<<<<<<<<
36761  * Si_Sp = spread_fun(theta_m,RW.fim, **spread_params)
36762  * except:
36763  */
36764  }
36765  __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
36766  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
36767  __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
36768  goto __pyx_L16_try_end;
36769  __pyx_L11_error:;
36770  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
36771  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
36772  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
36773  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
36774  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
36775  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
36776  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
36777  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36778 
36779  /* "WaveTools.py":1962
36780  * try:
36781  * Si_Sp = spread_fun(theta_m,RW.fim, **spread_params)
36782  * except: # <<<<<<<<<<<<<<
36783  * logEvent('ERROR! Wavetools.py: Additional spread parameters are not valid for the %s spectrum' %spectName)
36784  * sys.exit(1)
36785  */
36786  /*except:*/ {
36787  __Pyx_AddTraceback("WaveTools.DirectionalWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
36788  if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 1962, __pyx_L13_except_error)
36789  __Pyx_GOTREF(__pyx_t_2);
36790  __Pyx_GOTREF(__pyx_t_8);
36791  __Pyx_GOTREF(__pyx_t_6);
36792 
36793  /* "WaveTools.py":1963
36794  * Si_Sp = spread_fun(theta_m,RW.fim, **spread_params)
36795  * except:
36796  * logEvent('ERROR! Wavetools.py: Additional spread parameters are not valid for the %s spectrum' %spectName) # <<<<<<<<<<<<<<
36797  * sys.exit(1)
36798  *
36799  */
36800  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1963, __pyx_L13_except_error)
36801  __Pyx_GOTREF(__pyx_t_11);
36802  __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ERROR_Wavetools_py_Additional_sp_2, __pyx_v_spectName); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1963, __pyx_L13_except_error)
36803  __Pyx_GOTREF(__pyx_t_4);
36804  __pyx_t_3 = NULL;
36805  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
36806  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
36807  if (likely(__pyx_t_3)) {
36808  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
36809  __Pyx_INCREF(__pyx_t_3);
36810  __Pyx_INCREF(function);
36811  __Pyx_DECREF_SET(__pyx_t_11, function);
36812  }
36813  }
36814  __pyx_t_10 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4);
36815  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
36816  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36817  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1963, __pyx_L13_except_error)
36818  __Pyx_GOTREF(__pyx_t_10);
36819  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36820  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36821 
36822  /* "WaveTools.py":1964
36823  * except:
36824  * logEvent('ERROR! Wavetools.py: Additional spread parameters are not valid for the %s spectrum' %spectName)
36825  * sys.exit(1) # <<<<<<<<<<<<<<
36826  *
36827  * # Setting amplitudes
36828  */
36829  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1964, __pyx_L13_except_error)
36830  __Pyx_GOTREF(__pyx_t_11);
36831  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1964, __pyx_L13_except_error)
36832  __Pyx_GOTREF(__pyx_t_4);
36833  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
36834  __pyx_t_11 = NULL;
36835  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
36836  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
36837  if (likely(__pyx_t_11)) {
36838  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
36839  __Pyx_INCREF(__pyx_t_11);
36840  __Pyx_INCREF(function);
36841  __Pyx_DECREF_SET(__pyx_t_4, function);
36842  }
36843  }
36844  __pyx_t_10 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_11, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_1);
36845  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
36846  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1964, __pyx_L13_except_error)
36847  __Pyx_GOTREF(__pyx_t_10);
36848  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36849  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36850  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36851  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
36852  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
36853  goto __pyx_L12_exception_handled;
36854  }
36855  __pyx_L13_except_error:;
36856 
36857  /* "WaveTools.py":1960
36858  * Si_Sp = spread_fun(theta_m,RW.fim)
36859  * else:
36860  * try: # <<<<<<<<<<<<<<
36861  * Si_Sp = spread_fun(theta_m,RW.fim, **spread_params)
36862  * except:
36863  */
36864  __Pyx_XGIVEREF(__pyx_t_16);
36865  __Pyx_XGIVEREF(__pyx_t_17);
36866  __Pyx_XGIVEREF(__pyx_t_18);
36867  __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
36868  goto __pyx_L1_error;
36869  __pyx_L12_exception_handled:;
36870  __Pyx_XGIVEREF(__pyx_t_16);
36871  __Pyx_XGIVEREF(__pyx_t_17);
36872  __Pyx_XGIVEREF(__pyx_t_18);
36873  __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
36874  __pyx_L16_try_end:;
36875  }
36876  }
36877  __pyx_L10:;
36878 
36879  /* "WaveTools.py":1968
36880  * # Setting amplitudes
36881  * #Normalising the spreading function
36882  * freq = list(range(0,N)) # <<<<<<<<<<<<<<
36883  * # Normalising integral over all frequencies
36884  * for ii in freq:
36885  */
36886  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1968, __pyx_L1_error)
36887  __Pyx_GOTREF(__pyx_t_8);
36888  __pyx_t_2 = NULL;
36889  __pyx_t_5 = 0;
36890  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
36891  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
36892  if (likely(__pyx_t_2)) {
36893  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
36894  __Pyx_INCREF(__pyx_t_2);
36895  __Pyx_INCREF(function);
36896  __Pyx_DECREF_SET(__pyx_t_8, function);
36897  __pyx_t_5 = 1;
36898  }
36899  }
36900  #if CYTHON_FAST_PYCALL
36901  if (PyFunction_Check(__pyx_t_8)) {
36902  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_int_0, __pyx_v_N};
36903  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L1_error)
36904  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36905  __Pyx_GOTREF(__pyx_t_6);
36906  } else
36907  #endif
36908  #if CYTHON_FAST_PYCCALL
36909  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
36910  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_int_0, __pyx_v_N};
36911  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L1_error)
36912  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36913  __Pyx_GOTREF(__pyx_t_6);
36914  } else
36915  #endif
36916  {
36917  __pyx_t_10 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1968, __pyx_L1_error)
36918  __Pyx_GOTREF(__pyx_t_10);
36919  if (__pyx_t_2) {
36920  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
36921  }
36922  __Pyx_INCREF(__pyx_int_0);
36923  __Pyx_GIVEREF(__pyx_int_0);
36924  PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_int_0);
36925  __Pyx_INCREF(__pyx_v_N);
36926  __Pyx_GIVEREF(__pyx_v_N);
36927  PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_v_N);
36928  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L1_error)
36929  __Pyx_GOTREF(__pyx_t_6);
36930  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
36931  }
36932  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
36933  __pyx_t_8 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1968, __pyx_L1_error)
36934  __Pyx_GOTREF(__pyx_t_8);
36935  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
36936  __pyx_v_freq = ((PyObject*)__pyx_t_8);
36937  __pyx_t_8 = 0;
36938 
36939  /* "WaveTools.py":1970
36940  * freq = list(range(0,N))
36941  * # Normalising integral over all frequencies
36942  * for ii in freq: # <<<<<<<<<<<<<<
36943  * Si_Sp[:,ii] = normIntegral(Si_Sp[:,ii],theta_m)
36944  * Si_Sp[:,ii]*= RW.Si_Jm[ii]
36945  */
36946  __pyx_t_8 = __pyx_v_freq; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0;
36947  for (;;) {
36948  if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_8)) break;
36949  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
36950  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_6); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1970, __pyx_L1_error)
36951  #else
36952  __pyx_t_6 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1970, __pyx_L1_error)
36953  __Pyx_GOTREF(__pyx_t_6);
36954  #endif
36955  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_6);
36956  __pyx_t_6 = 0;
36957 
36958  /* "WaveTools.py":1971
36959  * # Normalising integral over all frequencies
36960  * for ii in freq:
36961  * Si_Sp[:,ii] = normIntegral(Si_Sp[:,ii],theta_m) # <<<<<<<<<<<<<<
36962  * Si_Sp[:,ii]*= RW.Si_Jm[ii]
36963  * # Creating amplitudes spectrum
36964  */
36965  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_normIntegral); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1971, __pyx_L1_error)
36966  __Pyx_GOTREF(__pyx_t_10);
36967  if (unlikely(!__pyx_v_Si_Sp)) { __Pyx_RaiseUnboundLocalError("Si_Sp"); __PYX_ERR(0, 1971, __pyx_L1_error) }
36968  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1971, __pyx_L1_error)
36969  __Pyx_GOTREF(__pyx_t_2);
36970  __Pyx_INCREF(__pyx_slice__4);
36971  __Pyx_GIVEREF(__pyx_slice__4);
36972  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__4);
36973  __Pyx_INCREF(__pyx_v_ii);
36974  __Pyx_GIVEREF(__pyx_v_ii);
36975  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ii);
36976  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_Si_Sp, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1971, __pyx_L1_error)
36977  __Pyx_GOTREF(__pyx_t_4);
36978  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36979  __pyx_t_2 = NULL;
36980  __pyx_t_5 = 0;
36981  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
36982  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
36983  if (likely(__pyx_t_2)) {
36984  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
36985  __Pyx_INCREF(__pyx_t_2);
36986  __Pyx_INCREF(function);
36987  __Pyx_DECREF_SET(__pyx_t_10, function);
36988  __pyx_t_5 = 1;
36989  }
36990  }
36991  #if CYTHON_FAST_PYCALL
36992  if (PyFunction_Check(__pyx_t_10)) {
36993  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_theta_m};
36994  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1971, __pyx_L1_error)
36995  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
36996  __Pyx_GOTREF(__pyx_t_6);
36997  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
36998  } else
36999  #endif
37000  #if CYTHON_FAST_PYCCALL
37001  if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
37002  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_v_theta_m};
37003  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1971, __pyx_L1_error)
37004  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
37005  __Pyx_GOTREF(__pyx_t_6);
37006  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37007  } else
37008  #endif
37009  {
37010  __pyx_t_11 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1971, __pyx_L1_error)
37011  __Pyx_GOTREF(__pyx_t_11);
37012  if (__pyx_t_2) {
37013  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
37014  }
37015  __Pyx_GIVEREF(__pyx_t_4);
37016  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_4);
37017  __Pyx_INCREF(__pyx_v_theta_m);
37018  __Pyx_GIVEREF(__pyx_v_theta_m);
37019  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_v_theta_m);
37020  __pyx_t_4 = 0;
37021  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1971, __pyx_L1_error)
37022  __Pyx_GOTREF(__pyx_t_6);
37023  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37024  }
37025  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
37026  if (unlikely(!__pyx_v_Si_Sp)) { __Pyx_RaiseUnboundLocalError("Si_Sp"); __PYX_ERR(0, 1971, __pyx_L1_error) }
37027  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1971, __pyx_L1_error)
37028  __Pyx_GOTREF(__pyx_t_10);
37029  __Pyx_INCREF(__pyx_slice__4);
37030  __Pyx_GIVEREF(__pyx_slice__4);
37031  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_slice__4);
37032  __Pyx_INCREF(__pyx_v_ii);
37033  __Pyx_GIVEREF(__pyx_v_ii);
37034  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_ii);
37035  if (unlikely(PyObject_SetItem(__pyx_v_Si_Sp, __pyx_t_10, __pyx_t_6) < 0)) __PYX_ERR(0, 1971, __pyx_L1_error)
37036  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
37037  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37038 
37039  /* "WaveTools.py":1972
37040  * for ii in freq:
37041  * Si_Sp[:,ii] = normIntegral(Si_Sp[:,ii],theta_m)
37042  * Si_Sp[:,ii]*= RW.Si_Jm[ii] # <<<<<<<<<<<<<<
37043  * # Creating amplitudes spectrum
37044  * self.aiDirs[:] = np.sqrt(2.*returnRectangles3D(Si_Sp,theta_m,RW.fim))
37045  */
37046  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1972, __pyx_L1_error)
37047  __Pyx_GOTREF(__pyx_t_6);
37048  __Pyx_INCREF(__pyx_slice__4);
37049  __Pyx_GIVEREF(__pyx_slice__4);
37050  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__4);
37051  __Pyx_INCREF(__pyx_v_ii);
37052  __Pyx_GIVEREF(__pyx_v_ii);
37053  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ii);
37054  if (unlikely(!__pyx_v_Si_Sp)) { __Pyx_RaiseUnboundLocalError("Si_Sp"); __PYX_ERR(0, 1972, __pyx_L1_error) }
37055  __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_Si_Sp, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1972, __pyx_L1_error)
37056  __Pyx_GOTREF(__pyx_t_10);
37057  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_RW->Si_Jm), __pyx_v_ii); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1972, __pyx_L1_error)
37058  __Pyx_GOTREF(__pyx_t_11);
37059  __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1972, __pyx_L1_error)
37060  __Pyx_GOTREF(__pyx_t_4);
37061  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
37062  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37063  if (unlikely(!__pyx_v_Si_Sp)) { __Pyx_RaiseUnboundLocalError("Si_Sp"); __PYX_ERR(0, 1972, __pyx_L1_error) }
37064  if (unlikely(PyObject_SetItem(__pyx_v_Si_Sp, __pyx_t_6, __pyx_t_4) < 0)) __PYX_ERR(0, 1972, __pyx_L1_error)
37065  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37066  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37067 
37068  /* "WaveTools.py":1970
37069  * freq = list(range(0,N))
37070  * # Normalising integral over all frequencies
37071  * for ii in freq: # <<<<<<<<<<<<<<
37072  * Si_Sp[:,ii] = normIntegral(Si_Sp[:,ii],theta_m)
37073  * Si_Sp[:,ii]*= RW.Si_Jm[ii]
37074  */
37075  }
37076  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37077 
37078  /* "WaveTools.py":1974
37079  * Si_Sp[:,ii]*= RW.Si_Jm[ii]
37080  * # Creating amplitudes spectrum
37081  * self.aiDirs[:] = np.sqrt(2.*returnRectangles3D(Si_Sp,theta_m,RW.fim)) # <<<<<<<<<<<<<<
37082  * self.mwl = mwl
37083  * self.depth = depth
37084  */
37085  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1974, __pyx_L1_error)
37086  __Pyx_GOTREF(__pyx_t_6);
37087  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1974, __pyx_L1_error)
37088  __Pyx_GOTREF(__pyx_t_4);
37089  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37090  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_returnRectangles3D); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1974, __pyx_L1_error)
37091  __Pyx_GOTREF(__pyx_t_11);
37092  if (unlikely(!__pyx_v_Si_Sp)) { __Pyx_RaiseUnboundLocalError("Si_Sp"); __PYX_ERR(0, 1974, __pyx_L1_error) }
37093  __pyx_t_10 = NULL;
37094  __pyx_t_5 = 0;
37095  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
37096  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
37097  if (likely(__pyx_t_10)) {
37098  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
37099  __Pyx_INCREF(__pyx_t_10);
37100  __Pyx_INCREF(function);
37101  __Pyx_DECREF_SET(__pyx_t_11, function);
37102  __pyx_t_5 = 1;
37103  }
37104  }
37105  #if CYTHON_FAST_PYCALL
37106  if (PyFunction_Check(__pyx_t_11)) {
37107  PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_Si_Sp, __pyx_v_theta_m, ((PyObject *)__pyx_v_RW->fim)};
37108  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1974, __pyx_L1_error)
37109  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
37110  __Pyx_GOTREF(__pyx_t_6);
37111  } else
37112  #endif
37113  #if CYTHON_FAST_PYCCALL
37114  if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
37115  PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_Si_Sp, __pyx_v_theta_m, ((PyObject *)__pyx_v_RW->fim)};
37116  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1974, __pyx_L1_error)
37117  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
37118  __Pyx_GOTREF(__pyx_t_6);
37119  } else
37120  #endif
37121  {
37122  __pyx_t_2 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error)
37123  __Pyx_GOTREF(__pyx_t_2);
37124  if (__pyx_t_10) {
37125  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10); __pyx_t_10 = NULL;
37126  }
37127  __Pyx_INCREF(__pyx_v_Si_Sp);
37128  __Pyx_GIVEREF(__pyx_v_Si_Sp);
37129  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_Si_Sp);
37130  __Pyx_INCREF(__pyx_v_theta_m);
37131  __Pyx_GIVEREF(__pyx_v_theta_m);
37132  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_v_theta_m);
37133  __Pyx_INCREF(((PyObject *)__pyx_v_RW->fim));
37134  __Pyx_GIVEREF(((PyObject *)__pyx_v_RW->fim));
37135  PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_5, ((PyObject *)__pyx_v_RW->fim));
37136  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1974, __pyx_L1_error)
37137  __Pyx_GOTREF(__pyx_t_6);
37138  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37139  }
37140  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37141  __pyx_t_11 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1974, __pyx_L1_error)
37142  __Pyx_GOTREF(__pyx_t_11);
37143  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37144  __pyx_t_6 = NULL;
37145  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37146  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
37147  if (likely(__pyx_t_6)) {
37148  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
37149  __Pyx_INCREF(__pyx_t_6);
37150  __Pyx_INCREF(function);
37151  __Pyx_DECREF_SET(__pyx_t_4, function);
37152  }
37153  }
37154  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11);
37155  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
37156  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37157  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1974, __pyx_L1_error)
37158  __Pyx_GOTREF(__pyx_t_8);
37159  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37160  if (__Pyx_PyObject_SetSlice(((PyObject *)__pyx_v_self->aiDirs), __pyx_t_8, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1) < 0) __PYX_ERR(0, 1974, __pyx_L1_error)
37161  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37162 
37163  /* "WaveTools.py":1975
37164  * # Creating amplitudes spectrum
37165  * self.aiDirs[:] = np.sqrt(2.*returnRectangles3D(Si_Sp,theta_m,RW.fim))
37166  * self.mwl = mwl # <<<<<<<<<<<<<<
37167  * self.depth = depth
37168  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d")
37169  */
37170  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1975, __pyx_L1_error)
37171  __pyx_v_self->mwl = __pyx_t_12;
37172 
37173  /* "WaveTools.py":1976
37174  * self.aiDirs[:] = np.sqrt(2.*returnRectangles3D(Si_Sp,theta_m,RW.fim))
37175  * self.mwl = mwl
37176  * self.depth = depth # <<<<<<<<<<<<<<
37177  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d")
37178  * for nn in range(self.N):
37179  */
37180  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1976, __pyx_L1_error)
37181  __pyx_v_self->depth = __pyx_t_12;
37182 
37183  /* "WaveTools.py":1977
37184  * self.mwl = mwl
37185  * self.depth = depth
37186  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d") # <<<<<<<<<<<<<<
37187  * for nn in range(self.N):
37188  * for mm in range(self.Mtot):
37189  */
37190  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1977, __pyx_L1_error)
37191  __Pyx_GOTREF(__pyx_t_4);
37192  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1977, __pyx_L1_error)
37193  __Pyx_GOTREF(__pyx_t_11);
37194  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37195  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1977, __pyx_L1_error)
37196  __Pyx_GOTREF(__pyx_t_4);
37197  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->Mtot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1977, __pyx_L1_error)
37198  __Pyx_GOTREF(__pyx_t_6);
37199  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
37200  __Pyx_GOTREF(__pyx_t_2);
37201  __Pyx_GIVEREF(__pyx_t_4);
37202  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
37203  __Pyx_GIVEREF(__pyx_t_6);
37204  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_6);
37205  __Pyx_INCREF(__pyx_int_3);
37206  __Pyx_GIVEREF(__pyx_int_3);
37207  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_int_3);
37208  __pyx_t_4 = 0;
37209  __pyx_t_6 = 0;
37210  __pyx_t_6 = NULL;
37211  __pyx_t_5 = 0;
37212  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
37213  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
37214  if (likely(__pyx_t_6)) {
37215  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
37216  __Pyx_INCREF(__pyx_t_6);
37217  __Pyx_INCREF(function);
37218  __Pyx_DECREF_SET(__pyx_t_11, function);
37219  __pyx_t_5 = 1;
37220  }
37221  }
37222  #if CYTHON_FAST_PYCALL
37223  if (PyFunction_Check(__pyx_t_11)) {
37224  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_n_s_d};
37225  __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1977, __pyx_L1_error)
37226  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
37227  __Pyx_GOTREF(__pyx_t_8);
37228  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37229  } else
37230  #endif
37231  #if CYTHON_FAST_PYCCALL
37232  if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
37233  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_n_s_d};
37234  __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1977, __pyx_L1_error)
37235  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
37236  __Pyx_GOTREF(__pyx_t_8);
37237  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37238  } else
37239  #endif
37240  {
37241  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1977, __pyx_L1_error)
37242  __Pyx_GOTREF(__pyx_t_4);
37243  if (__pyx_t_6) {
37244  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
37245  }
37246  __Pyx_GIVEREF(__pyx_t_2);
37247  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_2);
37248  __Pyx_INCREF(__pyx_n_s_d);
37249  __Pyx_GIVEREF(__pyx_n_s_d);
37250  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_n_s_d);
37251  __pyx_t_2 = 0;
37252  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1977, __pyx_L1_error)
37253  __Pyx_GOTREF(__pyx_t_8);
37254  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37255  }
37256  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37257  if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1977, __pyx_L1_error)
37258  __Pyx_GIVEREF(__pyx_t_8);
37259  __Pyx_GOTREF(__pyx_v_self->kDirs);
37260  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDirs));
37261  __pyx_v_self->kDirs = ((PyArrayObject *)__pyx_t_8);
37262  __pyx_t_8 = 0;
37263 
37264  /* "WaveTools.py":1978
37265  * self.depth = depth
37266  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d")
37267  * for nn in range(self.N): # <<<<<<<<<<<<<<
37268  * for mm in range(self.Mtot):
37269  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:]
37270  */
37271  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_range); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1978, __pyx_L1_error)
37272  __Pyx_GOTREF(__pyx_t_11);
37273  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1978, __pyx_L1_error)
37274  __Pyx_GOTREF(__pyx_t_4);
37275  __pyx_t_2 = NULL;
37276  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
37277  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11);
37278  if (likely(__pyx_t_2)) {
37279  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
37280  __Pyx_INCREF(__pyx_t_2);
37281  __Pyx_INCREF(function);
37282  __Pyx_DECREF_SET(__pyx_t_11, function);
37283  }
37284  }
37285  __pyx_t_8 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4);
37286  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
37287  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37288  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1978, __pyx_L1_error)
37289  __Pyx_GOTREF(__pyx_t_8);
37290  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37291  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
37292  __pyx_t_11 = __pyx_t_8; __Pyx_INCREF(__pyx_t_11); __pyx_t_13 = 0;
37293  __pyx_t_15 = NULL;
37294  } else {
37295  __pyx_t_13 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1978, __pyx_L1_error)
37296  __Pyx_GOTREF(__pyx_t_11);
37297  __pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1978, __pyx_L1_error)
37298  }
37299  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37300  for (;;) {
37301  if (likely(!__pyx_t_15)) {
37302  if (likely(PyList_CheckExact(__pyx_t_11))) {
37303  if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_11)) break;
37304  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37305  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1978, __pyx_L1_error)
37306  #else
37307  __pyx_t_8 = PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1978, __pyx_L1_error)
37308  __Pyx_GOTREF(__pyx_t_8);
37309  #endif
37310  } else {
37311  if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
37312  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37313  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_8); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1978, __pyx_L1_error)
37314  #else
37315  __pyx_t_8 = PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1978, __pyx_L1_error)
37316  __Pyx_GOTREF(__pyx_t_8);
37317  #endif
37318  }
37319  } else {
37320  __pyx_t_8 = __pyx_t_15(__pyx_t_11);
37321  if (unlikely(!__pyx_t_8)) {
37322  PyObject* exc_type = PyErr_Occurred();
37323  if (exc_type) {
37324  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
37325  else __PYX_ERR(0, 1978, __pyx_L1_error)
37326  }
37327  break;
37328  }
37329  __Pyx_GOTREF(__pyx_t_8);
37330  }
37331  __Pyx_XDECREF_SET(__pyx_v_nn, __pyx_t_8);
37332  __pyx_t_8 = 0;
37333 
37334  /* "WaveTools.py":1979
37335  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d")
37336  * for nn in range(self.N):
37337  * for mm in range(self.Mtot): # <<<<<<<<<<<<<<
37338  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:]
37339  *
37340  */
37341  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1979, __pyx_L1_error)
37342  __Pyx_GOTREF(__pyx_t_4);
37343  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Mtot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error)
37344  __Pyx_GOTREF(__pyx_t_2);
37345  __pyx_t_6 = NULL;
37346  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37347  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
37348  if (likely(__pyx_t_6)) {
37349  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
37350  __Pyx_INCREF(__pyx_t_6);
37351  __Pyx_INCREF(function);
37352  __Pyx_DECREF_SET(__pyx_t_4, function);
37353  }
37354  }
37355  __pyx_t_8 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
37356  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
37357  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37358  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1979, __pyx_L1_error)
37359  __Pyx_GOTREF(__pyx_t_8);
37360  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37361  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
37362  __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_19 = 0;
37363  __pyx_t_20 = NULL;
37364  } else {
37365  __pyx_t_19 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1979, __pyx_L1_error)
37366  __Pyx_GOTREF(__pyx_t_4);
37367  __pyx_t_20 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1979, __pyx_L1_error)
37368  }
37369  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37370  for (;;) {
37371  if (likely(!__pyx_t_20)) {
37372  if (likely(PyList_CheckExact(__pyx_t_4))) {
37373  if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_4)) break;
37374  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37375  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 1979, __pyx_L1_error)
37376  #else
37377  __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1979, __pyx_L1_error)
37378  __Pyx_GOTREF(__pyx_t_8);
37379  #endif
37380  } else {
37381  if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
37382  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37383  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_19); __Pyx_INCREF(__pyx_t_8); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 1979, __pyx_L1_error)
37384  #else
37385  __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1979, __pyx_L1_error)
37386  __Pyx_GOTREF(__pyx_t_8);
37387  #endif
37388  }
37389  } else {
37390  __pyx_t_8 = __pyx_t_20(__pyx_t_4);
37391  if (unlikely(!__pyx_t_8)) {
37392  PyObject* exc_type = PyErr_Occurred();
37393  if (exc_type) {
37394  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
37395  else __PYX_ERR(0, 1979, __pyx_L1_error)
37396  }
37397  break;
37398  }
37399  __Pyx_GOTREF(__pyx_t_8);
37400  }
37401  __Pyx_XDECREF_SET(__pyx_v_mm, __pyx_t_8);
37402  __pyx_t_8 = 0;
37403 
37404  /* "WaveTools.py":1980
37405  * for nn in range(self.N):
37406  * for mm in range(self.Mtot):
37407  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:] # <<<<<<<<<<<<<<
37408  *
37409  * for ij in range(3):
37410  */
37411  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_RW->ki), __pyx_v_nn); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1980, __pyx_L1_error)
37412  __Pyx_GOTREF(__pyx_t_8);
37413  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
37414  __Pyx_GOTREF(__pyx_t_2);
37415  __Pyx_INCREF(__pyx_v_mm);
37416  __Pyx_GIVEREF(__pyx_v_mm);
37417  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mm);
37418  __Pyx_INCREF(__pyx_slice__4);
37419  __Pyx_GIVEREF(__pyx_slice__4);
37420  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__4);
37421  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDirs), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1980, __pyx_L1_error)
37422  __Pyx_GOTREF(__pyx_t_6);
37423  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37424  __pyx_t_2 = PyNumber_Multiply(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error)
37425  __Pyx_GOTREF(__pyx_t_2);
37426  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37427  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37428  __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1980, __pyx_L1_error)
37429  __Pyx_GOTREF(__pyx_t_6);
37430  __Pyx_INCREF(__pyx_v_nn);
37431  __Pyx_GIVEREF(__pyx_v_nn);
37432  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_nn);
37433  __Pyx_INCREF(__pyx_v_mm);
37434  __Pyx_GIVEREF(__pyx_v_mm);
37435  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_mm);
37436  __Pyx_INCREF(__pyx_slice__4);
37437  __Pyx_GIVEREF(__pyx_slice__4);
37438  PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_slice__4);
37439  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->kDirs), __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 1980, __pyx_L1_error)
37440  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37441  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37442 
37443  /* "WaveTools.py":1979
37444  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d")
37445  * for nn in range(self.N):
37446  * for mm in range(self.Mtot): # <<<<<<<<<<<<<<
37447  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:]
37448  *
37449  */
37450  }
37451  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37452 
37453  /* "WaveTools.py":1978
37454  * self.depth = depth
37455  * self.kDirs = np.zeros((self.N, self.Mtot, 3),"d")
37456  * for nn in range(self.N): # <<<<<<<<<<<<<<
37457  * for mm in range(self.Mtot):
37458  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:]
37459  */
37460  }
37461  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37462 
37463  /* "WaveTools.py":1982
37464  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:]
37465  *
37466  * for ij in range(3): # <<<<<<<<<<<<<<
37467  * self.vDir_c[ij] = self.vDir[ij]
37468  * self.vDir_ = self.vDir_c
37469  */
37470  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1982, __pyx_L1_error)
37471  __Pyx_GOTREF(__pyx_t_4);
37472  __pyx_t_2 = NULL;
37473  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
37474  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
37475  if (likely(__pyx_t_2)) {
37476  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
37477  __Pyx_INCREF(__pyx_t_2);
37478  __Pyx_INCREF(function);
37479  __Pyx_DECREF_SET(__pyx_t_4, function);
37480  }
37481  }
37482  __pyx_t_11 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_3);
37483  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
37484  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1982, __pyx_L1_error)
37485  __Pyx_GOTREF(__pyx_t_11);
37486  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37487  if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
37488  __pyx_t_4 = __pyx_t_11; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0;
37489  __pyx_t_15 = NULL;
37490  } else {
37491  __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1982, __pyx_L1_error)
37492  __Pyx_GOTREF(__pyx_t_4);
37493  __pyx_t_15 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1982, __pyx_L1_error)
37494  }
37495  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37496  for (;;) {
37497  if (likely(!__pyx_t_15)) {
37498  if (likely(PyList_CheckExact(__pyx_t_4))) {
37499  if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_4)) break;
37500  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37501  __pyx_t_11 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1982, __pyx_L1_error)
37502  #else
37503  __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1982, __pyx_L1_error)
37504  __Pyx_GOTREF(__pyx_t_11);
37505  #endif
37506  } else {
37507  if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
37508  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37509  __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_11); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1982, __pyx_L1_error)
37510  #else
37511  __pyx_t_11 = PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1982, __pyx_L1_error)
37512  __Pyx_GOTREF(__pyx_t_11);
37513  #endif
37514  }
37515  } else {
37516  __pyx_t_11 = __pyx_t_15(__pyx_t_4);
37517  if (unlikely(!__pyx_t_11)) {
37518  PyObject* exc_type = PyErr_Occurred();
37519  if (exc_type) {
37520  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
37521  else __PYX_ERR(0, 1982, __pyx_L1_error)
37522  }
37523  break;
37524  }
37525  __Pyx_GOTREF(__pyx_t_11);
37526  }
37527  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_11);
37528  __pyx_t_11 = 0;
37529 
37530  /* "WaveTools.py":1983
37531  *
37532  * for ij in range(3):
37533  * self.vDir_c[ij] = self.vDir[ij] # <<<<<<<<<<<<<<
37534  * self.vDir_ = self.vDir_c
37535  *
37536  */
37537  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->vDir), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1983, __pyx_L1_error)
37538  __Pyx_GOTREF(__pyx_t_11);
37539  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L1_error)
37540  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37541  __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1983, __pyx_L1_error)
37542  (__pyx_v_self->vDir_c[__pyx_t_19]) = __pyx_t_12;
37543 
37544  /* "WaveTools.py":1982
37545  * self.kDirs[nn,mm,:] = RW.ki[nn]*self.waveDirs[mm,:]
37546  *
37547  * for ij in range(3): # <<<<<<<<<<<<<<
37548  * self.vDir_c[ij] = self.vDir[ij]
37549  * self.vDir_ = self.vDir_c
37550  */
37551  }
37552  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37553 
37554  /* "WaveTools.py":1984
37555  * for ij in range(3):
37556  * self.vDir_c[ij] = self.vDir[ij]
37557  * self.vDir_ = self.vDir_c # <<<<<<<<<<<<<<
37558  *
37559  *
37560  */
37561  __pyx_t_21 = __pyx_v_self->vDir_c;
37562  __pyx_v_self->vDir_ = __pyx_t_21;
37563 
37564  /* "WaveTools.py":1987
37565  *
37566  *
37567  * for mm in range(self.Mtot): # <<<<<<<<<<<<<<
37568  * for nn in range(self.N):
37569  * ij = mm * self.N + nn
37570  */
37571  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_range); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1987, __pyx_L1_error)
37572  __Pyx_GOTREF(__pyx_t_11);
37573  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->Mtot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1987, __pyx_L1_error)
37574  __Pyx_GOTREF(__pyx_t_2);
37575  __pyx_t_6 = NULL;
37576  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
37577  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
37578  if (likely(__pyx_t_6)) {
37579  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
37580  __Pyx_INCREF(__pyx_t_6);
37581  __Pyx_INCREF(function);
37582  __Pyx_DECREF_SET(__pyx_t_11, function);
37583  }
37584  }
37585  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_2);
37586  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
37587  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37588  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1987, __pyx_L1_error)
37589  __Pyx_GOTREF(__pyx_t_4);
37590  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37591  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
37592  __pyx_t_11 = __pyx_t_4; __Pyx_INCREF(__pyx_t_11); __pyx_t_13 = 0;
37593  __pyx_t_15 = NULL;
37594  } else {
37595  __pyx_t_13 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1987, __pyx_L1_error)
37596  __Pyx_GOTREF(__pyx_t_11);
37597  __pyx_t_15 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1987, __pyx_L1_error)
37598  }
37599  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37600  for (;;) {
37601  if (likely(!__pyx_t_15)) {
37602  if (likely(PyList_CheckExact(__pyx_t_11))) {
37603  if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_11)) break;
37604  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37605  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1987, __pyx_L1_error)
37606  #else
37607  __pyx_t_4 = PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1987, __pyx_L1_error)
37608  __Pyx_GOTREF(__pyx_t_4);
37609  #endif
37610  } else {
37611  if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
37612  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37613  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 1987, __pyx_L1_error)
37614  #else
37615  __pyx_t_4 = PySequence_ITEM(__pyx_t_11, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1987, __pyx_L1_error)
37616  __Pyx_GOTREF(__pyx_t_4);
37617  #endif
37618  }
37619  } else {
37620  __pyx_t_4 = __pyx_t_15(__pyx_t_11);
37621  if (unlikely(!__pyx_t_4)) {
37622  PyObject* exc_type = PyErr_Occurred();
37623  if (exc_type) {
37624  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
37625  else __PYX_ERR(0, 1987, __pyx_L1_error)
37626  }
37627  break;
37628  }
37629  __Pyx_GOTREF(__pyx_t_4);
37630  }
37631  __Pyx_XDECREF_SET(__pyx_v_mm, __pyx_t_4);
37632  __pyx_t_4 = 0;
37633 
37634  /* "WaveTools.py":1988
37635  *
37636  * for mm in range(self.Mtot):
37637  * for nn in range(self.N): # <<<<<<<<<<<<<<
37638  * ij = mm * self.N + nn
37639  * self.ai_c[ij] = self.aiDirs[mm,nn]
37640  */
37641  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error)
37642  __Pyx_GOTREF(__pyx_t_2);
37643  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1988, __pyx_L1_error)
37644  __Pyx_GOTREF(__pyx_t_6);
37645  __pyx_t_8 = NULL;
37646  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
37647  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
37648  if (likely(__pyx_t_8)) {
37649  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
37650  __Pyx_INCREF(__pyx_t_8);
37651  __Pyx_INCREF(function);
37652  __Pyx_DECREF_SET(__pyx_t_2, function);
37653  }
37654  }
37655  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
37656  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
37657  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37658  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error)
37659  __Pyx_GOTREF(__pyx_t_4);
37660  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37661  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
37662  __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_19 = 0;
37663  __pyx_t_20 = NULL;
37664  } else {
37665  __pyx_t_19 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error)
37666  __Pyx_GOTREF(__pyx_t_2);
37667  __pyx_t_20 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1988, __pyx_L1_error)
37668  }
37669  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37670  for (;;) {
37671  if (likely(!__pyx_t_20)) {
37672  if (likely(PyList_CheckExact(__pyx_t_2))) {
37673  if (__pyx_t_19 >= PyList_GET_SIZE(__pyx_t_2)) break;
37674  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37675  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_4); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 1988, __pyx_L1_error)
37676  #else
37677  __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error)
37678  __Pyx_GOTREF(__pyx_t_4);
37679  #endif
37680  } else {
37681  if (__pyx_t_19 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
37682  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37683  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_19); __Pyx_INCREF(__pyx_t_4); __pyx_t_19++; if (unlikely(0 < 0)) __PYX_ERR(0, 1988, __pyx_L1_error)
37684  #else
37685  __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error)
37686  __Pyx_GOTREF(__pyx_t_4);
37687  #endif
37688  }
37689  } else {
37690  __pyx_t_4 = __pyx_t_20(__pyx_t_2);
37691  if (unlikely(!__pyx_t_4)) {
37692  PyObject* exc_type = PyErr_Occurred();
37693  if (exc_type) {
37694  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
37695  else __PYX_ERR(0, 1988, __pyx_L1_error)
37696  }
37697  break;
37698  }
37699  __Pyx_GOTREF(__pyx_t_4);
37700  }
37701  __Pyx_XDECREF_SET(__pyx_v_nn, __pyx_t_4);
37702  __pyx_t_4 = 0;
37703 
37704  /* "WaveTools.py":1989
37705  * for mm in range(self.Mtot):
37706  * for nn in range(self.N):
37707  * ij = mm * self.N + nn # <<<<<<<<<<<<<<
37708  * self.ai_c[ij] = self.aiDirs[mm,nn]
37709  * self.phi_c[ij] = self.phiDirs[mm,nn]
37710  */
37711  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1989, __pyx_L1_error)
37712  __Pyx_GOTREF(__pyx_t_4);
37713  __pyx_t_6 = PyNumber_Multiply(__pyx_v_mm, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1989, __pyx_L1_error)
37714  __Pyx_GOTREF(__pyx_t_6);
37715  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37716  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_v_nn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1989, __pyx_L1_error)
37717  __Pyx_GOTREF(__pyx_t_4);
37718  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37719  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_4);
37720  __pyx_t_4 = 0;
37721 
37722  /* "WaveTools.py":1990
37723  * for nn in range(self.N):
37724  * ij = mm * self.N + nn
37725  * self.ai_c[ij] = self.aiDirs[mm,nn] # <<<<<<<<<<<<<<
37726  * self.phi_c[ij] = self.phiDirs[mm,nn]
37727  * self.omega_c[ij] = RW.omega[nn]
37728  */
37729  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1990, __pyx_L1_error)
37730  __Pyx_GOTREF(__pyx_t_4);
37731  __Pyx_INCREF(__pyx_v_mm);
37732  __Pyx_GIVEREF(__pyx_v_mm);
37733  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_mm);
37734  __Pyx_INCREF(__pyx_v_nn);
37735  __Pyx_GIVEREF(__pyx_v_nn);
37736  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_nn);
37737  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->aiDirs), __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1990, __pyx_L1_error)
37738  __Pyx_GOTREF(__pyx_t_6);
37739  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37740  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1990, __pyx_L1_error)
37741  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37742  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1990, __pyx_L1_error)
37743  (__pyx_v_self->ai_c[__pyx_t_22]) = __pyx_t_12;
37744 
37745  /* "WaveTools.py":1991
37746  * ij = mm * self.N + nn
37747  * self.ai_c[ij] = self.aiDirs[mm,nn]
37748  * self.phi_c[ij] = self.phiDirs[mm,nn] # <<<<<<<<<<<<<<
37749  * self.omega_c[ij] = RW.omega[nn]
37750  * self.ki_c[ij] =RW.ki[nn]
37751  */
37752  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1991, __pyx_L1_error)
37753  __Pyx_GOTREF(__pyx_t_6);
37754  __Pyx_INCREF(__pyx_v_mm);
37755  __Pyx_GIVEREF(__pyx_v_mm);
37756  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_mm);
37757  __Pyx_INCREF(__pyx_v_nn);
37758  __Pyx_GIVEREF(__pyx_v_nn);
37759  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_nn);
37760  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->phiDirs), __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1991, __pyx_L1_error)
37761  __Pyx_GOTREF(__pyx_t_4);
37762  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37763  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1991, __pyx_L1_error)
37764  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37765  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1991, __pyx_L1_error)
37766  (__pyx_v_self->phi_c[__pyx_t_22]) = __pyx_t_12;
37767 
37768  /* "WaveTools.py":1992
37769  * self.ai_c[ij] = self.aiDirs[mm,nn]
37770  * self.phi_c[ij] = self.phiDirs[mm,nn]
37771  * self.omega_c[ij] = RW.omega[nn] # <<<<<<<<<<<<<<
37772  * self.ki_c[ij] =RW.ki[nn]
37773  * self.tanh_c[ij] = RW.tanhF[nn]
37774  */
37775  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_RW->omega), __pyx_v_nn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1992, __pyx_L1_error)
37776  __Pyx_GOTREF(__pyx_t_4);
37777  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1992, __pyx_L1_error)
37778  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37779  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1992, __pyx_L1_error)
37780  (__pyx_v_self->omega_c[__pyx_t_22]) = __pyx_t_12;
37781 
37782  /* "WaveTools.py":1993
37783  * self.phi_c[ij] = self.phiDirs[mm,nn]
37784  * self.omega_c[ij] = RW.omega[nn]
37785  * self.ki_c[ij] =RW.ki[nn] # <<<<<<<<<<<<<<
37786  * self.tanh_c[ij] = RW.tanhF[nn]
37787  * for kk in range(3):
37788  */
37789  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_RW->ki), __pyx_v_nn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1993, __pyx_L1_error)
37790  __Pyx_GOTREF(__pyx_t_4);
37791  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1993, __pyx_L1_error)
37792  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37793  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1993, __pyx_L1_error)
37794  (__pyx_v_self->ki_c[__pyx_t_22]) = __pyx_t_12;
37795 
37796  /* "WaveTools.py":1994
37797  * self.omega_c[ij] = RW.omega[nn]
37798  * self.ki_c[ij] =RW.ki[nn]
37799  * self.tanh_c[ij] = RW.tanhF[nn] # <<<<<<<<<<<<<<
37800  * for kk in range(3):
37801  * self.kDir_c[3*ij+kk] = self.kDirs[nn,mm,kk]
37802  */
37803  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_RW->tanhF), __pyx_v_nn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1994, __pyx_L1_error)
37804  __Pyx_GOTREF(__pyx_t_4);
37805  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L1_error)
37806  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37807  __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1994, __pyx_L1_error)
37808  (__pyx_v_self->tanh_c[__pyx_t_22]) = __pyx_t_12;
37809 
37810  /* "WaveTools.py":1995
37811  * self.ki_c[ij] =RW.ki[nn]
37812  * self.tanh_c[ij] = RW.tanhF[nn]
37813  * for kk in range(3): # <<<<<<<<<<<<<<
37814  * self.kDir_c[3*ij+kk] = self.kDirs[nn,mm,kk]
37815  * self.waveDir_c[3*ij+kk] = self.waveDirs[mm,kk]
37816  */
37817  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1995, __pyx_L1_error)
37818  __Pyx_GOTREF(__pyx_t_6);
37819  __pyx_t_8 = NULL;
37820  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
37821  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
37822  if (likely(__pyx_t_8)) {
37823  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
37824  __Pyx_INCREF(__pyx_t_8);
37825  __Pyx_INCREF(function);
37826  __Pyx_DECREF_SET(__pyx_t_6, function);
37827  }
37828  }
37829  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_3);
37830  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
37831  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
37832  __Pyx_GOTREF(__pyx_t_4);
37833  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37834  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
37835  __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_22 = 0;
37836  __pyx_t_23 = NULL;
37837  } else {
37838  __pyx_t_22 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1995, __pyx_L1_error)
37839  __Pyx_GOTREF(__pyx_t_6);
37840  __pyx_t_23 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1995, __pyx_L1_error)
37841  }
37842  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37843  for (;;) {
37844  if (likely(!__pyx_t_23)) {
37845  if (likely(PyList_CheckExact(__pyx_t_6))) {
37846  if (__pyx_t_22 >= PyList_GET_SIZE(__pyx_t_6)) break;
37847  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37848  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_4); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 1995, __pyx_L1_error)
37849  #else
37850  __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
37851  __Pyx_GOTREF(__pyx_t_4);
37852  #endif
37853  } else {
37854  if (__pyx_t_22 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
37855  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
37856  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_22); __Pyx_INCREF(__pyx_t_4); __pyx_t_22++; if (unlikely(0 < 0)) __PYX_ERR(0, 1995, __pyx_L1_error)
37857  #else
37858  __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1995, __pyx_L1_error)
37859  __Pyx_GOTREF(__pyx_t_4);
37860  #endif
37861  }
37862  } else {
37863  __pyx_t_4 = __pyx_t_23(__pyx_t_6);
37864  if (unlikely(!__pyx_t_4)) {
37865  PyObject* exc_type = PyErr_Occurred();
37866  if (exc_type) {
37867  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
37868  else __PYX_ERR(0, 1995, __pyx_L1_error)
37869  }
37870  break;
37871  }
37872  __Pyx_GOTREF(__pyx_t_4);
37873  }
37874  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_4);
37875  __pyx_t_4 = 0;
37876 
37877  /* "WaveTools.py":1996
37878  * self.tanh_c[ij] = RW.tanhF[nn]
37879  * for kk in range(3):
37880  * self.kDir_c[3*ij+kk] = self.kDirs[nn,mm,kk] # <<<<<<<<<<<<<<
37881  * self.waveDir_c[3*ij+kk] = self.waveDirs[mm,kk]
37882  *
37883  */
37884  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1996, __pyx_L1_error)
37885  __Pyx_GOTREF(__pyx_t_4);
37886  __Pyx_INCREF(__pyx_v_nn);
37887  __Pyx_GIVEREF(__pyx_v_nn);
37888  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nn);
37889  __Pyx_INCREF(__pyx_v_mm);
37890  __Pyx_GIVEREF(__pyx_v_mm);
37891  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_mm);
37892  __Pyx_INCREF(__pyx_v_kk);
37893  __Pyx_GIVEREF(__pyx_v_kk);
37894  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_kk);
37895  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDirs), __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1996, __pyx_L1_error)
37896  __Pyx_GOTREF(__pyx_t_8);
37897  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37898  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1996, __pyx_L1_error)
37899  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37900  __pyx_t_8 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1996, __pyx_L1_error)
37901  __Pyx_GOTREF(__pyx_t_8);
37902  __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_v_kk); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1996, __pyx_L1_error)
37903  __Pyx_GOTREF(__pyx_t_4);
37904  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37905  __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1996, __pyx_L1_error)
37906  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37907  (__pyx_v_self->kDir_c[__pyx_t_24]) = __pyx_t_12;
37908 
37909  /* "WaveTools.py":1997
37910  * for kk in range(3):
37911  * self.kDir_c[3*ij+kk] = self.kDirs[nn,mm,kk]
37912  * self.waveDir_c[3*ij+kk] = self.waveDirs[mm,kk] # <<<<<<<<<<<<<<
37913  *
37914  * self.kDir_ = self.kDir_c
37915  */
37916  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1997, __pyx_L1_error)
37917  __Pyx_GOTREF(__pyx_t_4);
37918  __Pyx_INCREF(__pyx_v_mm);
37919  __Pyx_GIVEREF(__pyx_v_mm);
37920  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_mm);
37921  __Pyx_INCREF(__pyx_v_kk);
37922  __Pyx_GIVEREF(__pyx_v_kk);
37923  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_kk);
37924  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDirs), __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1997, __pyx_L1_error)
37925  __Pyx_GOTREF(__pyx_t_8);
37926  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37927  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L1_error)
37928  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37929  __pyx_t_8 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1997, __pyx_L1_error)
37930  __Pyx_GOTREF(__pyx_t_8);
37931  __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_v_kk); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1997, __pyx_L1_error)
37932  __Pyx_GOTREF(__pyx_t_4);
37933  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
37934  __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L1_error)
37935  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37936  (__pyx_v_self->waveDir_c[__pyx_t_24]) = __pyx_t_12;
37937 
37938  /* "WaveTools.py":1995
37939  * self.ki_c[ij] =RW.ki[nn]
37940  * self.tanh_c[ij] = RW.tanhF[nn]
37941  * for kk in range(3): # <<<<<<<<<<<<<<
37942  * self.kDir_c[3*ij+kk] = self.kDirs[nn,mm,kk]
37943  * self.waveDir_c[3*ij+kk] = self.waveDirs[mm,kk]
37944  */
37945  }
37946  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
37947 
37948  /* "WaveTools.py":1988
37949  *
37950  * for mm in range(self.Mtot):
37951  * for nn in range(self.N): # <<<<<<<<<<<<<<
37952  * ij = mm * self.N + nn
37953  * self.ai_c[ij] = self.aiDirs[mm,nn]
37954  */
37955  }
37956  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
37957 
37958  /* "WaveTools.py":1987
37959  *
37960  *
37961  * for mm in range(self.Mtot): # <<<<<<<<<<<<<<
37962  * for nn in range(self.N):
37963  * ij = mm * self.N + nn
37964  */
37965  }
37966  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
37967 
37968  /* "WaveTools.py":1999
37969  * self.waveDir_c[3*ij+kk] = self.waveDirs[mm,kk]
37970  *
37971  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
37972  * self.omega_ = self.omega_c
37973  * self.ki_ =self.ki_c
37974  */
37975  __pyx_t_21 = __pyx_v_self->kDir_c;
37976  __pyx_v_self->kDir_ = __pyx_t_21;
37977 
37978  /* "WaveTools.py":2000
37979  *
37980  * self.kDir_ = self.kDir_c
37981  * self.omega_ = self.omega_c # <<<<<<<<<<<<<<
37982  * self.ki_ =self.ki_c
37983  * self.ai_ = self.ai_c
37984  */
37985  __pyx_t_21 = __pyx_v_self->omega_c;
37986  __pyx_v_self->omega_ = __pyx_t_21;
37987 
37988  /* "WaveTools.py":2001
37989  * self.kDir_ = self.kDir_c
37990  * self.omega_ = self.omega_c
37991  * self.ki_ =self.ki_c # <<<<<<<<<<<<<<
37992  * self.ai_ = self.ai_c
37993  * self.tanh_ = self.tanh_c
37994  */
37995  __pyx_t_21 = __pyx_v_self->ki_c;
37996  __pyx_v_self->ki_ = __pyx_t_21;
37997 
37998  /* "WaveTools.py":2002
37999  * self.omega_ = self.omega_c
38000  * self.ki_ =self.ki_c
38001  * self.ai_ = self.ai_c # <<<<<<<<<<<<<<
38002  * self.tanh_ = self.tanh_c
38003  * self.phi_ = self.phi_c
38004  */
38005  __pyx_t_21 = __pyx_v_self->ai_c;
38006  __pyx_v_self->ai_ = __pyx_t_21;
38007 
38008  /* "WaveTools.py":2003
38009  * self.ki_ =self.ki_c
38010  * self.ai_ = self.ai_c
38011  * self.tanh_ = self.tanh_c # <<<<<<<<<<<<<<
38012  * self.phi_ = self.phi_c
38013  * self.waveDir_ = self.waveDir_c
38014  */
38015  __pyx_t_21 = __pyx_v_self->tanh_c;
38016  __pyx_v_self->tanh_ = __pyx_t_21;
38017 
38018  /* "WaveTools.py":2004
38019  * self.ai_ = self.ai_c
38020  * self.tanh_ = self.tanh_c
38021  * self.phi_ = self.phi_c # <<<<<<<<<<<<<<
38022  * self.waveDir_ = self.waveDir_c
38023  *
38024  */
38025  __pyx_t_21 = __pyx_v_self->phi_c;
38026  __pyx_v_self->phi_ = __pyx_t_21;
38027 
38028  /* "WaveTools.py":2005
38029  * self.tanh_ = self.tanh_c
38030  * self.phi_ = self.phi_c
38031  * self.waveDir_ = self.waveDir_c # <<<<<<<<<<<<<<
38032  *
38033  * def _cpp_eta(self, x, t):
38034  */
38035  __pyx_t_21 = __pyx_v_self->waveDir_c;
38036  __pyx_v_self->waveDir_ = __pyx_t_21;
38037 
38038  /* "WaveTools.py":1873
38039  *
38040  * """
38041  * def __cinit__(self, # <<<<<<<<<<<<<<
38042  * M, #half bin of frequencies
38043  * Tp, # np array with
38044  */
38045 
38046  /* function exit code */
38047  __pyx_r = 0;
38048  goto __pyx_L0;
38049  __pyx_L1_error:;
38050  __Pyx_XDECREF(__pyx_t_2);
38051  __Pyx_XDECREF(__pyx_t_3);
38052  __Pyx_XDECREF(__pyx_t_4);
38053  __Pyx_XDECREF(__pyx_t_6);
38054  __Pyx_XDECREF(__pyx_t_8);
38055  __Pyx_XDECREF(__pyx_t_9);
38056  __Pyx_XDECREF(__pyx_t_10);
38057  __Pyx_XDECREF(__pyx_t_11);
38058  __Pyx_AddTraceback("WaveTools.DirectionalWaves.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38059  __pyx_r = -1;
38060  __pyx_L0:;
38061  __Pyx_XDECREF(__pyx_v_validSpread);
38062  __Pyx_XDECREF(__pyx_v_spread_fun);
38063  __Pyx_XDECREF((PyObject *)__pyx_v_RW);
38064  __Pyx_XDECREF(__pyx_v_rotation3D);
38065  __Pyx_XDECREF(__pyx_v_thetas);
38066  __Pyx_XDECREF(__pyx_v_dth);
38067  __Pyx_XDECREF(__pyx_v_temp_array);
38068  __Pyx_XDECREF(__pyx_v_directions);
38069  __Pyx_XDECREF(__pyx_v_rr);
38070  __Pyx_XDECREF(__pyx_v_theta);
38071  __Pyx_XDECREF(__pyx_v_i);
38072  __Pyx_XDECREF(__pyx_v_theta_m);
38073  __Pyx_XDECREF(__pyx_v_Si_Sp);
38074  __Pyx_XDECREF(__pyx_v_freq);
38075  __Pyx_XDECREF(__pyx_v_ii);
38076  __Pyx_XDECREF(__pyx_v_nn);
38077  __Pyx_XDECREF(__pyx_v_mm);
38078  __Pyx_XDECREF(__pyx_v_ij);
38079  __Pyx_XDECREF(__pyx_v_kk);
38080  __Pyx_RefNannyFinishContext();
38081  return __pyx_r;
38082 }
38083 
38084 /* "WaveTools.py":2007
38085  * self.waveDir_ = self.waveDir_c
38086  *
38087  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
38088  *
38089  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast)
38090  */
38091 
38092 static double __pyx_f_9WaveTools_16DirectionalWaves__cpp_eta(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
38093  double __pyx_r;
38094  __Pyx_RefNannyDeclarations
38095  __Pyx_RefNannySetupContext("_cpp_eta", 0);
38096 
38097  /* "WaveTools.py":2009
38098  * def _cpp_eta(self, x, t):
38099  *
38100  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast) # <<<<<<<<<<<<<<
38101  *
38102  * def eta(self, x, t):
38103  */
38104  __pyx_r = proteus::__cpp_etaRandom(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->Nall, __pyx_v_self->fast);
38105  goto __pyx_L0;
38106 
38107  /* "WaveTools.py":2007
38108  * self.waveDir_ = self.waveDir_c
38109  *
38110  * def _cpp_eta(self, x, t): # <<<<<<<<<<<<<<
38111  *
38112  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast)
38113  */
38114 
38115  /* function exit code */
38116  __pyx_L0:;
38117  __Pyx_RefNannyFinishContext();
38118  return __pyx_r;
38119 }
38120 
38121 /* "WaveTools.py":2011
38122  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast)
38123  *
38124  * def eta(self, x, t): # <<<<<<<<<<<<<<
38125  * """Calculates free surface elevation (RandomWaves class)
38126  * Parameters
38127  */
38128 
38129 /* Python wrapper */
38130 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
38131 static char __pyx_doc_9WaveTools_16DirectionalWaves_2eta[] = "Calculates free surface elevation (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
38132 static PyMethodDef __pyx_mdef_9WaveTools_16DirectionalWaves_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_16DirectionalWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_16DirectionalWaves_2eta};
38133 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_3eta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
38134  PyObject *__pyx_v_x = 0;
38135  PyObject *__pyx_v_t = 0;
38136  PyObject *__pyx_r = 0;
38137  __Pyx_RefNannyDeclarations
38138  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
38139  {
38140  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
38141  PyObject* values[2] = {0,0};
38142  if (unlikely(__pyx_kwds)) {
38143  Py_ssize_t kw_args;
38144  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38145  switch (pos_args) {
38146  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38147  CYTHON_FALLTHROUGH;
38148  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38149  CYTHON_FALLTHROUGH;
38150  case 0: break;
38151  default: goto __pyx_L5_argtuple_error;
38152  }
38153  kw_args = PyDict_Size(__pyx_kwds);
38154  switch (pos_args) {
38155  case 0:
38156  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
38157  else goto __pyx_L5_argtuple_error;
38158  CYTHON_FALLTHROUGH;
38159  case 1:
38160  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
38161  else {
38162  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, 1); __PYX_ERR(0, 2011, __pyx_L3_error)
38163  }
38164  }
38165  if (unlikely(kw_args > 0)) {
38166  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 2011, __pyx_L3_error)
38167  }
38168  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
38169  goto __pyx_L5_argtuple_error;
38170  } else {
38171  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38172  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38173  }
38174  __pyx_v_x = values[0];
38175  __pyx_v_t = values[1];
38176  }
38177  goto __pyx_L4_argument_unpacking_done;
38178  __pyx_L5_argtuple_error:;
38179  __Pyx_RaiseArgtupleInvalid("eta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2011, __pyx_L3_error)
38180  __pyx_L3_error:;
38181  __Pyx_AddTraceback("WaveTools.DirectionalWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
38182  __Pyx_RefNannyFinishContext();
38183  return NULL;
38184  __pyx_L4_argument_unpacking_done:;
38185  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_2eta(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
38186 
38187  /* function exit code */
38188  __Pyx_RefNannyFinishContext();
38189  return __pyx_r;
38190 }
38191 
38192 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_2eta(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
38193  double __pyx_v_xx[3];
38194  PyObject *__pyx_r = NULL;
38195  __Pyx_RefNannyDeclarations
38196  PyObject *__pyx_t_1 = NULL;
38197  double __pyx_t_2;
38198  __Pyx_RefNannySetupContext("eta", 0);
38199 
38200  /* "WaveTools.py":2027
38201  * """
38202  * cython.declare(xx=cython.double[3])
38203  * xx[0] = x[0] # <<<<<<<<<<<<<<
38204  * xx[1] = x[1]
38205  * xx[2] = x[2]
38206  */
38207  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2027, __pyx_L1_error)
38208  __Pyx_GOTREF(__pyx_t_1);
38209  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2027, __pyx_L1_error)
38210  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38211  (__pyx_v_xx[0]) = __pyx_t_2;
38212 
38213  /* "WaveTools.py":2028
38214  * cython.declare(xx=cython.double[3])
38215  * xx[0] = x[0]
38216  * xx[1] = x[1] # <<<<<<<<<<<<<<
38217  * xx[2] = x[2]
38218  * return self._cpp_eta(xx,t)
38219  */
38220  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __pyx_L1_error)
38221  __Pyx_GOTREF(__pyx_t_1);
38222  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L1_error)
38223  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38224  (__pyx_v_xx[1]) = __pyx_t_2;
38225 
38226  /* "WaveTools.py":2029
38227  * xx[0] = x[0]
38228  * xx[1] = x[1]
38229  * xx[2] = x[2] # <<<<<<<<<<<<<<
38230  * return self._cpp_eta(xx,t)
38231  *
38232  */
38233  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2029, __pyx_L1_error)
38234  __Pyx_GOTREF(__pyx_t_1);
38235  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2029, __pyx_L1_error)
38236  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38237  (__pyx_v_xx[2]) = __pyx_t_2;
38238 
38239  /* "WaveTools.py":2030
38240  * xx[1] = x[1]
38241  * xx[2] = x[2]
38242  * return self._cpp_eta(xx,t) # <<<<<<<<<<<<<<
38243  *
38244  * def _cpp_u(self,U, x, t):
38245  */
38246  __Pyx_XDECREF(__pyx_r);
38247  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2030, __pyx_L1_error)
38248  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_DirectionalWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2030, __pyx_L1_error)
38249  __Pyx_GOTREF(__pyx_t_1);
38250  __pyx_r = __pyx_t_1;
38251  __pyx_t_1 = 0;
38252  goto __pyx_L0;
38253 
38254  /* "WaveTools.py":2011
38255  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast)
38256  *
38257  * def eta(self, x, t): # <<<<<<<<<<<<<<
38258  * """Calculates free surface elevation (RandomWaves class)
38259  * Parameters
38260  */
38261 
38262  /* function exit code */
38263  __pyx_L1_error:;
38264  __Pyx_XDECREF(__pyx_t_1);
38265  __Pyx_AddTraceback("WaveTools.DirectionalWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
38266  __pyx_r = NULL;
38267  __pyx_L0:;
38268  __Pyx_XGIVEREF(__pyx_r);
38269  __Pyx_RefNannyFinishContext();
38270  return __pyx_r;
38271 }
38272 
38273 /* "WaveTools.py":2032
38274  * return self._cpp_eta(xx,t)
38275  *
38276  * def _cpp_u(self,U, x, t): # <<<<<<<<<<<<<<
38277  *
38278  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
38279  */
38280 
38281 static void __pyx_f_9WaveTools_16DirectionalWaves__cpp_u(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
38282  __Pyx_RefNannyDeclarations
38283  __Pyx_RefNannySetupContext("_cpp_u", 0);
38284 
38285  /* "WaveTools.py":2034
38286  * def _cpp_u(self,U, x, t):
38287  *
38288  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast) # <<<<<<<<<<<<<<
38289  *
38290  * def u(self, x, t):
38291  */
38292  proteus::__cpp_uDir(__pyx_v_U, __pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->Nall, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanh_, __pyx_v_self->gAbs, __pyx_v_self->fast);
38293 
38294  /* "WaveTools.py":2032
38295  * return self._cpp_eta(xx,t)
38296  *
38297  * def _cpp_u(self,U, x, t): # <<<<<<<<<<<<<<
38298  *
38299  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
38300  */
38301 
38302  /* function exit code */
38303  __Pyx_RefNannyFinishContext();
38304 }
38305 
38306 /* "WaveTools.py":2036
38307  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
38308  *
38309  * def u(self, x, t): # <<<<<<<<<<<<<<
38310  * """Calculates wave velocity vector (RandomWaves class)
38311  * Parameters
38312  */
38313 
38314 /* Python wrapper */
38315 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
38316 static char __pyx_doc_9WaveTools_16DirectionalWaves_4u[] = "Calculates wave velocity vector (RandomWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
38317 static PyMethodDef __pyx_mdef_9WaveTools_16DirectionalWaves_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_16DirectionalWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_16DirectionalWaves_4u};
38318 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_5u(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
38319  PyObject *__pyx_v_x = 0;
38320  PyObject *__pyx_v_t = 0;
38321  PyObject *__pyx_r = 0;
38322  __Pyx_RefNannyDeclarations
38323  __Pyx_RefNannySetupContext("u (wrapper)", 0);
38324  {
38325  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
38326  PyObject* values[2] = {0,0};
38327  if (unlikely(__pyx_kwds)) {
38328  Py_ssize_t kw_args;
38329  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38330  switch (pos_args) {
38331  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38332  CYTHON_FALLTHROUGH;
38333  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38334  CYTHON_FALLTHROUGH;
38335  case 0: break;
38336  default: goto __pyx_L5_argtuple_error;
38337  }
38338  kw_args = PyDict_Size(__pyx_kwds);
38339  switch (pos_args) {
38340  case 0:
38341  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
38342  else goto __pyx_L5_argtuple_error;
38343  CYTHON_FALLTHROUGH;
38344  case 1:
38345  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
38346  else {
38347  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, 1); __PYX_ERR(0, 2036, __pyx_L3_error)
38348  }
38349  }
38350  if (unlikely(kw_args > 0)) {
38351  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 2036, __pyx_L3_error)
38352  }
38353  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
38354  goto __pyx_L5_argtuple_error;
38355  } else {
38356  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38357  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38358  }
38359  __pyx_v_x = values[0];
38360  __pyx_v_t = values[1];
38361  }
38362  goto __pyx_L4_argument_unpacking_done;
38363  __pyx_L5_argtuple_error:;
38364  __Pyx_RaiseArgtupleInvalid("u", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2036, __pyx_L3_error)
38365  __pyx_L3_error:;
38366  __Pyx_AddTraceback("WaveTools.DirectionalWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
38367  __Pyx_RefNannyFinishContext();
38368  return NULL;
38369  __pyx_L4_argument_unpacking_done:;
38370  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_4u(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
38371 
38372  /* function exit code */
38373  __Pyx_RefNannyFinishContext();
38374  return __pyx_r;
38375 }
38376 
38377 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_4u(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
38378  double __pyx_v_xx[3];
38379  double __pyx_v_cppU[3];
38380  PyObject *__pyx_v_ii = NULL;
38381  PyObject *__pyx_v_U = NULL;
38382  PyObject *__pyx_r = NULL;
38383  __Pyx_RefNannyDeclarations
38384  PyObject *__pyx_t_1 = NULL;
38385  PyObject *__pyx_t_2 = NULL;
38386  PyObject *__pyx_t_3 = NULL;
38387  Py_ssize_t __pyx_t_4;
38388  PyObject *(*__pyx_t_5)(PyObject *);
38389  double __pyx_t_6;
38390  Py_ssize_t __pyx_t_7;
38391  __Pyx_RefNannySetupContext("u", 0);
38392 
38393  /* "WaveTools.py":2054
38394  * cython.declare(xx=cython.double[3])
38395  * cython.declare(cppU=cython.double[3])
38396  * for ii in range(3): # <<<<<<<<<<<<<<
38397  * xx[ii] = x[ii]
38398  * cppU[ii] = 0.
38399  */
38400  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error)
38401  __Pyx_GOTREF(__pyx_t_2);
38402  __pyx_t_3 = NULL;
38403  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
38404  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
38405  if (likely(__pyx_t_3)) {
38406  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
38407  __Pyx_INCREF(__pyx_t_3);
38408  __Pyx_INCREF(function);
38409  __Pyx_DECREF_SET(__pyx_t_2, function);
38410  }
38411  }
38412  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
38413  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
38414  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
38415  __Pyx_GOTREF(__pyx_t_1);
38416  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38417  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
38418  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
38419  __pyx_t_5 = NULL;
38420  } else {
38421  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error)
38422  __Pyx_GOTREF(__pyx_t_2);
38423  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2054, __pyx_L1_error)
38424  }
38425  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38426  for (;;) {
38427  if (likely(!__pyx_t_5)) {
38428  if (likely(PyList_CheckExact(__pyx_t_2))) {
38429  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
38430  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38431  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2054, __pyx_L1_error)
38432  #else
38433  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
38434  __Pyx_GOTREF(__pyx_t_1);
38435  #endif
38436  } else {
38437  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
38438  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
38439  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2054, __pyx_L1_error)
38440  #else
38441  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
38442  __Pyx_GOTREF(__pyx_t_1);
38443  #endif
38444  }
38445  } else {
38446  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
38447  if (unlikely(!__pyx_t_1)) {
38448  PyObject* exc_type = PyErr_Occurred();
38449  if (exc_type) {
38450  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
38451  else __PYX_ERR(0, 2054, __pyx_L1_error)
38452  }
38453  break;
38454  }
38455  __Pyx_GOTREF(__pyx_t_1);
38456  }
38457  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
38458  __pyx_t_1 = 0;
38459 
38460  /* "WaveTools.py":2055
38461  * cython.declare(cppU=cython.double[3])
38462  * for ii in range(3):
38463  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
38464  * cppU[ii] = 0.
38465  * U = np.zeros(3,)
38466  */
38467  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2055, __pyx_L1_error)
38468  __Pyx_GOTREF(__pyx_t_1);
38469  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2055, __pyx_L1_error)
38470  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38471  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2055, __pyx_L1_error)
38472  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
38473 
38474  /* "WaveTools.py":2056
38475  * for ii in range(3):
38476  * xx[ii] = x[ii]
38477  * cppU[ii] = 0. # <<<<<<<<<<<<<<
38478  * U = np.zeros(3,)
38479  * self._cpp_u(cppU,xx,t)
38480  */
38481  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2056, __pyx_L1_error)
38482  (__pyx_v_cppU[__pyx_t_7]) = 0.;
38483 
38484  /* "WaveTools.py":2054
38485  * cython.declare(xx=cython.double[3])
38486  * cython.declare(cppU=cython.double[3])
38487  * for ii in range(3): # <<<<<<<<<<<<<<
38488  * xx[ii] = x[ii]
38489  * cppU[ii] = 0.
38490  */
38491  }
38492  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38493 
38494  /* "WaveTools.py":2057
38495  * xx[ii] = x[ii]
38496  * cppU[ii] = 0.
38497  * U = np.zeros(3,) # <<<<<<<<<<<<<<
38498  * self._cpp_u(cppU,xx,t)
38499  * U[0] = cppU[0]
38500  */
38501  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2057, __pyx_L1_error)
38502  __Pyx_GOTREF(__pyx_t_1);
38503  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2057, __pyx_L1_error)
38504  __Pyx_GOTREF(__pyx_t_3);
38505  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38506  __pyx_t_1 = NULL;
38507  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
38508  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
38509  if (likely(__pyx_t_1)) {
38510  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
38511  __Pyx_INCREF(__pyx_t_1);
38512  __Pyx_INCREF(function);
38513  __Pyx_DECREF_SET(__pyx_t_3, function);
38514  }
38515  }
38516  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
38517  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
38518  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error)
38519  __Pyx_GOTREF(__pyx_t_2);
38520  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38521  __pyx_v_U = __pyx_t_2;
38522  __pyx_t_2 = 0;
38523 
38524  /* "WaveTools.py":2058
38525  * cppU[ii] = 0.
38526  * U = np.zeros(3,)
38527  * self._cpp_u(cppU,xx,t) # <<<<<<<<<<<<<<
38528  * U[0] = cppU[0]
38529  * U[1] = cppU[1]
38530  */
38531  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2058, __pyx_L1_error)
38532  ((struct __pyx_vtabstruct_9WaveTools_DirectionalWaves *)__pyx_v_self->__pyx_vtab)->_cpp_u(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
38533 
38534  /* "WaveTools.py":2059
38535  * U = np.zeros(3,)
38536  * self._cpp_u(cppU,xx,t)
38537  * U[0] = cppU[0] # <<<<<<<<<<<<<<
38538  * U[1] = cppU[1]
38539  * U[2] = cppU[2]
38540  */
38541  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2059, __pyx_L1_error)
38542  __Pyx_GOTREF(__pyx_t_2);
38543  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2059, __pyx_L1_error)
38544  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38545 
38546  /* "WaveTools.py":2060
38547  * self._cpp_u(cppU,xx,t)
38548  * U[0] = cppU[0]
38549  * U[1] = cppU[1] # <<<<<<<<<<<<<<
38550  * U[2] = cppU[2]
38551  * return U
38552  */
38553  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
38554  __Pyx_GOTREF(__pyx_t_2);
38555  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2060, __pyx_L1_error)
38556  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38557 
38558  /* "WaveTools.py":2061
38559  * U[0] = cppU[0]
38560  * U[1] = cppU[1]
38561  * U[2] = cppU[2] # <<<<<<<<<<<<<<
38562  * return U
38563  *
38564  */
38565  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2061, __pyx_L1_error)
38566  __Pyx_GOTREF(__pyx_t_2);
38567  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2061, __pyx_L1_error)
38568  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38569 
38570  /* "WaveTools.py":2062
38571  * U[1] = cppU[1]
38572  * U[2] = cppU[2]
38573  * return U # <<<<<<<<<<<<<<
38574  *
38575  *
38576  */
38577  __Pyx_XDECREF(__pyx_r);
38578  __Pyx_INCREF(__pyx_v_U);
38579  __pyx_r = __pyx_v_U;
38580  goto __pyx_L0;
38581 
38582  /* "WaveTools.py":2036
38583  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
38584  *
38585  * def u(self, x, t): # <<<<<<<<<<<<<<
38586  * """Calculates wave velocity vector (RandomWaves class)
38587  * Parameters
38588  */
38589 
38590  /* function exit code */
38591  __pyx_L1_error:;
38592  __Pyx_XDECREF(__pyx_t_1);
38593  __Pyx_XDECREF(__pyx_t_2);
38594  __Pyx_XDECREF(__pyx_t_3);
38595  __Pyx_AddTraceback("WaveTools.DirectionalWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
38596  __pyx_r = NULL;
38597  __pyx_L0:;
38598  __Pyx_XDECREF(__pyx_v_ii);
38599  __Pyx_XDECREF(__pyx_v_U);
38600  __Pyx_XGIVEREF(__pyx_r);
38601  __Pyx_RefNannyFinishContext();
38602  return __pyx_r;
38603 }
38604 
38605 /* "WaveTools.pxd":180
38606  * cdef double[100000] phi_c
38607  * cdef public:
38608  * double mwl,depth # <<<<<<<<<<<<<<
38609  * cdef double _cpp_eta(self, double* x, double t)
38610  * cdef void _cpp_u(self, double* U, double* x, double t)
38611  */
38612 
38613 /* Python wrapper */
38614 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
38615 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_3mwl_1__get__(PyObject *__pyx_v_self) {
38616  PyObject *__pyx_r = 0;
38617  __Pyx_RefNannyDeclarations
38618  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
38619  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_3mwl___get__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self));
38620 
38621  /* function exit code */
38622  __Pyx_RefNannyFinishContext();
38623  return __pyx_r;
38624 }
38625 
38626 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_3mwl___get__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self) {
38627  PyObject *__pyx_r = NULL;
38628  __Pyx_RefNannyDeclarations
38629  PyObject *__pyx_t_1 = NULL;
38630  __Pyx_RefNannySetupContext("__get__", 0);
38631  __Pyx_XDECREF(__pyx_r);
38632  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 180, __pyx_L1_error)
38633  __Pyx_GOTREF(__pyx_t_1);
38634  __pyx_r = __pyx_t_1;
38635  __pyx_t_1 = 0;
38636  goto __pyx_L0;
38637 
38638  /* function exit code */
38639  __pyx_L1_error:;
38640  __Pyx_XDECREF(__pyx_t_1);
38641  __Pyx_AddTraceback("WaveTools.DirectionalWaves.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38642  __pyx_r = NULL;
38643  __pyx_L0:;
38644  __Pyx_XGIVEREF(__pyx_r);
38645  __Pyx_RefNannyFinishContext();
38646  return __pyx_r;
38647 }
38648 
38649 /* Python wrapper */
38650 static int __pyx_pw_9WaveTools_16DirectionalWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
38651 static int __pyx_pw_9WaveTools_16DirectionalWaves_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
38652  int __pyx_r;
38653  __Pyx_RefNannyDeclarations
38654  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
38655  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_3mwl_2__set__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
38656 
38657  /* function exit code */
38658  __Pyx_RefNannyFinishContext();
38659  return __pyx_r;
38660 }
38661 
38662 static int __pyx_pf_9WaveTools_16DirectionalWaves_3mwl_2__set__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_value) {
38663  int __pyx_r;
38664  __Pyx_RefNannyDeclarations
38665  double __pyx_t_1;
38666  __Pyx_RefNannySetupContext("__set__", 0);
38667  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 180, __pyx_L1_error)
38668  __pyx_v_self->mwl = __pyx_t_1;
38669 
38670  /* function exit code */
38671  __pyx_r = 0;
38672  goto __pyx_L0;
38673  __pyx_L1_error:;
38674  __Pyx_AddTraceback("WaveTools.DirectionalWaves.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38675  __pyx_r = -1;
38676  __pyx_L0:;
38677  __Pyx_RefNannyFinishContext();
38678  return __pyx_r;
38679 }
38680 
38681 /* Python wrapper */
38682 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
38683 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_5depth_1__get__(PyObject *__pyx_v_self) {
38684  PyObject *__pyx_r = 0;
38685  __Pyx_RefNannyDeclarations
38686  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
38687  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_5depth___get__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self));
38688 
38689  /* function exit code */
38690  __Pyx_RefNannyFinishContext();
38691  return __pyx_r;
38692 }
38693 
38694 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_5depth___get__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self) {
38695  PyObject *__pyx_r = NULL;
38696  __Pyx_RefNannyDeclarations
38697  PyObject *__pyx_t_1 = NULL;
38698  __Pyx_RefNannySetupContext("__get__", 0);
38699  __Pyx_XDECREF(__pyx_r);
38700  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 180, __pyx_L1_error)
38701  __Pyx_GOTREF(__pyx_t_1);
38702  __pyx_r = __pyx_t_1;
38703  __pyx_t_1 = 0;
38704  goto __pyx_L0;
38705 
38706  /* function exit code */
38707  __pyx_L1_error:;
38708  __Pyx_XDECREF(__pyx_t_1);
38709  __Pyx_AddTraceback("WaveTools.DirectionalWaves.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38710  __pyx_r = NULL;
38711  __pyx_L0:;
38712  __Pyx_XGIVEREF(__pyx_r);
38713  __Pyx_RefNannyFinishContext();
38714  return __pyx_r;
38715 }
38716 
38717 /* Python wrapper */
38718 static int __pyx_pw_9WaveTools_16DirectionalWaves_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
38719 static int __pyx_pw_9WaveTools_16DirectionalWaves_5depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
38720  int __pyx_r;
38721  __Pyx_RefNannyDeclarations
38722  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
38723  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_5depth_2__set__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
38724 
38725  /* function exit code */
38726  __Pyx_RefNannyFinishContext();
38727  return __pyx_r;
38728 }
38729 
38730 static int __pyx_pf_9WaveTools_16DirectionalWaves_5depth_2__set__(struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, PyObject *__pyx_v_value) {
38731  int __pyx_r;
38732  __Pyx_RefNannyDeclarations
38733  double __pyx_t_1;
38734  __Pyx_RefNannySetupContext("__set__", 0);
38735  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 180, __pyx_L1_error)
38736  __pyx_v_self->depth = __pyx_t_1;
38737 
38738  /* function exit code */
38739  __pyx_r = 0;
38740  goto __pyx_L0;
38741  __pyx_L1_error:;
38742  __Pyx_AddTraceback("WaveTools.DirectionalWaves.depth.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38743  __pyx_r = -1;
38744  __pyx_L0:;
38745  __Pyx_RefNannyFinishContext();
38746  return __pyx_r;
38747 }
38748 
38749 /* "(tree fragment)":1
38750  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
38751  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38752  * def __setstate_cython__(self, __pyx_state):
38753  */
38754 
38755 /* Python wrapper */
38756 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
38757 static PyMethodDef __pyx_mdef_9WaveTools_16DirectionalWaves_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_16DirectionalWaves_7__reduce_cython__, METH_NOARGS, 0};
38758 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
38759  PyObject *__pyx_r = 0;
38760  __Pyx_RefNannyDeclarations
38761  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
38762  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_6__reduce_cython__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self));
38763 
38764  /* function exit code */
38765  __Pyx_RefNannyFinishContext();
38766  return __pyx_r;
38767 }
38768 
38769 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self) {
38770  PyObject *__pyx_r = NULL;
38771  __Pyx_RefNannyDeclarations
38772  PyObject *__pyx_t_1 = NULL;
38773  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
38774 
38775  /* "(tree fragment)":2
38776  * def __reduce_cython__(self):
38777  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
38778  * def __setstate_cython__(self, __pyx_state):
38779  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38780  */
38781  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
38782  __Pyx_GOTREF(__pyx_t_1);
38783  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
38784  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38785  __PYX_ERR(1, 2, __pyx_L1_error)
38786 
38787  /* "(tree fragment)":1
38788  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
38789  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38790  * def __setstate_cython__(self, __pyx_state):
38791  */
38792 
38793  /* function exit code */
38794  __pyx_L1_error:;
38795  __Pyx_XDECREF(__pyx_t_1);
38796  __Pyx_AddTraceback("WaveTools.DirectionalWaves.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38797  __pyx_r = NULL;
38798  __Pyx_XGIVEREF(__pyx_r);
38799  __Pyx_RefNannyFinishContext();
38800  return __pyx_r;
38801 }
38802 
38803 /* "(tree fragment)":3
38804  * def __reduce_cython__(self):
38805  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38806  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
38807  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38808  */
38809 
38810 /* Python wrapper */
38811 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
38812 static PyMethodDef __pyx_mdef_9WaveTools_16DirectionalWaves_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_16DirectionalWaves_9__setstate_cython__, METH_O, 0};
38813 static PyObject *__pyx_pw_9WaveTools_16DirectionalWaves_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
38814  PyObject *__pyx_r = 0;
38815  __Pyx_RefNannyDeclarations
38816  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
38817  __pyx_r = __pyx_pf_9WaveTools_16DirectionalWaves_8__setstate_cython__(((struct __pyx_obj_9WaveTools_DirectionalWaves *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
38818 
38819  /* function exit code */
38820  __Pyx_RefNannyFinishContext();
38821  return __pyx_r;
38822 }
38823 
38824 static PyObject *__pyx_pf_9WaveTools_16DirectionalWaves_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_DirectionalWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
38825  PyObject *__pyx_r = NULL;
38826  __Pyx_RefNannyDeclarations
38827  PyObject *__pyx_t_1 = NULL;
38828  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
38829 
38830  /* "(tree fragment)":4
38831  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38832  * def __setstate_cython__(self, __pyx_state):
38833  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
38834  */
38835  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
38836  __Pyx_GOTREF(__pyx_t_1);
38837  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
38838  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38839  __PYX_ERR(1, 4, __pyx_L1_error)
38840 
38841  /* "(tree fragment)":3
38842  * def __reduce_cython__(self):
38843  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38844  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
38845  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
38846  */
38847 
38848  /* function exit code */
38849  __pyx_L1_error:;
38850  __Pyx_XDECREF(__pyx_t_1);
38851  __Pyx_AddTraceback("WaveTools.DirectionalWaves.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
38852  __pyx_r = NULL;
38853  __Pyx_XGIVEREF(__pyx_r);
38854  __Pyx_RefNannyFinishContext();
38855  return __pyx_r;
38856 }
38857 
38858 /* "WaveTools.py":2109
38859  *
38860  * """
38861  * def __init__(self, # <<<<<<<<<<<<<<
38862  * timeSeriesFile, # e.g.= "Timeseries.txt",
38863  * skiprows,
38864  */
38865 
38866 /* Python wrapper */
38867 static int __pyx_pw_9WaveTools_10TimeSeries_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
38868 static int __pyx_pw_9WaveTools_10TimeSeries_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
38869  PyObject *__pyx_v_timeSeriesFile = 0;
38870  PyObject *__pyx_v_skiprows = 0;
38871  PyObject *__pyx_v_timeSeriesPosition = 0;
38872  PyObject *__pyx_v_depth = 0;
38873  PyObject *__pyx_v_N = 0;
38874  PyObject *__pyx_v_mwl = 0;
38875  PyObject *__pyx_v_waveDir = 0;
38876  PyObject *__pyx_v_g = 0;
38877  PyObject *__pyx_v_cutoffTotal = 0;
38878  PyObject *__pyx_v_rec_direct = 0;
38879  PyObject *__pyx_v_window_params = 0;
38880  PyObject *__pyx_v_arrayData = 0;
38881  PyObject *__pyx_v_seriesArray = 0;
38882  PyObject *__pyx_v_Lgen = 0;
38883  PyObject *__pyx_v_fast = 0;
38884  int __pyx_r;
38885  __Pyx_RefNannyDeclarations
38886  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
38887  {
38888  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeSeriesFile,&__pyx_n_s_skiprows,&__pyx_n_s_timeSeriesPosition,&__pyx_n_s_depth,&__pyx_n_s_N,&__pyx_n_s_mwl,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_cutoffTotal,&__pyx_n_s_rec_direct,&__pyx_n_s_window_params,&__pyx_n_s_arrayData,&__pyx_n_s_seriesArray,&__pyx_n_s_Lgen,&__pyx_n_s_fast,0};
38889  PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
38890  values[8] = ((PyObject *)__pyx_float_0_01);
38891 
38892  /* "WaveTools.py":2119
38893  * g,
38894  * cutoffTotal = 0.01,
38895  * rec_direct = True, # <<<<<<<<<<<<<<
38896  * window_params = None, #If rec_direct = False then wind_params = {"Nwaves":Nwaves,"Tm":Tm,"Window":wind_filt,"Overlap":overlap,"Cutoff":cutoff}
38897  * arrayData = False,
38898  */
38899  values[9] = ((PyObject *)Py_True);
38900 
38901  /* "WaveTools.py":2120
38902  * cutoffTotal = 0.01,
38903  * rec_direct = True,
38904  * window_params = None, #If rec_direct = False then wind_params = {"Nwaves":Nwaves,"Tm":Tm,"Window":wind_filt,"Overlap":overlap,"Cutoff":cutoff} # <<<<<<<<<<<<<<
38905  * arrayData = False,
38906  * seriesArray = None,
38907  */
38908  values[10] = ((PyObject *)Py_None);
38909 
38910  /* "WaveTools.py":2121
38911  * rec_direct = True,
38912  * window_params = None, #If rec_direct = False then wind_params = {"Nwaves":Nwaves,"Tm":Tm,"Window":wind_filt,"Overlap":overlap,"Cutoff":cutoff}
38913  * arrayData = False, # <<<<<<<<<<<<<<
38914  * seriesArray = None,
38915  * Lgen = np.array([0.,0.,0]),
38916  */
38917  values[11] = ((PyObject *)Py_False);
38918 
38919  /* "WaveTools.py":2122
38920  * window_params = None, #If rec_direct = False then wind_params = {"Nwaves":Nwaves,"Tm":Tm,"Window":wind_filt,"Overlap":overlap,"Cutoff":cutoff}
38921  * arrayData = False,
38922  * seriesArray = None, # <<<<<<<<<<<<<<
38923  * Lgen = np.array([0.,0.,0]),
38924  * fast = True
38925  */
38926  values[12] = ((PyObject *)Py_None);
38927  values[13] = __pyx_k__40;
38928 
38929  /* "WaveTools.py":2124
38930  * seriesArray = None,
38931  * Lgen = np.array([0.,0.,0]),
38932  * fast = True # <<<<<<<<<<<<<<
38933  * ):
38934  * self.fast = fast
38935  */
38936  values[14] = ((PyObject *)Py_True);
38937  if (unlikely(__pyx_kwds)) {
38938  Py_ssize_t kw_args;
38939  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
38940  switch (pos_args) {
38941  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
38942  CYTHON_FALLTHROUGH;
38943  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
38944  CYTHON_FALLTHROUGH;
38945  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
38946  CYTHON_FALLTHROUGH;
38947  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
38948  CYTHON_FALLTHROUGH;
38949  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
38950  CYTHON_FALLTHROUGH;
38951  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
38952  CYTHON_FALLTHROUGH;
38953  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
38954  CYTHON_FALLTHROUGH;
38955  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
38956  CYTHON_FALLTHROUGH;
38957  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
38958  CYTHON_FALLTHROUGH;
38959  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
38960  CYTHON_FALLTHROUGH;
38961  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
38962  CYTHON_FALLTHROUGH;
38963  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
38964  CYTHON_FALLTHROUGH;
38965  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
38966  CYTHON_FALLTHROUGH;
38967  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38968  CYTHON_FALLTHROUGH;
38969  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38970  CYTHON_FALLTHROUGH;
38971  case 0: break;
38972  default: goto __pyx_L5_argtuple_error;
38973  }
38974  kw_args = PyDict_Size(__pyx_kwds);
38975  switch (pos_args) {
38976  case 0:
38977  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeSeriesFile)) != 0)) kw_args--;
38978  else goto __pyx_L5_argtuple_error;
38979  CYTHON_FALLTHROUGH;
38980  case 1:
38981  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_skiprows)) != 0)) kw_args--;
38982  else {
38983  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 1); __PYX_ERR(0, 2109, __pyx_L3_error)
38984  }
38985  CYTHON_FALLTHROUGH;
38986  case 2:
38987  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timeSeriesPosition)) != 0)) kw_args--;
38988  else {
38989  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 2); __PYX_ERR(0, 2109, __pyx_L3_error)
38990  }
38991  CYTHON_FALLTHROUGH;
38992  case 3:
38993  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
38994  else {
38995  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 3); __PYX_ERR(0, 2109, __pyx_L3_error)
38996  }
38997  CYTHON_FALLTHROUGH;
38998  case 4:
38999  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
39000  else {
39001  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 4); __PYX_ERR(0, 2109, __pyx_L3_error)
39002  }
39003  CYTHON_FALLTHROUGH;
39004  case 5:
39005  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
39006  else {
39007  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 5); __PYX_ERR(0, 2109, __pyx_L3_error)
39008  }
39009  CYTHON_FALLTHROUGH;
39010  case 6:
39011  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
39012  else {
39013  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 6); __PYX_ERR(0, 2109, __pyx_L3_error)
39014  }
39015  CYTHON_FALLTHROUGH;
39016  case 7:
39017  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
39018  else {
39019  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, 7); __PYX_ERR(0, 2109, __pyx_L3_error)
39020  }
39021  CYTHON_FALLTHROUGH;
39022  case 8:
39023  if (kw_args > 0) {
39024  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoffTotal);
39025  if (value) { values[8] = value; kw_args--; }
39026  }
39027  CYTHON_FALLTHROUGH;
39028  case 9:
39029  if (kw_args > 0) {
39030  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rec_direct);
39031  if (value) { values[9] = value; kw_args--; }
39032  }
39033  CYTHON_FALLTHROUGH;
39034  case 10:
39035  if (kw_args > 0) {
39036  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_window_params);
39037  if (value) { values[10] = value; kw_args--; }
39038  }
39039  CYTHON_FALLTHROUGH;
39040  case 11:
39041  if (kw_args > 0) {
39042  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arrayData);
39043  if (value) { values[11] = value; kw_args--; }
39044  }
39045  CYTHON_FALLTHROUGH;
39046  case 12:
39047  if (kw_args > 0) {
39048  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seriesArray);
39049  if (value) { values[12] = value; kw_args--; }
39050  }
39051  CYTHON_FALLTHROUGH;
39052  case 13:
39053  if (kw_args > 0) {
39054  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Lgen);
39055  if (value) { values[13] = value; kw_args--; }
39056  }
39057  CYTHON_FALLTHROUGH;
39058  case 14:
39059  if (kw_args > 0) {
39060  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
39061  if (value) { values[14] = value; kw_args--; }
39062  }
39063  }
39064  if (unlikely(kw_args > 0)) {
39065  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2109, __pyx_L3_error)
39066  }
39067  } else {
39068  switch (PyTuple_GET_SIZE(__pyx_args)) {
39069  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
39070  CYTHON_FALLTHROUGH;
39071  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
39072  CYTHON_FALLTHROUGH;
39073  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
39074  CYTHON_FALLTHROUGH;
39075  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
39076  CYTHON_FALLTHROUGH;
39077  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
39078  CYTHON_FALLTHROUGH;
39079  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
39080  CYTHON_FALLTHROUGH;
39081  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
39082  CYTHON_FALLTHROUGH;
39083  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
39084  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
39085  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
39086  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
39087  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
39088  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
39089  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
39090  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
39091  break;
39092  default: goto __pyx_L5_argtuple_error;
39093  }
39094  }
39095  __pyx_v_timeSeriesFile = values[0];
39096  __pyx_v_skiprows = values[1];
39097  __pyx_v_timeSeriesPosition = values[2];
39098  __pyx_v_depth = values[3];
39099  __pyx_v_N = values[4];
39100  __pyx_v_mwl = values[5];
39101  __pyx_v_waveDir = values[6];
39102  __pyx_v_g = values[7];
39103  __pyx_v_cutoffTotal = values[8];
39104  __pyx_v_rec_direct = values[9];
39105  __pyx_v_window_params = values[10];
39106  __pyx_v_arrayData = values[11];
39107  __pyx_v_seriesArray = values[12];
39108  __pyx_v_Lgen = values[13];
39109  __pyx_v_fast = values[14];
39110  }
39111  goto __pyx_L4_argument_unpacking_done;
39112  __pyx_L5_argtuple_error:;
39113  __Pyx_RaiseArgtupleInvalid("__init__", 0, 8, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2109, __pyx_L3_error)
39114  __pyx_L3_error:;
39115  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
39116  __Pyx_RefNannyFinishContext();
39117  return -1;
39118  __pyx_L4_argument_unpacking_done:;
39119  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries___init__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), __pyx_v_timeSeriesFile, __pyx_v_skiprows, __pyx_v_timeSeriesPosition, __pyx_v_depth, __pyx_v_N, __pyx_v_mwl, __pyx_v_waveDir, __pyx_v_g, __pyx_v_cutoffTotal, __pyx_v_rec_direct, __pyx_v_window_params, __pyx_v_arrayData, __pyx_v_seriesArray, __pyx_v_Lgen, __pyx_v_fast);
39120 
39121  /* "WaveTools.py":2109
39122  *
39123  * """
39124  * def __init__(self, # <<<<<<<<<<<<<<
39125  * timeSeriesFile, # e.g.= "Timeseries.txt",
39126  * skiprows,
39127  */
39128 
39129  /* function exit code */
39130  __Pyx_RefNannyFinishContext();
39131  return __pyx_r;
39132 }
39133 
39134 static int __pyx_pf_9WaveTools_10TimeSeries___init__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_timeSeriesFile, PyObject *__pyx_v_skiprows, PyObject *__pyx_v_timeSeriesPosition, PyObject *__pyx_v_depth, PyObject *__pyx_v_N, PyObject *__pyx_v_mwl, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_cutoffTotal, PyObject *__pyx_v_rec_direct, PyObject *__pyx_v_window_params, PyObject *__pyx_v_arrayData, PyObject *__pyx_v_seriesArray, PyObject *__pyx_v_Lgen, PyObject *__pyx_v_fast) {
39135  CYTHON_UNUSED PyObject *__pyx_v_Nwaves = NULL;
39136  PyObject *__pyx_v_tdata = NULL;
39137  PyObject *__pyx_v_filetype = NULL;
39138  PyObject *__pyx_v_fid = NULL;
39139  Py_ssize_t __pyx_v_ncols;
39140  PyObject *__pyx_v_time_temp = NULL;
39141  int __pyx_v_doInterp;
39142  PyObject *__pyx_v_i = NULL;
39143  PyObject *__pyx_v_dt_temp = NULL;
39144  PyObject *__pyx_v_Nf = NULL;
39145  Py_ssize_t __pyx_v_nfft;
39146  PyObject *__pyx_v_decomp = NULL;
39147  PyObject *__pyx_v_ipeak = NULL;
39148  PyObject *__pyx_v_imax = NULL;
39149  PyObject *__pyx_v_imin = NULL;
39150  PyObject *__pyx_v_ii = NULL;
39151  PyObject *__pyx_v_ij = NULL;
39152  PyObject *__pyx_v_kk = NULL;
39153  PyObject *__pyx_v_windowName = NULL;
39154  PyObject *__pyx_v_validWindows = NULL;
39155  PyObject *__pyx_v_wind_filt = NULL;
39156  double __pyx_v_diff;
39157  PyObject *__pyx_v_jj = NULL;
39158  PyObject *__pyx_v_span = NULL;
39159  PyObject *__pyx_v_tfirst = NULL;
39160  PyObject *__pyx_v_tlast = NULL;
39161  PyObject *__pyx_v_ispan1 = NULL;
39162  PyObject *__pyx_v_ispan2 = NULL;
39163  PyObject *__pyx_v_tstart = NULL;
39164  PyObject *__pyx_v_wind = NULL;
39165  PyObject *__pyx_v_Nftemp = NULL;
39166  PyObject *__pyx_v_ki = NULL;
39167  PyObject *__pyx_v_kDir = NULL;
39168  PyObject *__pyx_v_Tlag = NULL;
39169  int __pyx_r;
39170  __Pyx_RefNannyDeclarations
39171  bool __pyx_t_1;
39172  double __pyx_t_2;
39173  int __pyx_t_3;
39174  PyObject *__pyx_t_4 = NULL;
39175  PyObject *__pyx_t_5 = NULL;
39176  PyObject *__pyx_t_6 = NULL;
39177  PyObject *__pyx_t_7 = NULL;
39178  Py_ssize_t __pyx_t_8;
39179  int __pyx_t_9;
39180  int __pyx_t_10;
39181  PyObject *__pyx_t_11 = NULL;
39182  PyObject *__pyx_t_12 = NULL;
39183  PyObject *(*__pyx_t_13)(PyObject *);
39184  PyObject *__pyx_t_14 = NULL;
39185  long __pyx_t_15;
39186  Py_ssize_t __pyx_t_16;
39187  PyObject *(*__pyx_t_17)(PyObject *);
39188  Py_ssize_t __pyx_t_18;
39189  double *__pyx_t_19;
39190  PyObject *__pyx_t_20 = NULL;
39191  PyObject *__pyx_t_21 = NULL;
39192  PyObject *__pyx_t_22 = NULL;
39193  PyObject *__pyx_t_23 = NULL;
39194  int __pyx_t_24;
39195  PyObject *__pyx_t_25 = NULL;
39196  PyObject *__pyx_t_26 = NULL;
39197  PyObject *(*__pyx_t_27)(PyObject *);
39198  Py_ssize_t __pyx_t_28;
39199  double (*__pyx_t_29)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double);
39200  void (*__pyx_t_30)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double);
39201  double (*__pyx_t_31)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double);
39202  void (*__pyx_t_32)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double);
39203  __Pyx_RefNannySetupContext("__init__", 0);
39204 
39205  /* "WaveTools.py":2126
39206  * fast = True
39207  * ):
39208  * self.fast = fast # <<<<<<<<<<<<<<
39209  * self.rec_direct = rec_direct
39210  * # Setting the depth
39211  */
39212  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2126, __pyx_L1_error)
39213  __pyx_v_self->fast = __pyx_t_1;
39214 
39215  /* "WaveTools.py":2127
39216  * ):
39217  * self.fast = fast
39218  * self.rec_direct = rec_direct # <<<<<<<<<<<<<<
39219  * # Setting the depth
39220  * self.depth = depth
39221  */
39222  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_rec_direct); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2127, __pyx_L1_error)
39223  __pyx_v_self->rec_direct = __pyx_t_1;
39224 
39225  /* "WaveTools.py":2129
39226  * self.rec_direct = rec_direct
39227  * # Setting the depth
39228  * self.depth = depth # <<<<<<<<<<<<<<
39229  * # Number of wave components
39230  * self.N = N
39231  */
39232  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2129, __pyx_L1_error)
39233  __pyx_v_self->depth = __pyx_t_2;
39234 
39235  /* "WaveTools.py":2131
39236  * self.depth = depth
39237  * # Number of wave components
39238  * self.N = N # <<<<<<<<<<<<<<
39239  * self.tanhF = np.zeros(N,"d")
39240  * Nwaves = None
39241  */
39242  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2131, __pyx_L1_error)
39243  __pyx_v_self->N = __pyx_t_3;
39244 
39245  /* "WaveTools.py":2132
39246  * # Number of wave components
39247  * self.N = N
39248  * self.tanhF = np.zeros(N,"d") # <<<<<<<<<<<<<<
39249  * Nwaves = None
39250  * # Position of timeSeriesFile
39251  */
39252  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2132, __pyx_L1_error)
39253  __Pyx_GOTREF(__pyx_t_5);
39254  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2132, __pyx_L1_error)
39255  __Pyx_GOTREF(__pyx_t_6);
39256  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39257  __pyx_t_5 = NULL;
39258  __pyx_t_3 = 0;
39259  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
39260  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
39261  if (likely(__pyx_t_5)) {
39262  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
39263  __Pyx_INCREF(__pyx_t_5);
39264  __Pyx_INCREF(function);
39265  __Pyx_DECREF_SET(__pyx_t_6, function);
39266  __pyx_t_3 = 1;
39267  }
39268  }
39269  #if CYTHON_FAST_PYCALL
39270  if (PyFunction_Check(__pyx_t_6)) {
39271  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_N, __pyx_n_s_d};
39272  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2132, __pyx_L1_error)
39273  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
39274  __Pyx_GOTREF(__pyx_t_4);
39275  } else
39276  #endif
39277  #if CYTHON_FAST_PYCCALL
39278  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
39279  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_N, __pyx_n_s_d};
39280  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2132, __pyx_L1_error)
39281  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
39282  __Pyx_GOTREF(__pyx_t_4);
39283  } else
39284  #endif
39285  {
39286  __pyx_t_7 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2132, __pyx_L1_error)
39287  __Pyx_GOTREF(__pyx_t_7);
39288  if (__pyx_t_5) {
39289  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
39290  }
39291  __Pyx_INCREF(__pyx_v_N);
39292  __Pyx_GIVEREF(__pyx_v_N);
39293  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_3, __pyx_v_N);
39294  __Pyx_INCREF(__pyx_n_s_d);
39295  __Pyx_GIVEREF(__pyx_n_s_d);
39296  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_3, __pyx_n_s_d);
39297  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2132, __pyx_L1_error)
39298  __Pyx_GOTREF(__pyx_t_4);
39299  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39300  }
39301  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39302  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2132, __pyx_L1_error)
39303  __Pyx_GIVEREF(__pyx_t_4);
39304  __Pyx_GOTREF(__pyx_v_self->tanhF);
39305  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhF));
39306  __pyx_v_self->tanhF = ((PyArrayObject *)__pyx_t_4);
39307  __pyx_t_4 = 0;
39308 
39309  /* "WaveTools.py":2133
39310  * self.N = N
39311  * self.tanhF = np.zeros(N,"d")
39312  * Nwaves = None # <<<<<<<<<<<<<<
39313  * # Position of timeSeriesFile
39314  * if(len(timeSeriesPosition)==3):
39315  */
39316  __Pyx_INCREF(Py_None);
39317  __pyx_v_Nwaves = Py_None;
39318 
39319  /* "WaveTools.py":2135
39320  * Nwaves = None
39321  * # Position of timeSeriesFile
39322  * if(len(timeSeriesPosition)==3): # <<<<<<<<<<<<<<
39323  * self.x0 = timeSeriesPosition
39324  * else:
39325  */
39326  __pyx_t_8 = PyObject_Length(__pyx_v_timeSeriesPosition); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2135, __pyx_L1_error)
39327  __pyx_t_9 = ((__pyx_t_8 == 3) != 0);
39328  if (__pyx_t_9) {
39329 
39330  /* "WaveTools.py":2136
39331  * # Position of timeSeriesFile
39332  * if(len(timeSeriesPosition)==3):
39333  * self.x0 = timeSeriesPosition # <<<<<<<<<<<<<<
39334  * else:
39335  * logEvent("ERROR! Wavetools.py: Location vector for timeSeries must have three-components",level=0)
39336  */
39337  if (!(likely(((__pyx_v_timeSeriesPosition) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_timeSeriesPosition, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2136, __pyx_L1_error)
39338  __pyx_t_4 = __pyx_v_timeSeriesPosition;
39339  __Pyx_INCREF(__pyx_t_4);
39340  __Pyx_GIVEREF(__pyx_t_4);
39341  __Pyx_GOTREF(__pyx_v_self->x0);
39342  __Pyx_DECREF(((PyObject *)__pyx_v_self->x0));
39343  __pyx_v_self->x0 = ((PyArrayObject *)__pyx_t_4);
39344  __pyx_t_4 = 0;
39345 
39346  /* "WaveTools.py":2135
39347  * Nwaves = None
39348  * # Position of timeSeriesFile
39349  * if(len(timeSeriesPosition)==3): # <<<<<<<<<<<<<<
39350  * self.x0 = timeSeriesPosition
39351  * else:
39352  */
39353  goto __pyx_L3;
39354  }
39355 
39356  /* "WaveTools.py":2138
39357  * self.x0 = timeSeriesPosition
39358  * else:
39359  * logEvent("ERROR! Wavetools.py: Location vector for timeSeries must have three-components",level=0) # <<<<<<<<<<<<<<
39360  * sys.exit(1)
39361  *
39362  */
39363  /*else*/ {
39364  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2138, __pyx_L1_error)
39365  __Pyx_GOTREF(__pyx_t_4);
39366  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2138, __pyx_L1_error)
39367  __Pyx_GOTREF(__pyx_t_6);
39368  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 2138, __pyx_L1_error)
39369  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__41, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2138, __pyx_L1_error)
39370  __Pyx_GOTREF(__pyx_t_7);
39371  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39372  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39373  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39374 
39375  /* "WaveTools.py":2139
39376  * else:
39377  * logEvent("ERROR! Wavetools.py: Location vector for timeSeries must have three-components",level=0)
39378  * sys.exit(1) # <<<<<<<<<<<<<<
39379  *
39380  *
39381  */
39382  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2139, __pyx_L1_error)
39383  __Pyx_GOTREF(__pyx_t_6);
39384  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2139, __pyx_L1_error)
39385  __Pyx_GOTREF(__pyx_t_4);
39386  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39387  __pyx_t_6 = NULL;
39388  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
39389  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
39390  if (likely(__pyx_t_6)) {
39391  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
39392  __Pyx_INCREF(__pyx_t_6);
39393  __Pyx_INCREF(function);
39394  __Pyx_DECREF_SET(__pyx_t_4, function);
39395  }
39396  }
39397  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_int_1);
39398  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
39399  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2139, __pyx_L1_error)
39400  __Pyx_GOTREF(__pyx_t_7);
39401  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39402  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39403  }
39404  __pyx_L3:;
39405 
39406  /* "WaveTools.py":2143
39407  *
39408  * # Mean water level
39409  * self.mwl = mwl # <<<<<<<<<<<<<<
39410  * # Wave direction
39411  * self.waveDir = setDirVector(waveDir)
39412  */
39413  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_mwl); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2143, __pyx_L1_error)
39414  __pyx_v_self->mwl = __pyx_t_2;
39415 
39416  /* "WaveTools.py":2145
39417  * self.mwl = mwl
39418  * # Wave direction
39419  * self.waveDir = setDirVector(waveDir) # <<<<<<<<<<<<<<
39420  * # Gravity
39421  * self.g = np.array(g)
39422  */
39423  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_setDirVector); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2145, __pyx_L1_error)
39424  __Pyx_GOTREF(__pyx_t_4);
39425  __pyx_t_6 = NULL;
39426  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
39427  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
39428  if (likely(__pyx_t_6)) {
39429  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
39430  __Pyx_INCREF(__pyx_t_6);
39431  __Pyx_INCREF(function);
39432  __Pyx_DECREF_SET(__pyx_t_4, function);
39433  }
39434  }
39435  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_waveDir) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_waveDir);
39436  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
39437  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2145, __pyx_L1_error)
39438  __Pyx_GOTREF(__pyx_t_7);
39439  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39440  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2145, __pyx_L1_error)
39441  __Pyx_GIVEREF(__pyx_t_7);
39442  __Pyx_GOTREF(__pyx_v_self->waveDir);
39443  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
39444  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_7);
39445  __pyx_t_7 = 0;
39446 
39447  /* "WaveTools.py":2147
39448  * self.waveDir = setDirVector(waveDir)
39449  * # Gravity
39450  * self.g = np.array(g) # <<<<<<<<<<<<<<
39451  * # Derived variables
39452  * # Gravity magnitude
39453  */
39454  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2147, __pyx_L1_error)
39455  __Pyx_GOTREF(__pyx_t_4);
39456  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2147, __pyx_L1_error)
39457  __Pyx_GOTREF(__pyx_t_6);
39458  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39459  __pyx_t_4 = NULL;
39460  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
39461  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
39462  if (likely(__pyx_t_4)) {
39463  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
39464  __Pyx_INCREF(__pyx_t_4);
39465  __Pyx_INCREF(function);
39466  __Pyx_DECREF_SET(__pyx_t_6, function);
39467  }
39468  }
39469  __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_g);
39470  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39471  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2147, __pyx_L1_error)
39472  __Pyx_GOTREF(__pyx_t_7);
39473  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39474  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2147, __pyx_L1_error)
39475  __Pyx_GIVEREF(__pyx_t_7);
39476  __Pyx_GOTREF(__pyx_v_self->g);
39477  __Pyx_DECREF(((PyObject *)__pyx_v_self->g));
39478  __pyx_v_self->g = ((PyArrayObject *)__pyx_t_7);
39479  __pyx_t_7 = 0;
39480 
39481  /* "WaveTools.py":2150
39482  * # Derived variables
39483  * # Gravity magnitude
39484  * self.gAbs = sqrt(sum(g * g)) # <<<<<<<<<<<<<<
39485  * # Definition of gravity direction
39486  * self.vDir = setVertDir(g)
39487  */
39488  __pyx_t_7 = PyNumber_Multiply(__pyx_v_g, __pyx_v_g); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2150, __pyx_L1_error)
39489  __Pyx_GOTREF(__pyx_t_7);
39490  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2150, __pyx_L1_error)
39491  __Pyx_GOTREF(__pyx_t_6);
39492  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39493  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2150, __pyx_L1_error)
39494  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39495  __pyx_v_self->gAbs = sqrt(__pyx_t_2);
39496 
39497  /* "WaveTools.py":2152
39498  * self.gAbs = sqrt(sum(g * g))
39499  * # Definition of gravity direction
39500  * self.vDir = setVertDir(g) # <<<<<<<<<<<<<<
39501  * dirCheck(self.waveDir,self.vDir)
39502  * #Reading time series
39503  */
39504  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_setVertDir); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2152, __pyx_L1_error)
39505  __Pyx_GOTREF(__pyx_t_7);
39506  __pyx_t_4 = NULL;
39507  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
39508  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
39509  if (likely(__pyx_t_4)) {
39510  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
39511  __Pyx_INCREF(__pyx_t_4);
39512  __Pyx_INCREF(function);
39513  __Pyx_DECREF_SET(__pyx_t_7, function);
39514  }
39515  }
39516  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_g) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_g);
39517  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39518  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2152, __pyx_L1_error)
39519  __Pyx_GOTREF(__pyx_t_6);
39520  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39521  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2152, __pyx_L1_error)
39522  __Pyx_GIVEREF(__pyx_t_6);
39523  __Pyx_GOTREF(__pyx_v_self->vDir);
39524  __Pyx_DECREF(((PyObject *)__pyx_v_self->vDir));
39525  __pyx_v_self->vDir = ((PyArrayObject *)__pyx_t_6);
39526  __pyx_t_6 = 0;
39527 
39528  /* "WaveTools.py":2153
39529  * # Definition of gravity direction
39530  * self.vDir = setVertDir(g)
39531  * dirCheck(self.waveDir,self.vDir) # <<<<<<<<<<<<<<
39532  * #Reading time series
39533  *
39534  */
39535  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_dirCheck); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2153, __pyx_L1_error)
39536  __Pyx_GOTREF(__pyx_t_7);
39537  __pyx_t_4 = NULL;
39538  __pyx_t_3 = 0;
39539  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
39540  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
39541  if (likely(__pyx_t_4)) {
39542  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
39543  __Pyx_INCREF(__pyx_t_4);
39544  __Pyx_INCREF(function);
39545  __Pyx_DECREF_SET(__pyx_t_7, function);
39546  __pyx_t_3 = 1;
39547  }
39548  }
39549  #if CYTHON_FAST_PYCALL
39550  if (PyFunction_Check(__pyx_t_7)) {
39551  PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
39552  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2153, __pyx_L1_error)
39553  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39554  __Pyx_GOTREF(__pyx_t_6);
39555  } else
39556  #endif
39557  #if CYTHON_FAST_PYCCALL
39558  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
39559  PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self->waveDir), ((PyObject *)__pyx_v_self->vDir)};
39560  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2153, __pyx_L1_error)
39561  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39562  __Pyx_GOTREF(__pyx_t_6);
39563  } else
39564  #endif
39565  {
39566  __pyx_t_5 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2153, __pyx_L1_error)
39567  __Pyx_GOTREF(__pyx_t_5);
39568  if (__pyx_t_4) {
39569  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
39570  }
39571  __Pyx_INCREF(((PyObject *)__pyx_v_self->waveDir));
39572  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->waveDir));
39573  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_3, ((PyObject *)__pyx_v_self->waveDir));
39574  __Pyx_INCREF(((PyObject *)__pyx_v_self->vDir));
39575  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->vDir));
39576  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_3, ((PyObject *)__pyx_v_self->vDir));
39577  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2153, __pyx_L1_error)
39578  __Pyx_GOTREF(__pyx_t_6);
39579  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39580  }
39581  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39582  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39583 
39584  /* "WaveTools.py":2157
39585  *
39586  *
39587  * if(arrayData): # <<<<<<<<<<<<<<
39588  * tdata = seriesArray
39589  * else:
39590  */
39591  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_arrayData); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2157, __pyx_L1_error)
39592  if (__pyx_t_9) {
39593 
39594  /* "WaveTools.py":2158
39595  *
39596  * if(arrayData):
39597  * tdata = seriesArray # <<<<<<<<<<<<<<
39598  * else:
39599  * filetype = timeSeriesFile[-4:]
39600  */
39601  __Pyx_INCREF(__pyx_v_seriesArray);
39602  __pyx_v_tdata = __pyx_v_seriesArray;
39603 
39604  /* "WaveTools.py":2157
39605  *
39606  *
39607  * if(arrayData): # <<<<<<<<<<<<<<
39608  * tdata = seriesArray
39609  * else:
39610  */
39611  goto __pyx_L4;
39612  }
39613 
39614  /* "WaveTools.py":2160
39615  * tdata = seriesArray
39616  * else:
39617  * filetype = timeSeriesFile[-4:] # <<<<<<<<<<<<<<
39618  * fid = open(timeSeriesFile,"r")
39619  * if (filetype !=".txt") and (filetype != ".csv"):
39620  */
39621  /*else*/ {
39622  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_timeSeriesFile, -4L, 0, NULL, NULL, &__pyx_slice__42, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2160, __pyx_L1_error)
39623  __Pyx_GOTREF(__pyx_t_6);
39624  __pyx_v_filetype = __pyx_t_6;
39625  __pyx_t_6 = 0;
39626 
39627  /* "WaveTools.py":2161
39628  * else:
39629  * filetype = timeSeriesFile[-4:]
39630  * fid = open(timeSeriesFile,"r") # <<<<<<<<<<<<<<
39631  * if (filetype !=".txt") and (filetype != ".csv"):
39632  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0)
39633  */
39634  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2161, __pyx_L1_error)
39635  __Pyx_GOTREF(__pyx_t_6);
39636  __Pyx_INCREF(__pyx_v_timeSeriesFile);
39637  __Pyx_GIVEREF(__pyx_v_timeSeriesFile);
39638  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_timeSeriesFile);
39639  __Pyx_INCREF(__pyx_n_s_r);
39640  __Pyx_GIVEREF(__pyx_n_s_r);
39641  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_r);
39642  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2161, __pyx_L1_error)
39643  __Pyx_GOTREF(__pyx_t_7);
39644  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39645  __pyx_v_fid = __pyx_t_7;
39646  __pyx_t_7 = 0;
39647 
39648  /* "WaveTools.py":2162
39649  * filetype = timeSeriesFile[-4:]
39650  * fid = open(timeSeriesFile,"r")
39651  * if (filetype !=".txt") and (filetype != ".csv"): # <<<<<<<<<<<<<<
39652  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0)
39653  * sys.exit(1)
39654  */
39655  __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_filetype, __pyx_kp_s_txt, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2162, __pyx_L1_error)
39656  if (__pyx_t_10) {
39657  } else {
39658  __pyx_t_9 = __pyx_t_10;
39659  goto __pyx_L6_bool_binop_done;
39660  }
39661  __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_v_filetype, __pyx_kp_s_csv, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2162, __pyx_L1_error)
39662  __pyx_t_9 = __pyx_t_10;
39663  __pyx_L6_bool_binop_done:;
39664  if (__pyx_t_9) {
39665 
39666  /* "WaveTools.py":2163
39667  * fid = open(timeSeriesFile,"r")
39668  * if (filetype !=".txt") and (filetype != ".csv"):
39669  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0) # <<<<<<<<<<<<<<
39670  * sys.exit(1)
39671  * elif (filetype == ".csv"):
39672  */
39673  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2163, __pyx_L1_error)
39674  __Pyx_GOTREF(__pyx_t_7);
39675  __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ERROR_Wavetools_py_File_s_must_b, __pyx_v_timeSeriesFile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2163, __pyx_L1_error)
39676  __Pyx_GOTREF(__pyx_t_6);
39677  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2163, __pyx_L1_error)
39678  __Pyx_GOTREF(__pyx_t_5);
39679  __Pyx_GIVEREF(__pyx_t_6);
39680  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
39681  __pyx_t_6 = 0;
39682  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2163, __pyx_L1_error)
39683  __Pyx_GOTREF(__pyx_t_6);
39684  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 2163, __pyx_L1_error)
39685  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2163, __pyx_L1_error)
39686  __Pyx_GOTREF(__pyx_t_4);
39687  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39688  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39689  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39690  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39691 
39692  /* "WaveTools.py":2164
39693  * if (filetype !=".txt") and (filetype != ".csv"):
39694  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0)
39695  * sys.exit(1) # <<<<<<<<<<<<<<
39696  * elif (filetype == ".csv"):
39697  * tdata = np.loadtxt(fid,skiprows=skiprows,delimiter=",")
39698  */
39699  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2164, __pyx_L1_error)
39700  __Pyx_GOTREF(__pyx_t_6);
39701  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2164, __pyx_L1_error)
39702  __Pyx_GOTREF(__pyx_t_5);
39703  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39704  __pyx_t_6 = NULL;
39705  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
39706  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
39707  if (likely(__pyx_t_6)) {
39708  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
39709  __Pyx_INCREF(__pyx_t_6);
39710  __Pyx_INCREF(function);
39711  __Pyx_DECREF_SET(__pyx_t_5, function);
39712  }
39713  }
39714  __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_1);
39715  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
39716  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2164, __pyx_L1_error)
39717  __Pyx_GOTREF(__pyx_t_4);
39718  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39719  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39720 
39721  /* "WaveTools.py":2162
39722  * filetype = timeSeriesFile[-4:]
39723  * fid = open(timeSeriesFile,"r")
39724  * if (filetype !=".txt") and (filetype != ".csv"): # <<<<<<<<<<<<<<
39725  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0)
39726  * sys.exit(1)
39727  */
39728  goto __pyx_L5;
39729  }
39730 
39731  /* "WaveTools.py":2165
39732  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0)
39733  * sys.exit(1)
39734  * elif (filetype == ".csv"): # <<<<<<<<<<<<<<
39735  * tdata = np.loadtxt(fid,skiprows=skiprows,delimiter=",")
39736  * else:
39737  */
39738  __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_v_filetype, __pyx_kp_s_csv, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2165, __pyx_L1_error)
39739  if (__pyx_t_9) {
39740 
39741  /* "WaveTools.py":2166
39742  * sys.exit(1)
39743  * elif (filetype == ".csv"):
39744  * tdata = np.loadtxt(fid,skiprows=skiprows,delimiter=",") # <<<<<<<<<<<<<<
39745  * else:
39746  * tdata = np.loadtxt(fid,skiprows=skiprows)
39747  */
39748  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2166, __pyx_L1_error)
39749  __Pyx_GOTREF(__pyx_t_4);
39750  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_loadtxt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2166, __pyx_L1_error)
39751  __Pyx_GOTREF(__pyx_t_5);
39752  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39753  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2166, __pyx_L1_error)
39754  __Pyx_GOTREF(__pyx_t_4);
39755  __Pyx_INCREF(__pyx_v_fid);
39756  __Pyx_GIVEREF(__pyx_v_fid);
39757  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fid);
39758  __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2166, __pyx_L1_error)
39759  __Pyx_GOTREF(__pyx_t_6);
39760  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_skiprows, __pyx_v_skiprows) < 0) __PYX_ERR(0, 2166, __pyx_L1_error)
39761  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_delimiter, __pyx_kp_s__43) < 0) __PYX_ERR(0, 2166, __pyx_L1_error)
39762  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2166, __pyx_L1_error)
39763  __Pyx_GOTREF(__pyx_t_7);
39764  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39765  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39766  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39767  __pyx_v_tdata = __pyx_t_7;
39768  __pyx_t_7 = 0;
39769 
39770  /* "WaveTools.py":2165
39771  * logEvent("ERROR! Wavetools.py: File %s must be given in .txt or .csv format" % (timeSeriesFile),level=0)
39772  * sys.exit(1)
39773  * elif (filetype == ".csv"): # <<<<<<<<<<<<<<
39774  * tdata = np.loadtxt(fid,skiprows=skiprows,delimiter=",")
39775  * else:
39776  */
39777  goto __pyx_L5;
39778  }
39779 
39780  /* "WaveTools.py":2168
39781  * tdata = np.loadtxt(fid,skiprows=skiprows,delimiter=",")
39782  * else:
39783  * tdata = np.loadtxt(fid,skiprows=skiprows) # <<<<<<<<<<<<<<
39784  * fid.close()
39785  * #Checks for tseries file
39786  */
39787  /*else*/ {
39788  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2168, __pyx_L1_error)
39789  __Pyx_GOTREF(__pyx_t_7);
39790  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_loadtxt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2168, __pyx_L1_error)
39791  __Pyx_GOTREF(__pyx_t_6);
39792  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39793  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2168, __pyx_L1_error)
39794  __Pyx_GOTREF(__pyx_t_7);
39795  __Pyx_INCREF(__pyx_v_fid);
39796  __Pyx_GIVEREF(__pyx_v_fid);
39797  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_fid);
39798  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2168, __pyx_L1_error)
39799  __Pyx_GOTREF(__pyx_t_4);
39800  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_skiprows, __pyx_v_skiprows) < 0) __PYX_ERR(0, 2168, __pyx_L1_error)
39801  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2168, __pyx_L1_error)
39802  __Pyx_GOTREF(__pyx_t_5);
39803  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39804  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39805  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39806  __pyx_v_tdata = __pyx_t_5;
39807  __pyx_t_5 = 0;
39808  }
39809  __pyx_L5:;
39810 
39811  /* "WaveTools.py":2169
39812  * else:
39813  * tdata = np.loadtxt(fid,skiprows=skiprows)
39814  * fid.close() # <<<<<<<<<<<<<<
39815  * #Checks for tseries file
39816  * # Only 2 columns: time & eta
39817  */
39818  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_fid, __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2169, __pyx_L1_error)
39819  __Pyx_GOTREF(__pyx_t_4);
39820  __pyx_t_7 = NULL;
39821  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
39822  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
39823  if (likely(__pyx_t_7)) {
39824  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
39825  __Pyx_INCREF(__pyx_t_7);
39826  __Pyx_INCREF(function);
39827  __Pyx_DECREF_SET(__pyx_t_4, function);
39828  }
39829  }
39830  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
39831  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
39832  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2169, __pyx_L1_error)
39833  __Pyx_GOTREF(__pyx_t_5);
39834  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39835  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39836  }
39837  __pyx_L4:;
39838 
39839  /* "WaveTools.py":2172
39840  * #Checks for tseries file
39841  * # Only 2 columns: time & eta
39842  * ncols = len(tdata[0,:]) # <<<<<<<<<<<<<<
39843  * if ncols != 2:
39844  * logEvent("ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]" % (timeSeriesFile),level=0)
39845  */
39846  if (unlikely(!__pyx_v_tdata)) { __Pyx_RaiseUnboundLocalError("tdata"); __PYX_ERR(0, 2172, __pyx_L1_error) }
39847  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_tdata, __pyx_tuple__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2172, __pyx_L1_error)
39848  __Pyx_GOTREF(__pyx_t_5);
39849  __pyx_t_8 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2172, __pyx_L1_error)
39850  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39851  __pyx_v_ncols = __pyx_t_8;
39852 
39853  /* "WaveTools.py":2173
39854  * # Only 2 columns: time & eta
39855  * ncols = len(tdata[0,:])
39856  * if ncols != 2: # <<<<<<<<<<<<<<
39857  * logEvent("ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]" % (timeSeriesFile),level=0)
39858  * sys.exit(1)
39859  */
39860  __pyx_t_9 = ((__pyx_v_ncols != 2) != 0);
39861  if (__pyx_t_9) {
39862 
39863  /* "WaveTools.py":2174
39864  * ncols = len(tdata[0,:])
39865  * if ncols != 2:
39866  * logEvent("ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]" % (timeSeriesFile),level=0) # <<<<<<<<<<<<<<
39867  * sys.exit(1)
39868  * time_temp = tdata[:,0]
39869  */
39870  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2174, __pyx_L1_error)
39871  __Pyx_GOTREF(__pyx_t_5);
39872  __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ERROR_Wavetools_py_Timeseries_fi, __pyx_v_timeSeriesFile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2174, __pyx_L1_error)
39873  __Pyx_GOTREF(__pyx_t_4);
39874  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2174, __pyx_L1_error)
39875  __Pyx_GOTREF(__pyx_t_7);
39876  __Pyx_GIVEREF(__pyx_t_4);
39877  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
39878  __pyx_t_4 = 0;
39879  __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2174, __pyx_L1_error)
39880  __Pyx_GOTREF(__pyx_t_4);
39881  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 2174, __pyx_L1_error)
39882  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2174, __pyx_L1_error)
39883  __Pyx_GOTREF(__pyx_t_6);
39884  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39885  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39886  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39887  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39888 
39889  /* "WaveTools.py":2175
39890  * if ncols != 2:
39891  * logEvent("ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]" % (timeSeriesFile),level=0)
39892  * sys.exit(1) # <<<<<<<<<<<<<<
39893  * time_temp = tdata[:,0]
39894  * self.dt = old_div((time_temp[-1]-time_temp[0]),(len(time_temp)-1))
39895  */
39896  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2175, __pyx_L1_error)
39897  __Pyx_GOTREF(__pyx_t_4);
39898  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2175, __pyx_L1_error)
39899  __Pyx_GOTREF(__pyx_t_7);
39900  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39901  __pyx_t_4 = NULL;
39902  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
39903  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
39904  if (likely(__pyx_t_4)) {
39905  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
39906  __Pyx_INCREF(__pyx_t_4);
39907  __Pyx_INCREF(function);
39908  __Pyx_DECREF_SET(__pyx_t_7, function);
39909  }
39910  }
39911  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_int_1);
39912  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39913  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2175, __pyx_L1_error)
39914  __Pyx_GOTREF(__pyx_t_6);
39915  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
39916  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
39917 
39918  /* "WaveTools.py":2173
39919  * # Only 2 columns: time & eta
39920  * ncols = len(tdata[0,:])
39921  * if ncols != 2: # <<<<<<<<<<<<<<
39922  * logEvent("ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]" % (timeSeriesFile),level=0)
39923  * sys.exit(1)
39924  */
39925  }
39926 
39927  /* "WaveTools.py":2176
39928  * logEvent("ERROR! Wavetools.py: Timeseries file (%s) must have only two columns [time, eta]" % (timeSeriesFile),level=0)
39929  * sys.exit(1)
39930  * time_temp = tdata[:,0] # <<<<<<<<<<<<<<
39931  * self.dt = old_div((time_temp[-1]-time_temp[0]),(len(time_temp)-1))
39932  *
39933  */
39934  if (unlikely(!__pyx_v_tdata)) { __Pyx_RaiseUnboundLocalError("tdata"); __PYX_ERR(0, 2176, __pyx_L1_error) }
39935  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_tdata, __pyx_tuple__25); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2176, __pyx_L1_error)
39936  __Pyx_GOTREF(__pyx_t_6);
39937  __pyx_v_time_temp = __pyx_t_6;
39938  __pyx_t_6 = 0;
39939 
39940  /* "WaveTools.py":2177
39941  * sys.exit(1)
39942  * time_temp = tdata[:,0]
39943  * self.dt = old_div((time_temp[-1]-time_temp[0]),(len(time_temp)-1)) # <<<<<<<<<<<<<<
39944  *
39945  *
39946  */
39947  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_old_div); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2177, __pyx_L1_error)
39948  __Pyx_GOTREF(__pyx_t_7);
39949  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_time_temp, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2177, __pyx_L1_error)
39950  __Pyx_GOTREF(__pyx_t_4);
39951  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_time_temp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2177, __pyx_L1_error)
39952  __Pyx_GOTREF(__pyx_t_5);
39953  __pyx_t_11 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2177, __pyx_L1_error)
39954  __Pyx_GOTREF(__pyx_t_11);
39955  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
39956  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39957  __pyx_t_8 = PyObject_Length(__pyx_v_time_temp); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2177, __pyx_L1_error)
39958  __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_8 - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2177, __pyx_L1_error)
39959  __Pyx_GOTREF(__pyx_t_5);
39960  __pyx_t_4 = NULL;
39961  __pyx_t_3 = 0;
39962  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
39963  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
39964  if (likely(__pyx_t_4)) {
39965  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
39966  __Pyx_INCREF(__pyx_t_4);
39967  __Pyx_INCREF(function);
39968  __Pyx_DECREF_SET(__pyx_t_7, function);
39969  __pyx_t_3 = 1;
39970  }
39971  }
39972  #if CYTHON_FAST_PYCALL
39973  if (PyFunction_Check(__pyx_t_7)) {
39974  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_11, __pyx_t_5};
39975  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2177, __pyx_L1_error)
39976  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39977  __Pyx_GOTREF(__pyx_t_6);
39978  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
39979  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39980  } else
39981  #endif
39982  #if CYTHON_FAST_PYCCALL
39983  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
39984  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_11, __pyx_t_5};
39985  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2177, __pyx_L1_error)
39986  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
39987  __Pyx_GOTREF(__pyx_t_6);
39988  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
39989  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
39990  } else
39991  #endif
39992  {
39993  __pyx_t_12 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2177, __pyx_L1_error)
39994  __Pyx_GOTREF(__pyx_t_12);
39995  if (__pyx_t_4) {
39996  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __pyx_t_4 = NULL;
39997  }
39998  __Pyx_GIVEREF(__pyx_t_11);
39999  PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_3, __pyx_t_11);
40000  __Pyx_GIVEREF(__pyx_t_5);
40001  PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_3, __pyx_t_5);
40002  __pyx_t_11 = 0;
40003  __pyx_t_5 = 0;
40004  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2177, __pyx_L1_error)
40005  __Pyx_GOTREF(__pyx_t_6);
40006  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40007  }
40008  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40009  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L1_error)
40010  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40011  __pyx_v_self->dt = __pyx_t_2;
40012 
40013  /* "WaveTools.py":2182
40014  *
40015  * # If necessary, perform interpolation
40016  * doInterp = False # <<<<<<<<<<<<<<
40017  * for i in range(1,len(time_temp)):
40018  * dt_temp = time_temp[i]-time_temp[i-1]
40019  */
40020  __pyx_v_doInterp = 0;
40021 
40022  /* "WaveTools.py":2183
40023  * # If necessary, perform interpolation
40024  * doInterp = False
40025  * for i in range(1,len(time_temp)): # <<<<<<<<<<<<<<
40026  * dt_temp = time_temp[i]-time_temp[i-1]
40027  * #check if time is at first column
40028  */
40029  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2183, __pyx_L1_error)
40030  __Pyx_GOTREF(__pyx_t_7);
40031  __pyx_t_8 = PyObject_Length(__pyx_v_time_temp); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2183, __pyx_L1_error)
40032  __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2183, __pyx_L1_error)
40033  __Pyx_GOTREF(__pyx_t_12);
40034  __pyx_t_5 = NULL;
40035  __pyx_t_3 = 0;
40036  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
40037  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
40038  if (likely(__pyx_t_5)) {
40039  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
40040  __Pyx_INCREF(__pyx_t_5);
40041  __Pyx_INCREF(function);
40042  __Pyx_DECREF_SET(__pyx_t_7, function);
40043  __pyx_t_3 = 1;
40044  }
40045  }
40046  #if CYTHON_FAST_PYCALL
40047  if (PyFunction_Check(__pyx_t_7)) {
40048  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_1, __pyx_t_12};
40049  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
40050  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
40051  __Pyx_GOTREF(__pyx_t_6);
40052  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40053  } else
40054  #endif
40055  #if CYTHON_FAST_PYCCALL
40056  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
40057  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_int_1, __pyx_t_12};
40058  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
40059  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
40060  __Pyx_GOTREF(__pyx_t_6);
40061  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40062  } else
40063  #endif
40064  {
40065  __pyx_t_11 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2183, __pyx_L1_error)
40066  __Pyx_GOTREF(__pyx_t_11);
40067  if (__pyx_t_5) {
40068  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
40069  }
40070  __Pyx_INCREF(__pyx_int_1);
40071  __Pyx_GIVEREF(__pyx_int_1);
40072  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_3, __pyx_int_1);
40073  __Pyx_GIVEREF(__pyx_t_12);
40074  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_3, __pyx_t_12);
40075  __pyx_t_12 = 0;
40076  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
40077  __Pyx_GOTREF(__pyx_t_6);
40078  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40079  }
40080  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40081  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
40082  __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
40083  __pyx_t_13 = NULL;
40084  } else {
40085  __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2183, __pyx_L1_error)
40086  __Pyx_GOTREF(__pyx_t_7);
40087  __pyx_t_13 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2183, __pyx_L1_error)
40088  }
40089  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40090  for (;;) {
40091  if (likely(!__pyx_t_13)) {
40092  if (likely(PyList_CheckExact(__pyx_t_7))) {
40093  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
40094  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
40095  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2183, __pyx_L1_error)
40096  #else
40097  __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
40098  __Pyx_GOTREF(__pyx_t_6);
40099  #endif
40100  } else {
40101  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
40102  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
40103  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2183, __pyx_L1_error)
40104  #else
40105  __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
40106  __Pyx_GOTREF(__pyx_t_6);
40107  #endif
40108  }
40109  } else {
40110  __pyx_t_6 = __pyx_t_13(__pyx_t_7);
40111  if (unlikely(!__pyx_t_6)) {
40112  PyObject* exc_type = PyErr_Occurred();
40113  if (exc_type) {
40114  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
40115  else __PYX_ERR(0, 2183, __pyx_L1_error)
40116  }
40117  break;
40118  }
40119  __Pyx_GOTREF(__pyx_t_6);
40120  }
40121  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6);
40122  __pyx_t_6 = 0;
40123 
40124  /* "WaveTools.py":2184
40125  * doInterp = False
40126  * for i in range(1,len(time_temp)):
40127  * dt_temp = time_temp[i]-time_temp[i-1] # <<<<<<<<<<<<<<
40128  * #check if time is at first column
40129  * if time_temp[i]<=time_temp[i-1]:
40130  */
40131  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_time_temp, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2184, __pyx_L1_error)
40132  __Pyx_GOTREF(__pyx_t_6);
40133  __pyx_t_11 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2184, __pyx_L1_error)
40134  __Pyx_GOTREF(__pyx_t_11);
40135  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_time_temp, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2184, __pyx_L1_error)
40136  __Pyx_GOTREF(__pyx_t_12);
40137  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40138  __pyx_t_11 = PyNumber_Subtract(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2184, __pyx_L1_error)
40139  __Pyx_GOTREF(__pyx_t_11);
40140  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40141  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40142  __Pyx_XDECREF_SET(__pyx_v_dt_temp, __pyx_t_11);
40143  __pyx_t_11 = 0;
40144 
40145  /* "WaveTools.py":2186
40146  * dt_temp = time_temp[i]-time_temp[i-1]
40147  * #check if time is at first column
40148  * if time_temp[i]<=time_temp[i-1]: # <<<<<<<<<<<<<<
40149  * logEvent("ERROR! WaveTools.py: Found not consistent time entry between %s and %s row in %s file. Time variable must be always at the first column of the file and increasing monotonically" %(i-1,i,timeSeriesFile) )
40150  * sys.exit(1)
40151  */
40152  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_time_temp, __pyx_v_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2186, __pyx_L1_error)
40153  __Pyx_GOTREF(__pyx_t_11);
40154  __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L1_error)
40155  __Pyx_GOTREF(__pyx_t_12);
40156  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_time_temp, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2186, __pyx_L1_error)
40157  __Pyx_GOTREF(__pyx_t_6);
40158  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40159  __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2186, __pyx_L1_error)
40160  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40161  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40162  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2186, __pyx_L1_error)
40163  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40164  if (__pyx_t_9) {
40165 
40166  /* "WaveTools.py":2187
40167  * #check if time is at first column
40168  * if time_temp[i]<=time_temp[i-1]:
40169  * logEvent("ERROR! WaveTools.py: Found not consistent time entry between %s and %s row in %s file. Time variable must be always at the first column of the file and increasing monotonically" %(i-1,i,timeSeriesFile) ) # <<<<<<<<<<<<<<
40170  * sys.exit(1)
40171  * #check if sampling rate is constant
40172  */
40173  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2187, __pyx_L1_error)
40174  __Pyx_GOTREF(__pyx_t_6);
40175  __pyx_t_11 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2187, __pyx_L1_error)
40176  __Pyx_GOTREF(__pyx_t_11);
40177  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2187, __pyx_L1_error)
40178  __Pyx_GOTREF(__pyx_t_5);
40179  __Pyx_GIVEREF(__pyx_t_11);
40180  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11);
40181  __Pyx_INCREF(__pyx_v_i);
40182  __Pyx_GIVEREF(__pyx_v_i);
40183  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_i);
40184  __Pyx_INCREF(__pyx_v_timeSeriesFile);
40185  __Pyx_GIVEREF(__pyx_v_timeSeriesFile);
40186  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_timeSeriesFile);
40187  __pyx_t_11 = 0;
40188  __pyx_t_11 = __Pyx_PyString_Format(__pyx_kp_s_ERROR_WaveTools_py_Found_not_con, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2187, __pyx_L1_error)
40189  __Pyx_GOTREF(__pyx_t_11);
40190  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40191  __pyx_t_5 = NULL;
40192  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
40193  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
40194  if (likely(__pyx_t_5)) {
40195  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
40196  __Pyx_INCREF(__pyx_t_5);
40197  __Pyx_INCREF(function);
40198  __Pyx_DECREF_SET(__pyx_t_6, function);
40199  }
40200  }
40201  __pyx_t_12 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_11);
40202  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
40203  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40204  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2187, __pyx_L1_error)
40205  __Pyx_GOTREF(__pyx_t_12);
40206  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40207  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40208 
40209  /* "WaveTools.py":2188
40210  * if time_temp[i]<=time_temp[i-1]:
40211  * logEvent("ERROR! WaveTools.py: Found not consistent time entry between %s and %s row in %s file. Time variable must be always at the first column of the file and increasing monotonically" %(i-1,i,timeSeriesFile) )
40212  * sys.exit(1) # <<<<<<<<<<<<<<
40213  * #check if sampling rate is constant
40214  * if dt_temp!=self.dt:
40215  */
40216  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2188, __pyx_L1_error)
40217  __Pyx_GOTREF(__pyx_t_6);
40218  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2188, __pyx_L1_error)
40219  __Pyx_GOTREF(__pyx_t_11);
40220  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40221  __pyx_t_6 = NULL;
40222  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
40223  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
40224  if (likely(__pyx_t_6)) {
40225  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
40226  __Pyx_INCREF(__pyx_t_6);
40227  __Pyx_INCREF(function);
40228  __Pyx_DECREF_SET(__pyx_t_11, function);
40229  }
40230  }
40231  __pyx_t_12 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_int_1);
40232  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
40233  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2188, __pyx_L1_error)
40234  __Pyx_GOTREF(__pyx_t_12);
40235  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40236  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40237 
40238  /* "WaveTools.py":2186
40239  * dt_temp = time_temp[i]-time_temp[i-1]
40240  * #check if time is at first column
40241  * if time_temp[i]<=time_temp[i-1]: # <<<<<<<<<<<<<<
40242  * logEvent("ERROR! WaveTools.py: Found not consistent time entry between %s and %s row in %s file. Time variable must be always at the first column of the file and increasing monotonically" %(i-1,i,timeSeriesFile) )
40243  * sys.exit(1)
40244  */
40245  }
40246 
40247  /* "WaveTools.py":2190
40248  * sys.exit(1)
40249  * #check if sampling rate is constant
40250  * if dt_temp!=self.dt: # <<<<<<<<<<<<<<
40251  * doInterp = True
40252  * if(doInterp):
40253  */
40254  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->dt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2190, __pyx_L1_error)
40255  __Pyx_GOTREF(__pyx_t_12);
40256  __pyx_t_11 = PyObject_RichCompare(__pyx_v_dt_temp, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2190, __pyx_L1_error)
40257  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40258  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2190, __pyx_L1_error)
40259  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40260  if (__pyx_t_9) {
40261 
40262  /* "WaveTools.py":2191
40263  * #check if sampling rate is constant
40264  * if dt_temp!=self.dt:
40265  * doInterp = True # <<<<<<<<<<<<<<
40266  * if(doInterp):
40267  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0)
40268  */
40269  __pyx_v_doInterp = 1;
40270 
40271  /* "WaveTools.py":2190
40272  * sys.exit(1)
40273  * #check if sampling rate is constant
40274  * if dt_temp!=self.dt: # <<<<<<<<<<<<<<
40275  * doInterp = True
40276  * if(doInterp):
40277  */
40278  }
40279 
40280  /* "WaveTools.py":2183
40281  * # If necessary, perform interpolation
40282  * doInterp = False
40283  * for i in range(1,len(time_temp)): # <<<<<<<<<<<<<<
40284  * dt_temp = time_temp[i]-time_temp[i-1]
40285  * #check if time is at first column
40286  */
40287  }
40288  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40289 
40290  /* "WaveTools.py":2192
40291  * if dt_temp!=self.dt:
40292  * doInterp = True
40293  * if(doInterp): # <<<<<<<<<<<<<<
40294  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0)
40295  * self.time = np.linspace(time_temp[0],time_temp[-1],len(time_temp))
40296  */
40297  __pyx_t_9 = (__pyx_v_doInterp != 0);
40298  if (__pyx_t_9) {
40299 
40300  /* "WaveTools.py":2193
40301  * doInterp = True
40302  * if(doInterp):
40303  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0) # <<<<<<<<<<<<<<
40304  * self.time = np.linspace(time_temp[0],time_temp[-1],len(time_temp))
40305  * self.etaS = np.interp(self.time,time_temp,tdata[:,1])
40306  */
40307  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2193, __pyx_L1_error)
40308  __Pyx_GOTREF(__pyx_t_7);
40309  __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2193, __pyx_L1_error)
40310  __Pyx_GOTREF(__pyx_t_11);
40311  if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 2193, __pyx_L1_error)
40312  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__44, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2193, __pyx_L1_error)
40313  __Pyx_GOTREF(__pyx_t_12);
40314  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40315  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40316  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40317 
40318  /* "WaveTools.py":2194
40319  * if(doInterp):
40320  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0)
40321  * self.time = np.linspace(time_temp[0],time_temp[-1],len(time_temp)) # <<<<<<<<<<<<<<
40322  * self.etaS = np.interp(self.time,time_temp,tdata[:,1])
40323  * else:
40324  */
40325  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2194, __pyx_L1_error)
40326  __Pyx_GOTREF(__pyx_t_11);
40327  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_linspace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2194, __pyx_L1_error)
40328  __Pyx_GOTREF(__pyx_t_7);
40329  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40330  __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_time_temp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2194, __pyx_L1_error)
40331  __Pyx_GOTREF(__pyx_t_11);
40332  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_time_temp, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2194, __pyx_L1_error)
40333  __Pyx_GOTREF(__pyx_t_6);
40334  __pyx_t_8 = PyObject_Length(__pyx_v_time_temp); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2194, __pyx_L1_error)
40335  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2194, __pyx_L1_error)
40336  __Pyx_GOTREF(__pyx_t_5);
40337  __pyx_t_4 = NULL;
40338  __pyx_t_3 = 0;
40339  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
40340  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
40341  if (likely(__pyx_t_4)) {
40342  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
40343  __Pyx_INCREF(__pyx_t_4);
40344  __Pyx_INCREF(function);
40345  __Pyx_DECREF_SET(__pyx_t_7, function);
40346  __pyx_t_3 = 1;
40347  }
40348  }
40349  #if CYTHON_FAST_PYCALL
40350  if (PyFunction_Check(__pyx_t_7)) {
40351  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_11, __pyx_t_6, __pyx_t_5};
40352  __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2194, __pyx_L1_error)
40353  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
40354  __Pyx_GOTREF(__pyx_t_12);
40355  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40356  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40357  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40358  } else
40359  #endif
40360  #if CYTHON_FAST_PYCCALL
40361  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
40362  PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_11, __pyx_t_6, __pyx_t_5};
40363  __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2194, __pyx_L1_error)
40364  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
40365  __Pyx_GOTREF(__pyx_t_12);
40366  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
40367  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40368  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40369  } else
40370  #endif
40371  {
40372  __pyx_t_14 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2194, __pyx_L1_error)
40373  __Pyx_GOTREF(__pyx_t_14);
40374  if (__pyx_t_4) {
40375  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL;
40376  }
40377  __Pyx_GIVEREF(__pyx_t_11);
40378  PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_3, __pyx_t_11);
40379  __Pyx_GIVEREF(__pyx_t_6);
40380  PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_3, __pyx_t_6);
40381  __Pyx_GIVEREF(__pyx_t_5);
40382  PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_3, __pyx_t_5);
40383  __pyx_t_11 = 0;
40384  __pyx_t_6 = 0;
40385  __pyx_t_5 = 0;
40386  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2194, __pyx_L1_error)
40387  __Pyx_GOTREF(__pyx_t_12);
40388  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40389  }
40390  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40391  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2194, __pyx_L1_error)
40392  __Pyx_GIVEREF(__pyx_t_12);
40393  __Pyx_GOTREF(__pyx_v_self->time);
40394  __Pyx_DECREF(((PyObject *)__pyx_v_self->time));
40395  __pyx_v_self->time = ((PyArrayObject *)__pyx_t_12);
40396  __pyx_t_12 = 0;
40397 
40398  /* "WaveTools.py":2195
40399  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0)
40400  * self.time = np.linspace(time_temp[0],time_temp[-1],len(time_temp))
40401  * self.etaS = np.interp(self.time,time_temp,tdata[:,1]) # <<<<<<<<<<<<<<
40402  * else:
40403  * self.time = time_temp
40404  */
40405  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2195, __pyx_L1_error)
40406  __Pyx_GOTREF(__pyx_t_7);
40407  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_interp); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2195, __pyx_L1_error)
40408  __Pyx_GOTREF(__pyx_t_14);
40409  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40410  if (unlikely(!__pyx_v_tdata)) { __Pyx_RaiseUnboundLocalError("tdata"); __PYX_ERR(0, 2195, __pyx_L1_error) }
40411  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_tdata, __pyx_tuple__26); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2195, __pyx_L1_error)
40412  __Pyx_GOTREF(__pyx_t_7);
40413  __pyx_t_5 = NULL;
40414  __pyx_t_3 = 0;
40415  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
40416  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_14);
40417  if (likely(__pyx_t_5)) {
40418  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
40419  __Pyx_INCREF(__pyx_t_5);
40420  __Pyx_INCREF(function);
40421  __Pyx_DECREF_SET(__pyx_t_14, function);
40422  __pyx_t_3 = 1;
40423  }
40424  }
40425  #if CYTHON_FAST_PYCALL
40426  if (PyFunction_Check(__pyx_t_14)) {
40427  PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self->time), __pyx_v_time_temp, __pyx_t_7};
40428  __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2195, __pyx_L1_error)
40429  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
40430  __Pyx_GOTREF(__pyx_t_12);
40431  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40432  } else
40433  #endif
40434  #if CYTHON_FAST_PYCCALL
40435  if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
40436  PyObject *__pyx_temp[4] = {__pyx_t_5, ((PyObject *)__pyx_v_self->time), __pyx_v_time_temp, __pyx_t_7};
40437  __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2195, __pyx_L1_error)
40438  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
40439  __Pyx_GOTREF(__pyx_t_12);
40440  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40441  } else
40442  #endif
40443  {
40444  __pyx_t_6 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2195, __pyx_L1_error)
40445  __Pyx_GOTREF(__pyx_t_6);
40446  if (__pyx_t_5) {
40447  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
40448  }
40449  __Pyx_INCREF(((PyObject *)__pyx_v_self->time));
40450  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->time));
40451  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, ((PyObject *)__pyx_v_self->time));
40452  __Pyx_INCREF(__pyx_v_time_temp);
40453  __Pyx_GIVEREF(__pyx_v_time_temp);
40454  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_v_time_temp);
40455  __Pyx_GIVEREF(__pyx_t_7);
40456  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_3, __pyx_t_7);
40457  __pyx_t_7 = 0;
40458  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2195, __pyx_L1_error)
40459  __Pyx_GOTREF(__pyx_t_12);
40460  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40461  }
40462  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40463  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2195, __pyx_L1_error)
40464  __Pyx_GIVEREF(__pyx_t_12);
40465  __Pyx_GOTREF(__pyx_v_self->etaS);
40466  __Pyx_DECREF(((PyObject *)__pyx_v_self->etaS));
40467  __pyx_v_self->etaS = ((PyArrayObject *)__pyx_t_12);
40468  __pyx_t_12 = 0;
40469 
40470  /* "WaveTools.py":2192
40471  * if dt_temp!=self.dt:
40472  * doInterp = True
40473  * if(doInterp): # <<<<<<<<<<<<<<
40474  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0)
40475  * self.time = np.linspace(time_temp[0],time_temp[-1],len(time_temp))
40476  */
40477  goto __pyx_L13;
40478  }
40479 
40480  /* "WaveTools.py":2197
40481  * self.etaS = np.interp(self.time,time_temp,tdata[:,1])
40482  * else:
40483  * self.time = time_temp # <<<<<<<<<<<<<<
40484  * self.etaS = tdata[:,1]
40485  *
40486  */
40487  /*else*/ {
40488  if (!(likely(((__pyx_v_time_temp) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_time_temp, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2197, __pyx_L1_error)
40489  __pyx_t_12 = __pyx_v_time_temp;
40490  __Pyx_INCREF(__pyx_t_12);
40491  __Pyx_GIVEREF(__pyx_t_12);
40492  __Pyx_GOTREF(__pyx_v_self->time);
40493  __Pyx_DECREF(((PyObject *)__pyx_v_self->time));
40494  __pyx_v_self->time = ((PyArrayObject *)__pyx_t_12);
40495  __pyx_t_12 = 0;
40496 
40497  /* "WaveTools.py":2198
40498  * else:
40499  * self.time = time_temp
40500  * self.etaS = tdata[:,1] # <<<<<<<<<<<<<<
40501  *
40502  * self.t0 = self.time[0]
40503  */
40504  if (unlikely(!__pyx_v_tdata)) { __Pyx_RaiseUnboundLocalError("tdata"); __PYX_ERR(0, 2198, __pyx_L1_error) }
40505  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_tdata, __pyx_tuple__26); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2198, __pyx_L1_error)
40506  __Pyx_GOTREF(__pyx_t_12);
40507  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2198, __pyx_L1_error)
40508  __Pyx_GIVEREF(__pyx_t_12);
40509  __Pyx_GOTREF(__pyx_v_self->etaS);
40510  __Pyx_DECREF(((PyObject *)__pyx_v_self->etaS));
40511  __pyx_v_self->etaS = ((PyArrayObject *)__pyx_t_12);
40512  __pyx_t_12 = 0;
40513  }
40514  __pyx_L13:;
40515 
40516  /* "WaveTools.py":2200
40517  * self.etaS = tdata[:,1]
40518  *
40519  * self.t0 = self.time[0] # <<<<<<<<<<<<<<
40520  * # Remove mean level from raw data
40521  * self.etaS -= np.mean(self.etaS)
40522  */
40523  __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->time), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2200, __pyx_L1_error)
40524  __Pyx_GOTREF(__pyx_t_12);
40525  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L1_error)
40526  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40527  __pyx_v_self->t0 = __pyx_t_2;
40528 
40529  /* "WaveTools.py":2202
40530  * self.t0 = self.time[0]
40531  * # Remove mean level from raw data
40532  * self.etaS -= np.mean(self.etaS) # <<<<<<<<<<<<<<
40533  * # Filter out first 2.5 % and last 2.5% to make the signal periodic
40534  * self.etaS *= costap(len(self.time),cutoff=cutoffTotal)
40535  */
40536  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2202, __pyx_L1_error)
40537  __Pyx_GOTREF(__pyx_t_14);
40538  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_mean); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2202, __pyx_L1_error)
40539  __Pyx_GOTREF(__pyx_t_6);
40540  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40541  __pyx_t_14 = NULL;
40542  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
40543  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
40544  if (likely(__pyx_t_14)) {
40545  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
40546  __Pyx_INCREF(__pyx_t_14);
40547  __Pyx_INCREF(function);
40548  __Pyx_DECREF_SET(__pyx_t_6, function);
40549  }
40550  }
40551  __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, ((PyObject *)__pyx_v_self->etaS)) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self->etaS));
40552  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
40553  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2202, __pyx_L1_error)
40554  __Pyx_GOTREF(__pyx_t_12);
40555  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40556  __pyx_t_6 = PyNumber_InPlaceSubtract(((PyObject *)__pyx_v_self->etaS), __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2202, __pyx_L1_error)
40557  __Pyx_GOTREF(__pyx_t_6);
40558  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40559  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2202, __pyx_L1_error)
40560  __Pyx_GIVEREF(__pyx_t_6);
40561  __Pyx_GOTREF(__pyx_v_self->etaS);
40562  __Pyx_DECREF(((PyObject *)__pyx_v_self->etaS));
40563  __pyx_v_self->etaS = ((PyArrayObject *)__pyx_t_6);
40564  __pyx_t_6 = 0;
40565 
40566  /* "WaveTools.py":2204
40567  * self.etaS -= np.mean(self.etaS)
40568  * # Filter out first 2.5 % and last 2.5% to make the signal periodic
40569  * self.etaS *= costap(len(self.time),cutoff=cutoffTotal) # <<<<<<<<<<<<<<
40570  * # clear tdata from memory
40571  * del tdata
40572  */
40573  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_costap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2204, __pyx_L1_error)
40574  __Pyx_GOTREF(__pyx_t_6);
40575  __pyx_t_12 = ((PyObject *)__pyx_v_self->time);
40576  __Pyx_INCREF(__pyx_t_12);
40577  __pyx_t_8 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2204, __pyx_L1_error)
40578  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40579  __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2204, __pyx_L1_error)
40580  __Pyx_GOTREF(__pyx_t_12);
40581  __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2204, __pyx_L1_error)
40582  __Pyx_GOTREF(__pyx_t_14);
40583  __Pyx_GIVEREF(__pyx_t_12);
40584  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12);
40585  __pyx_t_12 = 0;
40586  __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2204, __pyx_L1_error)
40587  __Pyx_GOTREF(__pyx_t_12);
40588  if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_cutoff, __pyx_v_cutoffTotal) < 0) __PYX_ERR(0, 2204, __pyx_L1_error)
40589  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2204, __pyx_L1_error)
40590  __Pyx_GOTREF(__pyx_t_7);
40591  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
40592  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40593  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40594  __pyx_t_12 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_self->etaS), __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2204, __pyx_L1_error)
40595  __Pyx_GOTREF(__pyx_t_12);
40596  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40597  if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2204, __pyx_L1_error)
40598  __Pyx_GIVEREF(__pyx_t_12);
40599  __Pyx_GOTREF(__pyx_v_self->etaS);
40600  __Pyx_DECREF(((PyObject *)__pyx_v_self->etaS));
40601  __pyx_v_self->etaS = ((PyArrayObject *)__pyx_t_12);
40602  __pyx_t_12 = 0;
40603 
40604  /* "WaveTools.py":2206
40605  * self.etaS *= costap(len(self.time),cutoff=cutoffTotal)
40606  * # clear tdata from memory
40607  * del tdata # <<<<<<<<<<<<<<
40608  * # Calculate time lenght
40609  * self.tlength = (self.time[-1]-self.time[0])
40610  */
40611  if (unlikely(!__pyx_v_tdata)) { __Pyx_RaiseUnboundLocalError("tdata"); __PYX_ERR(0, 2206, __pyx_L1_error) }
40612  __Pyx_DECREF(__pyx_v_tdata);
40613  __pyx_v_tdata = NULL;
40614 
40615  /* "WaveTools.py":2208
40616  * del tdata
40617  * # Calculate time lenght
40618  * self.tlength = (self.time[-1]-self.time[0]) # <<<<<<<<<<<<<<
40619  * # Matrix initialisation
40620  * self.windows_handover = []
40621  */
40622  __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->time), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2208, __pyx_L1_error)
40623  __Pyx_GOTREF(__pyx_t_12);
40624  __pyx_t_7 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->time), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2208, __pyx_L1_error)
40625  __Pyx_GOTREF(__pyx_t_7);
40626  __pyx_t_14 = PyNumber_Subtract(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2208, __pyx_L1_error)
40627  __Pyx_GOTREF(__pyx_t_14);
40628  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40629  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40630  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2208, __pyx_L1_error)
40631  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40632  __pyx_v_self->tlength = __pyx_t_2;
40633 
40634  /* "WaveTools.py":2210
40635  * self.tlength = (self.time[-1]-self.time[0])
40636  * # Matrix initialisation
40637  * self.windows_handover = [] # <<<<<<<<<<<<<<
40638  * self.windows_rec = []
40639  * self.Twindow = 10.
40640  */
40641  __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2210, __pyx_L1_error)
40642  __Pyx_GOTREF(__pyx_t_14);
40643  __Pyx_GIVEREF(__pyx_t_14);
40644  __Pyx_GOTREF(__pyx_v_self->windows_handover);
40645  __Pyx_DECREF(__pyx_v_self->windows_handover);
40646  __pyx_v_self->windows_handover = ((PyObject*)__pyx_t_14);
40647  __pyx_t_14 = 0;
40648 
40649  /* "WaveTools.py":2211
40650  * # Matrix initialisation
40651  * self.windows_handover = []
40652  * self.windows_rec = [] # <<<<<<<<<<<<<<
40653  * self.Twindow = 10.
40654  *
40655  */
40656  __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2211, __pyx_L1_error)
40657  __Pyx_GOTREF(__pyx_t_14);
40658  __Pyx_GIVEREF(__pyx_t_14);
40659  __Pyx_GOTREF(__pyx_v_self->windows_rec);
40660  __Pyx_DECREF(__pyx_v_self->windows_rec);
40661  __pyx_v_self->windows_rec = ((PyObject*)__pyx_t_14);
40662  __pyx_t_14 = 0;
40663 
40664  /* "WaveTools.py":2212
40665  * self.windows_handover = []
40666  * self.windows_rec = []
40667  * self.Twindow = 10. # <<<<<<<<<<<<<<
40668  *
40669  *
40670  */
40671  __pyx_v_self->Twindow = 10.;
40672 
40673  /* "WaveTools.py":2216
40674  *
40675  * # Direct decomposition of the time series for using at reconstruct_direct
40676  * if (self.rec_direct): # <<<<<<<<<<<<<<
40677  * Nf = self.N
40678  * nfft=len(self.time)
40679  */
40680  __pyx_t_9 = (__pyx_v_self->rec_direct != 0);
40681  if (__pyx_t_9) {
40682 
40683  /* "WaveTools.py":2217
40684  * # Direct decomposition of the time series for using at reconstruct_direct
40685  * if (self.rec_direct):
40686  * Nf = self.N # <<<<<<<<<<<<<<
40687  * nfft=len(self.time)
40688  * logEvent("INFO: WaveTools.py: performing a direct series decomposition")
40689  */
40690  __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2217, __pyx_L1_error)
40691  __Pyx_GOTREF(__pyx_t_14);
40692  __pyx_v_Nf = __pyx_t_14;
40693  __pyx_t_14 = 0;
40694 
40695  /* "WaveTools.py":2218
40696  * if (self.rec_direct):
40697  * Nf = self.N
40698  * nfft=len(self.time) # <<<<<<<<<<<<<<
40699  * logEvent("INFO: WaveTools.py: performing a direct series decomposition")
40700  * decomp = decompose_tseries(self.time,self.etaS,self.dt)
40701  */
40702  __pyx_t_14 = ((PyObject *)__pyx_v_self->time);
40703  __Pyx_INCREF(__pyx_t_14);
40704  __pyx_t_8 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2218, __pyx_L1_error)
40705  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40706  __pyx_v_nfft = __pyx_t_8;
40707 
40708  /* "WaveTools.py":2219
40709  * Nf = self.N
40710  * nfft=len(self.time)
40711  * logEvent("INFO: WaveTools.py: performing a direct series decomposition") # <<<<<<<<<<<<<<
40712  * decomp = decompose_tseries(self.time,self.etaS,self.dt)
40713  * self.ai = decomp[1]
40714  */
40715  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2219, __pyx_L1_error)
40716  __Pyx_GOTREF(__pyx_t_7);
40717  __pyx_t_12 = NULL;
40718  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
40719  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
40720  if (likely(__pyx_t_12)) {
40721  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
40722  __Pyx_INCREF(__pyx_t_12);
40723  __Pyx_INCREF(function);
40724  __Pyx_DECREF_SET(__pyx_t_7, function);
40725  }
40726  }
40727  __pyx_t_14 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_kp_s_INFO_WaveTools_py_performing_a_d) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_INFO_WaveTools_py_performing_a_d);
40728  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
40729  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2219, __pyx_L1_error)
40730  __Pyx_GOTREF(__pyx_t_14);
40731  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40732  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40733 
40734  /* "WaveTools.py":2220
40735  * nfft=len(self.time)
40736  * logEvent("INFO: WaveTools.py: performing a direct series decomposition")
40737  * decomp = decompose_tseries(self.time,self.etaS,self.dt) # <<<<<<<<<<<<<<
40738  * self.ai = decomp[1]
40739  * ipeak = np.where(self.ai == max(self.ai))[0][0]
40740  */
40741  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_decompose_tseries); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2220, __pyx_L1_error)
40742  __Pyx_GOTREF(__pyx_t_7);
40743  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->dt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2220, __pyx_L1_error)
40744  __Pyx_GOTREF(__pyx_t_12);
40745  __pyx_t_6 = NULL;
40746  __pyx_t_3 = 0;
40747  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
40748  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
40749  if (likely(__pyx_t_6)) {
40750  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
40751  __Pyx_INCREF(__pyx_t_6);
40752  __Pyx_INCREF(function);
40753  __Pyx_DECREF_SET(__pyx_t_7, function);
40754  __pyx_t_3 = 1;
40755  }
40756  }
40757  #if CYTHON_FAST_PYCALL
40758  if (PyFunction_Check(__pyx_t_7)) {
40759  PyObject *__pyx_temp[4] = {__pyx_t_6, ((PyObject *)__pyx_v_self->time), ((PyObject *)__pyx_v_self->etaS), __pyx_t_12};
40760  __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2220, __pyx_L1_error)
40761  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
40762  __Pyx_GOTREF(__pyx_t_14);
40763  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40764  } else
40765  #endif
40766  #if CYTHON_FAST_PYCCALL
40767  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
40768  PyObject *__pyx_temp[4] = {__pyx_t_6, ((PyObject *)__pyx_v_self->time), ((PyObject *)__pyx_v_self->etaS), __pyx_t_12};
40769  __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2220, __pyx_L1_error)
40770  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
40771  __Pyx_GOTREF(__pyx_t_14);
40772  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40773  } else
40774  #endif
40775  {
40776  __pyx_t_5 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2220, __pyx_L1_error)
40777  __Pyx_GOTREF(__pyx_t_5);
40778  if (__pyx_t_6) {
40779  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
40780  }
40781  __Pyx_INCREF(((PyObject *)__pyx_v_self->time));
40782  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->time));
40783  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_3, ((PyObject *)__pyx_v_self->time));
40784  __Pyx_INCREF(((PyObject *)__pyx_v_self->etaS));
40785  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->etaS));
40786  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_3, ((PyObject *)__pyx_v_self->etaS));
40787  __Pyx_GIVEREF(__pyx_t_12);
40788  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_3, __pyx_t_12);
40789  __pyx_t_12 = 0;
40790  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2220, __pyx_L1_error)
40791  __Pyx_GOTREF(__pyx_t_14);
40792  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40793  }
40794  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40795  __pyx_v_decomp = __pyx_t_14;
40796  __pyx_t_14 = 0;
40797 
40798  /* "WaveTools.py":2221
40799  * logEvent("INFO: WaveTools.py: performing a direct series decomposition")
40800  * decomp = decompose_tseries(self.time,self.etaS,self.dt)
40801  * self.ai = decomp[1] # <<<<<<<<<<<<<<
40802  * ipeak = np.where(self.ai == max(self.ai))[0][0]
40803  * imax = min(ipeak + old_div(Nf,2),len(self.ai))
40804  */
40805  __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_decomp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2221, __pyx_L1_error)
40806  __Pyx_GOTREF(__pyx_t_14);
40807  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2221, __pyx_L1_error)
40808  __Pyx_GIVEREF(__pyx_t_14);
40809  __Pyx_GOTREF(__pyx_v_self->ai);
40810  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
40811  __pyx_v_self->ai = ((PyArrayObject *)__pyx_t_14);
40812  __pyx_t_14 = 0;
40813 
40814  /* "WaveTools.py":2222
40815  * decomp = decompose_tseries(self.time,self.etaS,self.dt)
40816  * self.ai = decomp[1]
40817  * ipeak = np.where(self.ai == max(self.ai))[0][0] # <<<<<<<<<<<<<<
40818  * imax = min(ipeak + old_div(Nf,2),len(self.ai))
40819  * imin = max(0,ipeak - old_div(Nf,2))
40820  */
40821  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2222, __pyx_L1_error)
40822  __Pyx_GOTREF(__pyx_t_7);
40823  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2222, __pyx_L1_error)
40824  __Pyx_GOTREF(__pyx_t_5);
40825  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40826  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, ((PyObject *)__pyx_v_self->ai)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2222, __pyx_L1_error)
40827  __Pyx_GOTREF(__pyx_t_7);
40828  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_self->ai), __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2222, __pyx_L1_error)
40829  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40830  __pyx_t_7 = NULL;
40831  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
40832  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
40833  if (likely(__pyx_t_7)) {
40834  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
40835  __Pyx_INCREF(__pyx_t_7);
40836  __Pyx_INCREF(function);
40837  __Pyx_DECREF_SET(__pyx_t_5, function);
40838  }
40839  }
40840  __pyx_t_14 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12);
40841  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
40842  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40843  if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2222, __pyx_L1_error)
40844  __Pyx_GOTREF(__pyx_t_14);
40845  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40846  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2222, __pyx_L1_error)
40847  __Pyx_GOTREF(__pyx_t_5);
40848  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40849  __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2222, __pyx_L1_error)
40850  __Pyx_GOTREF(__pyx_t_14);
40851  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40852  __pyx_v_ipeak = __pyx_t_14;
40853  __pyx_t_14 = 0;
40854 
40855  /* "WaveTools.py":2223
40856  * self.ai = decomp[1]
40857  * ipeak = np.where(self.ai == max(self.ai))[0][0]
40858  * imax = min(ipeak + old_div(Nf,2),len(self.ai)) # <<<<<<<<<<<<<<
40859  * imin = max(0,ipeak - old_div(Nf,2))
40860  * self.ai = self.ai[imin:imax]
40861  */
40862  __pyx_t_14 = ((PyObject *)__pyx_v_self->ai);
40863  __Pyx_INCREF(__pyx_t_14);
40864  __pyx_t_8 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2223, __pyx_L1_error)
40865  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40866  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2223, __pyx_L1_error)
40867  __Pyx_GOTREF(__pyx_t_5);
40868  __pyx_t_12 = NULL;
40869  __pyx_t_3 = 0;
40870  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
40871  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
40872  if (likely(__pyx_t_12)) {
40873  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
40874  __Pyx_INCREF(__pyx_t_12);
40875  __Pyx_INCREF(function);
40876  __Pyx_DECREF_SET(__pyx_t_5, function);
40877  __pyx_t_3 = 1;
40878  }
40879  }
40880  #if CYTHON_FAST_PYCALL
40881  if (PyFunction_Check(__pyx_t_5)) {
40882  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_Nf, __pyx_int_2};
40883  __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2223, __pyx_L1_error)
40884  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
40885  __Pyx_GOTREF(__pyx_t_14);
40886  } else
40887  #endif
40888  #if CYTHON_FAST_PYCCALL
40889  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
40890  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_Nf, __pyx_int_2};
40891  __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2223, __pyx_L1_error)
40892  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
40893  __Pyx_GOTREF(__pyx_t_14);
40894  } else
40895  #endif
40896  {
40897  __pyx_t_7 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2223, __pyx_L1_error)
40898  __Pyx_GOTREF(__pyx_t_7);
40899  if (__pyx_t_12) {
40900  __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
40901  }
40902  __Pyx_INCREF(__pyx_v_Nf);
40903  __Pyx_GIVEREF(__pyx_v_Nf);
40904  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_3, __pyx_v_Nf);
40905  __Pyx_INCREF(__pyx_int_2);
40906  __Pyx_GIVEREF(__pyx_int_2);
40907  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_3, __pyx_int_2);
40908  __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2223, __pyx_L1_error)
40909  __Pyx_GOTREF(__pyx_t_14);
40910  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40911  }
40912  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40913  __pyx_t_5 = PyNumber_Add(__pyx_v_ipeak, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2223, __pyx_L1_error)
40914  __Pyx_GOTREF(__pyx_t_5);
40915  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40916  __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2223, __pyx_L1_error)
40917  __Pyx_GOTREF(__pyx_t_7);
40918  __pyx_t_12 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2223, __pyx_L1_error)
40919  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40920  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2223, __pyx_L1_error)
40921  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
40922  if (__pyx_t_9) {
40923  __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2223, __pyx_L1_error)
40924  __Pyx_GOTREF(__pyx_t_12);
40925  __pyx_t_14 = __pyx_t_12;
40926  __pyx_t_12 = 0;
40927  } else {
40928  __Pyx_INCREF(__pyx_t_5);
40929  __pyx_t_14 = __pyx_t_5;
40930  }
40931  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40932  __pyx_t_5 = __pyx_t_14;
40933  __Pyx_INCREF(__pyx_t_5);
40934  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40935  __pyx_v_imax = __pyx_t_5;
40936  __pyx_t_5 = 0;
40937 
40938  /* "WaveTools.py":2224
40939  * ipeak = np.where(self.ai == max(self.ai))[0][0]
40940  * imax = min(ipeak + old_div(Nf,2),len(self.ai))
40941  * imin = max(0,ipeak - old_div(Nf,2)) # <<<<<<<<<<<<<<
40942  * self.ai = self.ai[imin:imax]
40943  * self.omega = decomp[0][imin:imax]
40944  */
40945  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_old_div); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2224, __pyx_L1_error)
40946  __Pyx_GOTREF(__pyx_t_14);
40947  __pyx_t_12 = NULL;
40948  __pyx_t_3 = 0;
40949  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
40950  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_14);
40951  if (likely(__pyx_t_12)) {
40952  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
40953  __Pyx_INCREF(__pyx_t_12);
40954  __Pyx_INCREF(function);
40955  __Pyx_DECREF_SET(__pyx_t_14, function);
40956  __pyx_t_3 = 1;
40957  }
40958  }
40959  #if CYTHON_FAST_PYCALL
40960  if (PyFunction_Check(__pyx_t_14)) {
40961  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_Nf, __pyx_int_2};
40962  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2224, __pyx_L1_error)
40963  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
40964  __Pyx_GOTREF(__pyx_t_5);
40965  } else
40966  #endif
40967  #if CYTHON_FAST_PYCCALL
40968  if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
40969  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_Nf, __pyx_int_2};
40970  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2224, __pyx_L1_error)
40971  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
40972  __Pyx_GOTREF(__pyx_t_5);
40973  } else
40974  #endif
40975  {
40976  __pyx_t_7 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2224, __pyx_L1_error)
40977  __Pyx_GOTREF(__pyx_t_7);
40978  if (__pyx_t_12) {
40979  __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
40980  }
40981  __Pyx_INCREF(__pyx_v_Nf);
40982  __Pyx_GIVEREF(__pyx_v_Nf);
40983  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_3, __pyx_v_Nf);
40984  __Pyx_INCREF(__pyx_int_2);
40985  __Pyx_GIVEREF(__pyx_int_2);
40986  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_3, __pyx_int_2);
40987  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2224, __pyx_L1_error)
40988  __Pyx_GOTREF(__pyx_t_5);
40989  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
40990  }
40991  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
40992  __pyx_t_14 = PyNumber_Subtract(__pyx_v_ipeak, __pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2224, __pyx_L1_error)
40993  __Pyx_GOTREF(__pyx_t_14);
40994  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
40995  __pyx_t_15 = 0;
40996  __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2224, __pyx_L1_error)
40997  __Pyx_GOTREF(__pyx_t_7);
40998  __pyx_t_12 = PyObject_RichCompare(__pyx_t_14, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2224, __pyx_L1_error)
40999  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41000  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2224, __pyx_L1_error)
41001  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41002  if (__pyx_t_9) {
41003  __Pyx_INCREF(__pyx_t_14);
41004  __pyx_t_5 = __pyx_t_14;
41005  } else {
41006  __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2224, __pyx_L1_error)
41007  __Pyx_GOTREF(__pyx_t_12);
41008  __pyx_t_5 = __pyx_t_12;
41009  __pyx_t_12 = 0;
41010  }
41011  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41012  __pyx_t_14 = __pyx_t_5;
41013  __Pyx_INCREF(__pyx_t_14);
41014  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41015  __pyx_v_imin = __pyx_t_14;
41016  __pyx_t_14 = 0;
41017 
41018  /* "WaveTools.py":2225
41019  * imax = min(ipeak + old_div(Nf,2),len(self.ai))
41020  * imin = max(0,ipeak - old_div(Nf,2))
41021  * self.ai = self.ai[imin:imax] # <<<<<<<<<<<<<<
41022  * self.omega = decomp[0][imin:imax]
41023  * self.phi = - decomp[2][imin:imax]
41024  */
41025  __pyx_t_14 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->ai), 0, 0, &__pyx_v_imin, &__pyx_v_imax, NULL, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2225, __pyx_L1_error)
41026  __Pyx_GOTREF(__pyx_t_14);
41027  if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2225, __pyx_L1_error)
41028  __Pyx_GIVEREF(__pyx_t_14);
41029  __Pyx_GOTREF(__pyx_v_self->ai);
41030  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
41031  __pyx_v_self->ai = ((PyArrayObject *)__pyx_t_14);
41032  __pyx_t_14 = 0;
41033 
41034  /* "WaveTools.py":2226
41035  * imin = max(0,ipeak - old_div(Nf,2))
41036  * self.ai = self.ai[imin:imax]
41037  * self.omega = decomp[0][imin:imax] # <<<<<<<<<<<<<<
41038  * self.phi = - decomp[2][imin:imax]
41039  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
41040  */
41041  __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_decomp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2226, __pyx_L1_error)
41042  __Pyx_GOTREF(__pyx_t_14);
41043  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_14, 0, 0, &__pyx_v_imin, &__pyx_v_imax, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2226, __pyx_L1_error)
41044  __Pyx_GOTREF(__pyx_t_5);
41045  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41046  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2226, __pyx_L1_error)
41047  __Pyx_GIVEREF(__pyx_t_5);
41048  __Pyx_GOTREF(__pyx_v_self->omega);
41049  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
41050  __pyx_v_self->omega = ((PyArrayObject *)__pyx_t_5);
41051  __pyx_t_5 = 0;
41052 
41053  /* "WaveTools.py":2227
41054  * self.ai = self.ai[imin:imax]
41055  * self.omega = decomp[0][imin:imax]
41056  * self.phi = - decomp[2][imin:imax] # <<<<<<<<<<<<<<
41057  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
41058  * self.Nf = imax - imin
41059  */
41060  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_decomp, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2227, __pyx_L1_error)
41061  __Pyx_GOTREF(__pyx_t_5);
41062  __pyx_t_14 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_v_imin, &__pyx_v_imax, NULL, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2227, __pyx_L1_error)
41063  __Pyx_GOTREF(__pyx_t_14);
41064  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41065  __pyx_t_5 = PyNumber_Negative(__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2227, __pyx_L1_error)
41066  __Pyx_GOTREF(__pyx_t_5);
41067  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41068  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2227, __pyx_L1_error)
41069  __Pyx_GIVEREF(__pyx_t_5);
41070  __Pyx_GOTREF(__pyx_v_self->phi);
41071  __Pyx_DECREF(((PyObject *)__pyx_v_self->phi));
41072  __pyx_v_self->phi = ((PyArrayObject *)__pyx_t_5);
41073  __pyx_t_5 = 0;
41074 
41075  /* "WaveTools.py":2228
41076  * self.omega = decomp[0][imin:imax]
41077  * self.phi = - decomp[2][imin:imax]
41078  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs) # <<<<<<<<<<<<<<
41079  * self.Nf = imax - imin
41080  * self.setup = decomp[3]
41081  */
41082  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2228, __pyx_L1_error)
41083  __Pyx_GOTREF(__pyx_t_5);
41084  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2228, __pyx_L1_error)
41085  __Pyx_GOTREF(__pyx_t_14);
41086  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2228, __pyx_L1_error)
41087  __Pyx_GOTREF(__pyx_t_12);
41088  __Pyx_INCREF(((PyObject *)__pyx_v_self->omega));
41089  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->omega));
41090  PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_self->omega));
41091  __Pyx_GIVEREF(__pyx_t_14);
41092  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_14);
41093  __pyx_t_14 = 0;
41094  __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2228, __pyx_L1_error)
41095  __Pyx_GOTREF(__pyx_t_14);
41096  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2228, __pyx_L1_error)
41097  __Pyx_GOTREF(__pyx_t_7);
41098  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_g, __pyx_t_7) < 0) __PYX_ERR(0, 2228, __pyx_L1_error)
41099  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41100  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2228, __pyx_L1_error)
41101  __Pyx_GOTREF(__pyx_t_7);
41102  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41103  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41104  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41105  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2228, __pyx_L1_error)
41106  __Pyx_GIVEREF(__pyx_t_7);
41107  __Pyx_GOTREF(__pyx_v_self->ki);
41108  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
41109  __pyx_v_self->ki = ((PyArrayObject *)__pyx_t_7);
41110  __pyx_t_7 = 0;
41111 
41112  /* "WaveTools.py":2229
41113  * self.phi = - decomp[2][imin:imax]
41114  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
41115  * self.Nf = imax - imin # <<<<<<<<<<<<<<
41116  * self.setup = decomp[3]
41117  * self.kDir = np.zeros((len(self.ki),3),"d")
41118  */
41119  __pyx_t_7 = PyNumber_Subtract(__pyx_v_imax, __pyx_v_imin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2229, __pyx_L1_error)
41120  __Pyx_GOTREF(__pyx_t_7);
41121  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2229, __pyx_L1_error)
41122  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41123  __pyx_v_self->Nf = __pyx_t_3;
41124 
41125  /* "WaveTools.py":2230
41126  * self.ki = dispersion(self.omega,self.depth,g=self.gAbs)
41127  * self.Nf = imax - imin
41128  * self.setup = decomp[3] # <<<<<<<<<<<<<<
41129  * self.kDir = np.zeros((len(self.ki),3),"d")
41130  * for ii in range(len(self.ki)):
41131  */
41132  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_decomp, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2230, __pyx_L1_error)
41133  __Pyx_GOTREF(__pyx_t_7);
41134  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2230, __pyx_L1_error)
41135  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41136  __pyx_v_self->setup = __pyx_t_2;
41137 
41138  /* "WaveTools.py":2231
41139  * self.Nf = imax - imin
41140  * self.setup = decomp[3]
41141  * self.kDir = np.zeros((len(self.ki),3),"d") # <<<<<<<<<<<<<<
41142  * for ii in range(len(self.ki)):
41143  * self.kDir[ii,:] = self.ki[ii]*self.waveDir[:]
41144  */
41145  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2231, __pyx_L1_error)
41146  __Pyx_GOTREF(__pyx_t_14);
41147  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_zeros); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2231, __pyx_L1_error)
41148  __Pyx_GOTREF(__pyx_t_12);
41149  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41150  __pyx_t_14 = ((PyObject *)__pyx_v_self->ki);
41151  __Pyx_INCREF(__pyx_t_14);
41152  __pyx_t_8 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2231, __pyx_L1_error)
41153  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41154  __pyx_t_14 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2231, __pyx_L1_error)
41155  __Pyx_GOTREF(__pyx_t_14);
41156  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2231, __pyx_L1_error)
41157  __Pyx_GOTREF(__pyx_t_5);
41158  __Pyx_GIVEREF(__pyx_t_14);
41159  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14);
41160  __Pyx_INCREF(__pyx_int_3);
41161  __Pyx_GIVEREF(__pyx_int_3);
41162  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_3);
41163  __pyx_t_14 = 0;
41164  __pyx_t_14 = NULL;
41165  __pyx_t_3 = 0;
41166  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
41167  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
41168  if (likely(__pyx_t_14)) {
41169  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
41170  __Pyx_INCREF(__pyx_t_14);
41171  __Pyx_INCREF(function);
41172  __Pyx_DECREF_SET(__pyx_t_12, function);
41173  __pyx_t_3 = 1;
41174  }
41175  }
41176  #if CYTHON_FAST_PYCALL
41177  if (PyFunction_Check(__pyx_t_12)) {
41178  PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_5, __pyx_n_s_d};
41179  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2231, __pyx_L1_error)
41180  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41181  __Pyx_GOTREF(__pyx_t_7);
41182  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41183  } else
41184  #endif
41185  #if CYTHON_FAST_PYCCALL
41186  if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
41187  PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_5, __pyx_n_s_d};
41188  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2231, __pyx_L1_error)
41189  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41190  __Pyx_GOTREF(__pyx_t_7);
41191  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41192  } else
41193  #endif
41194  {
41195  __pyx_t_6 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2231, __pyx_L1_error)
41196  __Pyx_GOTREF(__pyx_t_6);
41197  if (__pyx_t_14) {
41198  __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); __pyx_t_14 = NULL;
41199  }
41200  __Pyx_GIVEREF(__pyx_t_5);
41201  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, __pyx_t_5);
41202  __Pyx_INCREF(__pyx_n_s_d);
41203  __Pyx_GIVEREF(__pyx_n_s_d);
41204  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_n_s_d);
41205  __pyx_t_5 = 0;
41206  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2231, __pyx_L1_error)
41207  __Pyx_GOTREF(__pyx_t_7);
41208  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41209  }
41210  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41211  if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2231, __pyx_L1_error)
41212  __Pyx_GIVEREF(__pyx_t_7);
41213  __Pyx_GOTREF(__pyx_v_self->kDir);
41214  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
41215  __pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_7);
41216  __pyx_t_7 = 0;
41217 
41218  /* "WaveTools.py":2232
41219  * self.setup = decomp[3]
41220  * self.kDir = np.zeros((len(self.ki),3),"d")
41221  * for ii in range(len(self.ki)): # <<<<<<<<<<<<<<
41222  * self.kDir[ii,:] = self.ki[ii]*self.waveDir[:]
41223  *
41224  */
41225  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_range); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2232, __pyx_L1_error)
41226  __Pyx_GOTREF(__pyx_t_12);
41227  __pyx_t_6 = ((PyObject *)__pyx_v_self->ki);
41228  __Pyx_INCREF(__pyx_t_6);
41229  __pyx_t_8 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2232, __pyx_L1_error)
41230  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41231  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2232, __pyx_L1_error)
41232  __Pyx_GOTREF(__pyx_t_6);
41233  __pyx_t_5 = NULL;
41234  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
41235  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
41236  if (likely(__pyx_t_5)) {
41237  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
41238  __Pyx_INCREF(__pyx_t_5);
41239  __Pyx_INCREF(function);
41240  __Pyx_DECREF_SET(__pyx_t_12, function);
41241  }
41242  }
41243  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6);
41244  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
41245  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41246  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2232, __pyx_L1_error)
41247  __Pyx_GOTREF(__pyx_t_7);
41248  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41249  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
41250  __pyx_t_12 = __pyx_t_7; __Pyx_INCREF(__pyx_t_12); __pyx_t_8 = 0;
41251  __pyx_t_13 = NULL;
41252  } else {
41253  __pyx_t_8 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2232, __pyx_L1_error)
41254  __Pyx_GOTREF(__pyx_t_12);
41255  __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2232, __pyx_L1_error)
41256  }
41257  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41258  for (;;) {
41259  if (likely(!__pyx_t_13)) {
41260  if (likely(PyList_CheckExact(__pyx_t_12))) {
41261  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_12)) break;
41262  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41263  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2232, __pyx_L1_error)
41264  #else
41265  __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2232, __pyx_L1_error)
41266  __Pyx_GOTREF(__pyx_t_7);
41267  #endif
41268  } else {
41269  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
41270  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41271  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2232, __pyx_L1_error)
41272  #else
41273  __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2232, __pyx_L1_error)
41274  __Pyx_GOTREF(__pyx_t_7);
41275  #endif
41276  }
41277  } else {
41278  __pyx_t_7 = __pyx_t_13(__pyx_t_12);
41279  if (unlikely(!__pyx_t_7)) {
41280  PyObject* exc_type = PyErr_Occurred();
41281  if (exc_type) {
41282  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
41283  else __PYX_ERR(0, 2232, __pyx_L1_error)
41284  }
41285  break;
41286  }
41287  __Pyx_GOTREF(__pyx_t_7);
41288  }
41289  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_7);
41290  __pyx_t_7 = 0;
41291 
41292  /* "WaveTools.py":2233
41293  * self.kDir = np.zeros((len(self.ki),3),"d")
41294  * for ii in range(len(self.ki)):
41295  * self.kDir[ii,:] = self.ki[ii]*self.waveDir[:] # <<<<<<<<<<<<<<
41296  *
41297  * for ij in range(self.Nf):
41298  */
41299  __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ii); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2233, __pyx_L1_error)
41300  __Pyx_GOTREF(__pyx_t_7);
41301  __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2233, __pyx_L1_error)
41302  __Pyx_GOTREF(__pyx_t_6);
41303  __pyx_t_5 = PyNumber_Multiply(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2233, __pyx_L1_error)
41304  __Pyx_GOTREF(__pyx_t_5);
41305  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41306  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41307  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2233, __pyx_L1_error)
41308  __Pyx_GOTREF(__pyx_t_6);
41309  __Pyx_INCREF(__pyx_v_ii);
41310  __Pyx_GIVEREF(__pyx_v_ii);
41311  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ii);
41312  __Pyx_INCREF(__pyx_slice__4);
41313  __Pyx_GIVEREF(__pyx_slice__4);
41314  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4);
41315  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_6, __pyx_t_5) < 0)) __PYX_ERR(0, 2233, __pyx_L1_error)
41316  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41317  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41318 
41319  /* "WaveTools.py":2232
41320  * self.setup = decomp[3]
41321  * self.kDir = np.zeros((len(self.ki),3),"d")
41322  * for ii in range(len(self.ki)): # <<<<<<<<<<<<<<
41323  * self.kDir[ii,:] = self.ki[ii]*self.waveDir[:]
41324  *
41325  */
41326  }
41327  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41328 
41329  /* "WaveTools.py":2235
41330  * self.kDir[ii,:] = self.ki[ii]*self.waveDir[:]
41331  *
41332  * for ij in range(self.Nf): # <<<<<<<<<<<<<<
41333  * self.omega_c[ij] = self.omega[ij]
41334  * self.ki_c[ij] =self.ki[ij]
41335  */
41336  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2235, __pyx_L1_error)
41337  __Pyx_GOTREF(__pyx_t_5);
41338  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->Nf); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2235, __pyx_L1_error)
41339  __Pyx_GOTREF(__pyx_t_6);
41340  __pyx_t_7 = NULL;
41341  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
41342  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
41343  if (likely(__pyx_t_7)) {
41344  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
41345  __Pyx_INCREF(__pyx_t_7);
41346  __Pyx_INCREF(function);
41347  __Pyx_DECREF_SET(__pyx_t_5, function);
41348  }
41349  }
41350  __pyx_t_12 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
41351  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
41352  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41353  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2235, __pyx_L1_error)
41354  __Pyx_GOTREF(__pyx_t_12);
41355  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41356  if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
41357  __pyx_t_5 = __pyx_t_12; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
41358  __pyx_t_13 = NULL;
41359  } else {
41360  __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2235, __pyx_L1_error)
41361  __Pyx_GOTREF(__pyx_t_5);
41362  __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2235, __pyx_L1_error)
41363  }
41364  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41365  for (;;) {
41366  if (likely(!__pyx_t_13)) {
41367  if (likely(PyList_CheckExact(__pyx_t_5))) {
41368  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
41369  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41370  __pyx_t_12 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2235, __pyx_L1_error)
41371  #else
41372  __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2235, __pyx_L1_error)
41373  __Pyx_GOTREF(__pyx_t_12);
41374  #endif
41375  } else {
41376  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
41377  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41378  __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2235, __pyx_L1_error)
41379  #else
41380  __pyx_t_12 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2235, __pyx_L1_error)
41381  __Pyx_GOTREF(__pyx_t_12);
41382  #endif
41383  }
41384  } else {
41385  __pyx_t_12 = __pyx_t_13(__pyx_t_5);
41386  if (unlikely(!__pyx_t_12)) {
41387  PyObject* exc_type = PyErr_Occurred();
41388  if (exc_type) {
41389  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
41390  else __PYX_ERR(0, 2235, __pyx_L1_error)
41391  }
41392  break;
41393  }
41394  __Pyx_GOTREF(__pyx_t_12);
41395  }
41396  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_12);
41397  __pyx_t_12 = 0;
41398 
41399  /* "WaveTools.py":2236
41400  *
41401  * for ij in range(self.Nf):
41402  * self.omega_c[ij] = self.omega[ij] # <<<<<<<<<<<<<<
41403  * self.ki_c[ij] =self.ki[ij]
41404  * self.tanh_c[ij] = np.tanh(self.ki[ij]*self.depth)
41405  */
41406  __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omega), __pyx_v_ij); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2236, __pyx_L1_error)
41407  __Pyx_GOTREF(__pyx_t_12);
41408  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L1_error)
41409  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41410  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2236, __pyx_L1_error)
41411  (__pyx_v_self->omega_c[__pyx_t_16]) = __pyx_t_2;
41412 
41413  /* "WaveTools.py":2237
41414  * for ij in range(self.Nf):
41415  * self.omega_c[ij] = self.omega[ij]
41416  * self.ki_c[ij] =self.ki[ij] # <<<<<<<<<<<<<<
41417  * self.tanh_c[ij] = np.tanh(self.ki[ij]*self.depth)
41418  * self.ai_c[ij] = self.ai[ij]
41419  */
41420  __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ij); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2237, __pyx_L1_error)
41421  __Pyx_GOTREF(__pyx_t_12);
41422  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L1_error)
41423  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41424  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L1_error)
41425  (__pyx_v_self->ki_c[__pyx_t_16]) = __pyx_t_2;
41426 
41427  /* "WaveTools.py":2238
41428  * self.omega_c[ij] = self.omega[ij]
41429  * self.ki_c[ij] =self.ki[ij]
41430  * self.tanh_c[ij] = np.tanh(self.ki[ij]*self.depth) # <<<<<<<<<<<<<<
41431  * self.ai_c[ij] = self.ai[ij]
41432  * self.phi_c[ij] = self.phi[ij]
41433  */
41434  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2238, __pyx_L1_error)
41435  __Pyx_GOTREF(__pyx_t_6);
41436  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tanh); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2238, __pyx_L1_error)
41437  __Pyx_GOTREF(__pyx_t_7);
41438  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41439  __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ij); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2238, __pyx_L1_error)
41440  __Pyx_GOTREF(__pyx_t_6);
41441  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2238, __pyx_L1_error)
41442  __Pyx_GOTREF(__pyx_t_14);
41443  __pyx_t_11 = PyNumber_Multiply(__pyx_t_6, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2238, __pyx_L1_error)
41444  __Pyx_GOTREF(__pyx_t_11);
41445  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41446  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41447  __pyx_t_14 = NULL;
41448  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
41449  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
41450  if (likely(__pyx_t_14)) {
41451  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
41452  __Pyx_INCREF(__pyx_t_14);
41453  __Pyx_INCREF(function);
41454  __Pyx_DECREF_SET(__pyx_t_7, function);
41455  }
41456  }
41457  __pyx_t_12 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_14, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_11);
41458  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41459  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
41460  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2238, __pyx_L1_error)
41461  __Pyx_GOTREF(__pyx_t_12);
41462  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41463  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L1_error)
41464  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41465  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2238, __pyx_L1_error)
41466  (__pyx_v_self->tanh_c[__pyx_t_16]) = __pyx_t_2;
41467 
41468  /* "WaveTools.py":2239
41469  * self.ki_c[ij] =self.ki[ij]
41470  * self.tanh_c[ij] = np.tanh(self.ki[ij]*self.depth)
41471  * self.ai_c[ij] = self.ai[ij] # <<<<<<<<<<<<<<
41472  * self.phi_c[ij] = self.phi[ij]
41473  * for kk in range(3):
41474  */
41475  __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ai), __pyx_v_ij); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2239, __pyx_L1_error)
41476  __Pyx_GOTREF(__pyx_t_12);
41477  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L1_error)
41478  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41479  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L1_error)
41480  (__pyx_v_self->ai_c[__pyx_t_16]) = __pyx_t_2;
41481 
41482  /* "WaveTools.py":2240
41483  * self.tanh_c[ij] = np.tanh(self.ki[ij]*self.depth)
41484  * self.ai_c[ij] = self.ai[ij]
41485  * self.phi_c[ij] = self.phi[ij] # <<<<<<<<<<<<<<
41486  * for kk in range(3):
41487  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
41488  */
41489  __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->phi), __pyx_v_ij); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2240, __pyx_L1_error)
41490  __Pyx_GOTREF(__pyx_t_12);
41491  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2240, __pyx_L1_error)
41492  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41493  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2240, __pyx_L1_error)
41494  (__pyx_v_self->phi_c[__pyx_t_16]) = __pyx_t_2;
41495 
41496  /* "WaveTools.py":2241
41497  * self.ai_c[ij] = self.ai[ij]
41498  * self.phi_c[ij] = self.phi[ij]
41499  * for kk in range(3): # <<<<<<<<<<<<<<
41500  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
41501  * self.kDir_ = self.kDir_c
41502  */
41503  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_range); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2241, __pyx_L1_error)
41504  __Pyx_GOTREF(__pyx_t_7);
41505  __pyx_t_11 = NULL;
41506  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
41507  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
41508  if (likely(__pyx_t_11)) {
41509  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
41510  __Pyx_INCREF(__pyx_t_11);
41511  __Pyx_INCREF(function);
41512  __Pyx_DECREF_SET(__pyx_t_7, function);
41513  }
41514  }
41515  __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_11, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_int_3);
41516  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
41517  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2241, __pyx_L1_error)
41518  __Pyx_GOTREF(__pyx_t_12);
41519  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41520  if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) {
41521  __pyx_t_7 = __pyx_t_12; __Pyx_INCREF(__pyx_t_7); __pyx_t_16 = 0;
41522  __pyx_t_17 = NULL;
41523  } else {
41524  __pyx_t_16 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2241, __pyx_L1_error)
41525  __Pyx_GOTREF(__pyx_t_7);
41526  __pyx_t_17 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2241, __pyx_L1_error)
41527  }
41528  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41529  for (;;) {
41530  if (likely(!__pyx_t_17)) {
41531  if (likely(PyList_CheckExact(__pyx_t_7))) {
41532  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_7)) break;
41533  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41534  __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 2241, __pyx_L1_error)
41535  #else
41536  __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2241, __pyx_L1_error)
41537  __Pyx_GOTREF(__pyx_t_12);
41538  #endif
41539  } else {
41540  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
41541  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
41542  __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 2241, __pyx_L1_error)
41543  #else
41544  __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2241, __pyx_L1_error)
41545  __Pyx_GOTREF(__pyx_t_12);
41546  #endif
41547  }
41548  } else {
41549  __pyx_t_12 = __pyx_t_17(__pyx_t_7);
41550  if (unlikely(!__pyx_t_12)) {
41551  PyObject* exc_type = PyErr_Occurred();
41552  if (exc_type) {
41553  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
41554  else __PYX_ERR(0, 2241, __pyx_L1_error)
41555  }
41556  break;
41557  }
41558  __Pyx_GOTREF(__pyx_t_12);
41559  }
41560  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_12);
41561  __pyx_t_12 = 0;
41562 
41563  /* "WaveTools.py":2242
41564  * self.phi_c[ij] = self.phi[ij]
41565  * for kk in range(3):
41566  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk] # <<<<<<<<<<<<<<
41567  * self.kDir_ = self.kDir_c
41568  * self.omega_ = self.omega_c
41569  */
41570  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2242, __pyx_L1_error)
41571  __Pyx_GOTREF(__pyx_t_12);
41572  __Pyx_INCREF(__pyx_v_ij);
41573  __Pyx_GIVEREF(__pyx_v_ij);
41574  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_ij);
41575  __Pyx_INCREF(__pyx_v_kk);
41576  __Pyx_GIVEREF(__pyx_v_kk);
41577  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_kk);
41578  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2242, __pyx_L1_error)
41579  __Pyx_GOTREF(__pyx_t_11);
41580  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41581  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L1_error)
41582  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
41583  __pyx_t_11 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2242, __pyx_L1_error)
41584  __Pyx_GOTREF(__pyx_t_11);
41585  __pyx_t_12 = PyNumber_Add(__pyx_t_11, __pyx_v_kk); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2242, __pyx_L1_error)
41586  __Pyx_GOTREF(__pyx_t_12);
41587  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
41588  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L1_error)
41589  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41590  (__pyx_v_self->kDir_c[__pyx_t_18]) = __pyx_t_2;
41591 
41592  /* "WaveTools.py":2241
41593  * self.ai_c[ij] = self.ai[ij]
41594  * self.phi_c[ij] = self.phi[ij]
41595  * for kk in range(3): # <<<<<<<<<<<<<<
41596  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
41597  * self.kDir_ = self.kDir_c
41598  */
41599  }
41600  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41601 
41602  /* "WaveTools.py":2235
41603  * self.kDir[ii,:] = self.ki[ii]*self.waveDir[:]
41604  *
41605  * for ij in range(self.Nf): # <<<<<<<<<<<<<<
41606  * self.omega_c[ij] = self.omega[ij]
41607  * self.ki_c[ij] =self.ki[ij]
41608  */
41609  }
41610  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41611 
41612  /* "WaveTools.py":2243
41613  * for kk in range(3):
41614  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
41615  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
41616  * self.omega_ = self.omega_c
41617  * self.ki_ =self.ki_c
41618  */
41619  __pyx_t_19 = __pyx_v_self->kDir_c;
41620  __pyx_v_self->kDir_ = __pyx_t_19;
41621 
41622  /* "WaveTools.py":2244
41623  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
41624  * self.kDir_ = self.kDir_c
41625  * self.omega_ = self.omega_c # <<<<<<<<<<<<<<
41626  * self.ki_ =self.ki_c
41627  * self.ai_ = self.ai_c
41628  */
41629  __pyx_t_19 = __pyx_v_self->omega_c;
41630  __pyx_v_self->omega_ = __pyx_t_19;
41631 
41632  /* "WaveTools.py":2245
41633  * self.kDir_ = self.kDir_c
41634  * self.omega_ = self.omega_c
41635  * self.ki_ =self.ki_c # <<<<<<<<<<<<<<
41636  * self.ai_ = self.ai_c
41637  * self.tanh_ = self.tanh_c
41638  */
41639  __pyx_t_19 = __pyx_v_self->ki_c;
41640  __pyx_v_self->ki_ = __pyx_t_19;
41641 
41642  /* "WaveTools.py":2246
41643  * self.omega_ = self.omega_c
41644  * self.ki_ =self.ki_c
41645  * self.ai_ = self.ai_c # <<<<<<<<<<<<<<
41646  * self.tanh_ = self.tanh_c
41647  * self.phi_ = self.phi_c
41648  */
41649  __pyx_t_19 = __pyx_v_self->ai_c;
41650  __pyx_v_self->ai_ = __pyx_t_19;
41651 
41652  /* "WaveTools.py":2247
41653  * self.ki_ =self.ki_c
41654  * self.ai_ = self.ai_c
41655  * self.tanh_ = self.tanh_c # <<<<<<<<<<<<<<
41656  * self.phi_ = self.phi_c
41657  *
41658  */
41659  __pyx_t_19 = __pyx_v_self->tanh_c;
41660  __pyx_v_self->tanh_ = __pyx_t_19;
41661 
41662  /* "WaveTools.py":2248
41663  * self.ai_ = self.ai_c
41664  * self.tanh_ = self.tanh_c
41665  * self.phi_ = self.phi_c # <<<<<<<<<<<<<<
41666  *
41667  *
41668  */
41669  __pyx_t_19 = __pyx_v_self->phi_c;
41670  __pyx_v_self->phi_ = __pyx_t_19;
41671 
41672  /* "WaveTools.py":2216
41673  *
41674  * # Direct decomposition of the time series for using at reconstruct_direct
41675  * if (self.rec_direct): # <<<<<<<<<<<<<<
41676  * Nf = self.N
41677  * nfft=len(self.time)
41678  */
41679  goto __pyx_L14;
41680  }
41681 
41682  /* "WaveTools.py":2256
41683  * # Spectral windowing
41684  * else:
41685  * if (window_params is None): # <<<<<<<<<<<<<<
41686  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary")
41687  * sys.exit(1)
41688  */
41689  /*else*/ {
41690  __pyx_t_9 = (__pyx_v_window_params == Py_None);
41691  __pyx_t_10 = (__pyx_t_9 != 0);
41692  if (__pyx_t_10) {
41693 
41694  /* "WaveTools.py":2257
41695  * else:
41696  * if (window_params is None):
41697  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary") # <<<<<<<<<<<<<<
41698  * sys.exit(1)
41699  * try:
41700  */
41701  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2257, __pyx_L1_error)
41702  __Pyx_GOTREF(__pyx_t_7);
41703  __pyx_t_12 = NULL;
41704  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
41705  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
41706  if (likely(__pyx_t_12)) {
41707  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
41708  __Pyx_INCREF(__pyx_t_12);
41709  __Pyx_INCREF(function);
41710  __Pyx_DECREF_SET(__pyx_t_7, function);
41711  }
41712  }
41713  __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_kp_s_ERROR_WaveTools_py_Set_parameter) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_ERROR_WaveTools_py_Set_parameter);
41714  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
41715  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2257, __pyx_L1_error)
41716  __Pyx_GOTREF(__pyx_t_5);
41717  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41718  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41719 
41720  /* "WaveTools.py":2258
41721  * if (window_params is None):
41722  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary")
41723  * sys.exit(1) # <<<<<<<<<<<<<<
41724  * try:
41725  * self.Nwaves = window_params["Nwaves"]
41726  */
41727  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sys); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2258, __pyx_L1_error)
41728  __Pyx_GOTREF(__pyx_t_7);
41729  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_exit); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error)
41730  __Pyx_GOTREF(__pyx_t_12);
41731  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41732  __pyx_t_7 = NULL;
41733  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
41734  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
41735  if (likely(__pyx_t_7)) {
41736  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
41737  __Pyx_INCREF(__pyx_t_7);
41738  __Pyx_INCREF(function);
41739  __Pyx_DECREF_SET(__pyx_t_12, function);
41740  }
41741  }
41742  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_7, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_int_1);
41743  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
41744  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2258, __pyx_L1_error)
41745  __Pyx_GOTREF(__pyx_t_5);
41746  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
41747  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41748 
41749  /* "WaveTools.py":2256
41750  * # Spectral windowing
41751  * else:
41752  * if (window_params is None): # <<<<<<<<<<<<<<
41753  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary")
41754  * sys.exit(1)
41755  */
41756  }
41757 
41758  /* "WaveTools.py":2259
41759  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary")
41760  * sys.exit(1)
41761  * try: # <<<<<<<<<<<<<<
41762  * self.Nwaves = window_params["Nwaves"]
41763  * except:
41764  */
41765  {
41766  __Pyx_PyThreadState_declare
41767  __Pyx_PyThreadState_assign
41768  __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
41769  __Pyx_XGOTREF(__pyx_t_20);
41770  __Pyx_XGOTREF(__pyx_t_21);
41771  __Pyx_XGOTREF(__pyx_t_22);
41772  /*try:*/ {
41773 
41774  /* "WaveTools.py":2260
41775  * sys.exit(1)
41776  * try:
41777  * self.Nwaves = window_params["Nwaves"] # <<<<<<<<<<<<<<
41778  * except:
41779  * logEvent("ERROR! WaveTools.py: Dictionary key 'Nwaves' (waves per window) not found in window_params dictionary")
41780  */
41781  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_window_params, __pyx_n_s_Nwaves); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2260, __pyx_L22_error)
41782  __Pyx_GOTREF(__pyx_t_5);
41783  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2260, __pyx_L22_error)
41784  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
41785  __pyx_v_self->Nwaves = __pyx_t_3;
41786 
41787  /* "WaveTools.py":2259
41788  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary")
41789  * sys.exit(1)
41790  * try: # <<<<<<<<<<<<<<
41791  * self.Nwaves = window_params["Nwaves"]
41792  * except:
41793  */
41794  }
41795  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
41796  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
41797  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
41798  goto __pyx_L27_try_end;
41799  __pyx_L22_error:;
41800  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
41801  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
41802  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41803  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
41804  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
41805  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
41806  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
41807 
41808  /* "WaveTools.py":2261
41809  * try:
41810  * self.Nwaves = window_params["Nwaves"]
41811  * except: # <<<<<<<<<<<<<<
41812  * logEvent("ERROR! WaveTools.py: Dictionary key 'Nwaves' (waves per window) not found in window_params dictionary")
41813  * sys.exit(1)
41814  */
41815  /*except:*/ {
41816  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
41817  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_12, &__pyx_t_7) < 0) __PYX_ERR(0, 2261, __pyx_L24_except_error)
41818  __Pyx_GOTREF(__pyx_t_5);
41819  __Pyx_GOTREF(__pyx_t_12);
41820  __Pyx_GOTREF(__pyx_t_7);
41821 
41822  /* "WaveTools.py":2262
41823  * self.Nwaves = window_params["Nwaves"]
41824  * except:
41825  * logEvent("ERROR! WaveTools.py: Dictionary key 'Nwaves' (waves per window) not found in window_params dictionary") # <<<<<<<<<<<<<<
41826  * sys.exit(1)
41827  *
41828  */
41829  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2262, __pyx_L24_except_error)
41830  __Pyx_GOTREF(__pyx_t_14);
41831  __pyx_t_6 = NULL;
41832  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
41833  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_14);
41834  if (likely(__pyx_t_6)) {
41835  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
41836  __Pyx_INCREF(__pyx_t_6);
41837  __Pyx_INCREF(function);
41838  __Pyx_DECREF_SET(__pyx_t_14, function);
41839  }
41840  }
41841  __pyx_t_11 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_6, __pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke);
41842  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
41843  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2262, __pyx_L24_except_error)
41844  __Pyx_GOTREF(__pyx_t_11);
41845  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41846  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
41847 
41848  /* "WaveTools.py":2263
41849  * except:
41850  * logEvent("ERROR! WaveTools.py: Dictionary key 'Nwaves' (waves per window) not found in window_params dictionary")
41851  * sys.exit(1) # <<<<<<<<<<<<<<
41852  *
41853  * try:
41854  */
41855  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2263, __pyx_L24_except_error)
41856  __Pyx_GOTREF(__pyx_t_14);
41857  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2263, __pyx_L24_except_error)
41858  __Pyx_GOTREF(__pyx_t_6);
41859  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
41860  __pyx_t_14 = NULL;
41861  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
41862  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
41863  if (likely(__pyx_t_14)) {
41864  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
41865  __Pyx_INCREF(__pyx_t_14);
41866  __Pyx_INCREF(function);
41867  __Pyx_DECREF_SET(__pyx_t_6, function);
41868  }
41869  }
41870  __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
41871  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41872  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2263, __pyx_L24_except_error)
41873  __Pyx_GOTREF(__pyx_t_11);
41874  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41875  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
41876  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
41877  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
41878  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
41879  goto __pyx_L23_exception_handled;
41880  }
41881  __pyx_L24_except_error:;
41882 
41883  /* "WaveTools.py":2259
41884  * logEvent("ERROR! WaveTools.py: Set parameters for spectral windowing. Argument window_params must be a dictionary")
41885  * sys.exit(1)
41886  * try: # <<<<<<<<<<<<<<
41887  * self.Nwaves = window_params["Nwaves"]
41888  * except:
41889  */
41890  __Pyx_XGIVEREF(__pyx_t_20);
41891  __Pyx_XGIVEREF(__pyx_t_21);
41892  __Pyx_XGIVEREF(__pyx_t_22);
41893  __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
41894  goto __pyx_L1_error;
41895  __pyx_L23_exception_handled:;
41896  __Pyx_XGIVEREF(__pyx_t_20);
41897  __Pyx_XGIVEREF(__pyx_t_21);
41898  __Pyx_XGIVEREF(__pyx_t_22);
41899  __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
41900  __pyx_L27_try_end:;
41901  }
41902 
41903  /* "WaveTools.py":2265
41904  * sys.exit(1)
41905  *
41906  * try: # <<<<<<<<<<<<<<
41907  * self.Tm = window_params["Tm"]
41908  * except:
41909  */
41910  {
41911  __Pyx_PyThreadState_declare
41912  __Pyx_PyThreadState_assign
41913  __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
41914  __Pyx_XGOTREF(__pyx_t_22);
41915  __Pyx_XGOTREF(__pyx_t_21);
41916  __Pyx_XGOTREF(__pyx_t_20);
41917  /*try:*/ {
41918 
41919  /* "WaveTools.py":2266
41920  *
41921  * try:
41922  * self.Tm = window_params["Tm"] # <<<<<<<<<<<<<<
41923  * except:
41924  * logEvent("ERROR! WaveTools.py: Dictionary key 'Tm' (mean or characteristic wave period) not found in window_params dictionary")
41925  */
41926  __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_window_params, __pyx_n_s_Tm); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2266, __pyx_L30_error)
41927  __Pyx_GOTREF(__pyx_t_7);
41928  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2266, __pyx_L30_error)
41929  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
41930  __pyx_v_self->Tm = __pyx_t_2;
41931 
41932  /* "WaveTools.py":2265
41933  * sys.exit(1)
41934  *
41935  * try: # <<<<<<<<<<<<<<
41936  * self.Tm = window_params["Tm"]
41937  * except:
41938  */
41939  }
41940  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
41941  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
41942  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
41943  goto __pyx_L35_try_end;
41944  __pyx_L30_error:;
41945  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
41946  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41947  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
41948  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
41949  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
41950  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
41951  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
41952 
41953  /* "WaveTools.py":2267
41954  * try:
41955  * self.Tm = window_params["Tm"]
41956  * except: # <<<<<<<<<<<<<<
41957  * logEvent("ERROR! WaveTools.py: Dictionary key 'Tm' (mean or characteristic wave period) not found in window_params dictionary")
41958  * sys.exit(1)
41959  */
41960  /*except:*/ {
41961  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
41962  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_12, &__pyx_t_5) < 0) __PYX_ERR(0, 2267, __pyx_L32_except_error)
41963  __Pyx_GOTREF(__pyx_t_7);
41964  __Pyx_GOTREF(__pyx_t_12);
41965  __Pyx_GOTREF(__pyx_t_5);
41966 
41967  /* "WaveTools.py":2268
41968  * self.Tm = window_params["Tm"]
41969  * except:
41970  * logEvent("ERROR! WaveTools.py: Dictionary key 'Tm' (mean or characteristic wave period) not found in window_params dictionary") # <<<<<<<<<<<<<<
41971  * sys.exit(1)
41972  *
41973  */
41974  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2268, __pyx_L32_except_error)
41975  __Pyx_GOTREF(__pyx_t_6);
41976  __pyx_t_14 = NULL;
41977  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
41978  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
41979  if (likely(__pyx_t_14)) {
41980  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
41981  __Pyx_INCREF(__pyx_t_14);
41982  __Pyx_INCREF(function);
41983  __Pyx_DECREF_SET(__pyx_t_6, function);
41984  }
41985  }
41986  __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_2);
41987  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
41988  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2268, __pyx_L32_except_error)
41989  __Pyx_GOTREF(__pyx_t_11);
41990  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
41991  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
41992 
41993  /* "WaveTools.py":2269
41994  * except:
41995  * logEvent("ERROR! WaveTools.py: Dictionary key 'Tm' (mean or characteristic wave period) not found in window_params dictionary")
41996  * sys.exit(1) # <<<<<<<<<<<<<<
41997  *
41998  * try:
41999  */
42000  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sys); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2269, __pyx_L32_except_error)
42001  __Pyx_GOTREF(__pyx_t_6);
42002  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_exit); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2269, __pyx_L32_except_error)
42003  __Pyx_GOTREF(__pyx_t_14);
42004  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42005  __pyx_t_6 = NULL;
42006  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
42007  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_14);
42008  if (likely(__pyx_t_6)) {
42009  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
42010  __Pyx_INCREF(__pyx_t_6);
42011  __Pyx_INCREF(function);
42012  __Pyx_DECREF_SET(__pyx_t_14, function);
42013  }
42014  }
42015  __pyx_t_11 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_6, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_int_1);
42016  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
42017  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2269, __pyx_L32_except_error)
42018  __Pyx_GOTREF(__pyx_t_11);
42019  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42020  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42021  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42022  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42023  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42024  goto __pyx_L31_exception_handled;
42025  }
42026  __pyx_L32_except_error:;
42027 
42028  /* "WaveTools.py":2265
42029  * sys.exit(1)
42030  *
42031  * try: # <<<<<<<<<<<<<<
42032  * self.Tm = window_params["Tm"]
42033  * except:
42034  */
42035  __Pyx_XGIVEREF(__pyx_t_22);
42036  __Pyx_XGIVEREF(__pyx_t_21);
42037  __Pyx_XGIVEREF(__pyx_t_20);
42038  __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
42039  goto __pyx_L1_error;
42040  __pyx_L31_exception_handled:;
42041  __Pyx_XGIVEREF(__pyx_t_22);
42042  __Pyx_XGIVEREF(__pyx_t_21);
42043  __Pyx_XGIVEREF(__pyx_t_20);
42044  __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
42045  __pyx_L35_try_end:;
42046  }
42047 
42048  /* "WaveTools.py":2271
42049  * sys.exit(1)
42050  *
42051  * try: # <<<<<<<<<<<<<<
42052  * windowName = window_params["Window"]
42053  * except:
42054  */
42055  {
42056  __Pyx_PyThreadState_declare
42057  __Pyx_PyThreadState_assign
42058  __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
42059  __Pyx_XGOTREF(__pyx_t_20);
42060  __Pyx_XGOTREF(__pyx_t_21);
42061  __Pyx_XGOTREF(__pyx_t_22);
42062  /*try:*/ {
42063 
42064  /* "WaveTools.py":2272
42065  *
42066  * try:
42067  * windowName = window_params["Window"] # <<<<<<<<<<<<<<
42068  * except:
42069  * logEvent("ERROR! WaveTools.py: Dictionary key 'Window' (window function type) not found in window_params dictionary")
42070  */
42071  __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_window_params, __pyx_n_s_Window); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2272, __pyx_L38_error)
42072  __Pyx_GOTREF(__pyx_t_5);
42073  __pyx_v_windowName = __pyx_t_5;
42074  __pyx_t_5 = 0;
42075 
42076  /* "WaveTools.py":2271
42077  * sys.exit(1)
42078  *
42079  * try: # <<<<<<<<<<<<<<
42080  * windowName = window_params["Window"]
42081  * except:
42082  */
42083  }
42084  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
42085  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
42086  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
42087  goto __pyx_L43_try_end;
42088  __pyx_L38_error:;
42089  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42090  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
42091  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
42092  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42093  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42094  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42095  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42096 
42097  /* "WaveTools.py":2273
42098  * try:
42099  * windowName = window_params["Window"]
42100  * except: # <<<<<<<<<<<<<<
42101  * logEvent("ERROR! WaveTools.py: Dictionary key 'Window' (window function type) not found in window_params dictionary")
42102  * sys.exit(1)
42103  */
42104  /*except:*/ {
42105  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
42106  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_12, &__pyx_t_7) < 0) __PYX_ERR(0, 2273, __pyx_L40_except_error)
42107  __Pyx_GOTREF(__pyx_t_5);
42108  __Pyx_GOTREF(__pyx_t_12);
42109  __Pyx_GOTREF(__pyx_t_7);
42110 
42111  /* "WaveTools.py":2274
42112  * windowName = window_params["Window"]
42113  * except:
42114  * logEvent("ERROR! WaveTools.py: Dictionary key 'Window' (window function type) not found in window_params dictionary") # <<<<<<<<<<<<<<
42115  * sys.exit(1)
42116  *
42117  */
42118  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2274, __pyx_L40_except_error)
42119  __Pyx_GOTREF(__pyx_t_14);
42120  __pyx_t_6 = NULL;
42121  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
42122  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_14);
42123  if (likely(__pyx_t_6)) {
42124  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
42125  __Pyx_INCREF(__pyx_t_6);
42126  __Pyx_INCREF(function);
42127  __Pyx_DECREF_SET(__pyx_t_14, function);
42128  }
42129  }
42130  __pyx_t_11 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_6, __pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_3) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_3);
42131  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
42132  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2274, __pyx_L40_except_error)
42133  __Pyx_GOTREF(__pyx_t_11);
42134  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42135  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42136 
42137  /* "WaveTools.py":2275
42138  * except:
42139  * logEvent("ERROR! WaveTools.py: Dictionary key 'Window' (window function type) not found in window_params dictionary")
42140  * sys.exit(1) # <<<<<<<<<<<<<<
42141  *
42142  * if(self.Nwaves > 0.5*self.tlength / self.Tm):
42143  */
42144  __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_sys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2275, __pyx_L40_except_error)
42145  __Pyx_GOTREF(__pyx_t_14);
42146  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2275, __pyx_L40_except_error)
42147  __Pyx_GOTREF(__pyx_t_6);
42148  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42149  __pyx_t_14 = NULL;
42150  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
42151  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
42152  if (likely(__pyx_t_14)) {
42153  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
42154  __Pyx_INCREF(__pyx_t_14);
42155  __Pyx_INCREF(function);
42156  __Pyx_DECREF_SET(__pyx_t_6, function);
42157  }
42158  }
42159  __pyx_t_11 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
42160  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
42161  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2275, __pyx_L40_except_error)
42162  __Pyx_GOTREF(__pyx_t_11);
42163  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42164  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42165  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42166  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42167  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42168  goto __pyx_L39_exception_handled;
42169  }
42170  __pyx_L40_except_error:;
42171 
42172  /* "WaveTools.py":2271
42173  * sys.exit(1)
42174  *
42175  * try: # <<<<<<<<<<<<<<
42176  * windowName = window_params["Window"]
42177  * except:
42178  */
42179  __Pyx_XGIVEREF(__pyx_t_20);
42180  __Pyx_XGIVEREF(__pyx_t_21);
42181  __Pyx_XGIVEREF(__pyx_t_22);
42182  __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
42183  goto __pyx_L1_error;
42184  __pyx_L39_exception_handled:;
42185  __Pyx_XGIVEREF(__pyx_t_20);
42186  __Pyx_XGIVEREF(__pyx_t_21);
42187  __Pyx_XGIVEREF(__pyx_t_22);
42188  __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
42189  __pyx_L43_try_end:;
42190  }
42191 
42192  /* "WaveTools.py":2277
42193  * sys.exit(1)
42194  *
42195  * if(self.Nwaves > 0.5*self.tlength / self.Tm): # <<<<<<<<<<<<<<
42196  * logEvent("ERROR! WaveTools.py: Reconstruction is expected to have two windows or more. Plese reduce the number of waves per window or switch to direct decomposition )")
42197  * sys.exit(1)
42198  */
42199  __pyx_t_2 = (0.5 * __pyx_v_self->tlength);
42200  if (unlikely(__pyx_v_self->Tm == 0)) {
42201  PyErr_SetString(PyExc_ZeroDivisionError, "float division");
42202  __PYX_ERR(0, 2277, __pyx_L1_error)
42203  }
42204  __pyx_t_10 = ((__pyx_v_self->Nwaves > (__pyx_t_2 / __pyx_v_self->Tm)) != 0);
42205  if (__pyx_t_10) {
42206 
42207  /* "WaveTools.py":2278
42208  *
42209  * if(self.Nwaves > 0.5*self.tlength / self.Tm):
42210  * logEvent("ERROR! WaveTools.py: Reconstruction is expected to have two windows or more. Plese reduce the number of waves per window or switch to direct decomposition )") # <<<<<<<<<<<<<<
42211  * sys.exit(1)
42212  *
42213  */
42214  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2278, __pyx_L1_error)
42215  __Pyx_GOTREF(__pyx_t_12);
42216  __pyx_t_5 = NULL;
42217  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
42218  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_12);
42219  if (likely(__pyx_t_5)) {
42220  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
42221  __Pyx_INCREF(__pyx_t_5);
42222  __Pyx_INCREF(function);
42223  __Pyx_DECREF_SET(__pyx_t_12, function);
42224  }
42225  }
42226  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_5, __pyx_kp_s_ERROR_WaveTools_py_Reconstructio) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_s_ERROR_WaveTools_py_Reconstructio);
42227  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42228  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2278, __pyx_L1_error)
42229  __Pyx_GOTREF(__pyx_t_7);
42230  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42231  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
42232 
42233  /* "WaveTools.py":2279
42234  * if(self.Nwaves > 0.5*self.tlength / self.Tm):
42235  * logEvent("ERROR! WaveTools.py: Reconstruction is expected to have two windows or more. Plese reduce the number of waves per window or switch to direct decomposition )")
42236  * sys.exit(1) # <<<<<<<<<<<<<<
42237  *
42238  *
42239  */
42240  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2279, __pyx_L1_error)
42241  __Pyx_GOTREF(__pyx_t_12);
42242  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2279, __pyx_L1_error)
42243  __Pyx_GOTREF(__pyx_t_5);
42244  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42245  __pyx_t_12 = NULL;
42246  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
42247  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
42248  if (likely(__pyx_t_12)) {
42249  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
42250  __Pyx_INCREF(__pyx_t_12);
42251  __Pyx_INCREF(function);
42252  __Pyx_DECREF_SET(__pyx_t_5, function);
42253  }
42254  }
42255  __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_12, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_1);
42256  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42257  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2279, __pyx_L1_error)
42258  __Pyx_GOTREF(__pyx_t_7);
42259  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42260  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
42261 
42262  /* "WaveTools.py":2277
42263  * sys.exit(1)
42264  *
42265  * if(self.Nwaves > 0.5*self.tlength / self.Tm): # <<<<<<<<<<<<<<
42266  * logEvent("ERROR! WaveTools.py: Reconstruction is expected to have two windows or more. Plese reduce the number of waves per window or switch to direct decomposition )")
42267  * sys.exit(1)
42268  */
42269  }
42270 
42271  /* "WaveTools.py":2283
42272  *
42273  *
42274  * validWindows = [costap, tophat] # <<<<<<<<<<<<<<
42275  * wind_filt = loadExistingFunction(windowName, validWindows)
42276  * logEvent("INFO WaveTools.py: performing series decomposition with spectral windows")
42277  */
42278  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_costap); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2283, __pyx_L1_error)
42279  __Pyx_GOTREF(__pyx_t_7);
42280  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tophat); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2283, __pyx_L1_error)
42281  __Pyx_GOTREF(__pyx_t_5);
42282  __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2283, __pyx_L1_error)
42283  __Pyx_GOTREF(__pyx_t_12);
42284  __Pyx_GIVEREF(__pyx_t_7);
42285  PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
42286  __Pyx_GIVEREF(__pyx_t_5);
42287  PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_5);
42288  __pyx_t_7 = 0;
42289  __pyx_t_5 = 0;
42290  __pyx_v_validWindows = ((PyObject*)__pyx_t_12);
42291  __pyx_t_12 = 0;
42292 
42293  /* "WaveTools.py":2284
42294  *
42295  * validWindows = [costap, tophat]
42296  * wind_filt = loadExistingFunction(windowName, validWindows) # <<<<<<<<<<<<<<
42297  * logEvent("INFO WaveTools.py: performing series decomposition with spectral windows")
42298  * # Portion of overlap, compared to window time
42299  */
42300  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_loadExistingFunction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2284, __pyx_L1_error)
42301  __Pyx_GOTREF(__pyx_t_5);
42302  if (unlikely(!__pyx_v_windowName)) { __Pyx_RaiseUnboundLocalError("windowName"); __PYX_ERR(0, 2284, __pyx_L1_error) }
42303  __pyx_t_7 = NULL;
42304  __pyx_t_3 = 0;
42305  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
42306  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
42307  if (likely(__pyx_t_7)) {
42308  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
42309  __Pyx_INCREF(__pyx_t_7);
42310  __Pyx_INCREF(function);
42311  __Pyx_DECREF_SET(__pyx_t_5, function);
42312  __pyx_t_3 = 1;
42313  }
42314  }
42315  #if CYTHON_FAST_PYCALL
42316  if (PyFunction_Check(__pyx_t_5)) {
42317  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_windowName, __pyx_v_validWindows};
42318  __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2284, __pyx_L1_error)
42319  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42320  __Pyx_GOTREF(__pyx_t_12);
42321  } else
42322  #endif
42323  #if CYTHON_FAST_PYCCALL
42324  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
42325  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_windowName, __pyx_v_validWindows};
42326  __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2284, __pyx_L1_error)
42327  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42328  __Pyx_GOTREF(__pyx_t_12);
42329  } else
42330  #endif
42331  {
42332  __pyx_t_11 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2284, __pyx_L1_error)
42333  __Pyx_GOTREF(__pyx_t_11);
42334  if (__pyx_t_7) {
42335  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
42336  }
42337  __Pyx_INCREF(__pyx_v_windowName);
42338  __Pyx_GIVEREF(__pyx_v_windowName);
42339  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_3, __pyx_v_windowName);
42340  __Pyx_INCREF(__pyx_v_validWindows);
42341  __Pyx_GIVEREF(__pyx_v_validWindows);
42342  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_3, __pyx_v_validWindows);
42343  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2284, __pyx_L1_error)
42344  __Pyx_GOTREF(__pyx_t_12);
42345  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42346  }
42347  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42348  __pyx_v_wind_filt = __pyx_t_12;
42349  __pyx_t_12 = 0;
42350 
42351  /* "WaveTools.py":2285
42352  * validWindows = [costap, tophat]
42353  * wind_filt = loadExistingFunction(windowName, validWindows)
42354  * logEvent("INFO WaveTools.py: performing series decomposition with spectral windows") # <<<<<<<<<<<<<<
42355  * # Portion of overlap, compared to window time
42356  * try:
42357  */
42358  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2285, __pyx_L1_error)
42359  __Pyx_GOTREF(__pyx_t_5);
42360  __pyx_t_11 = NULL;
42361  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
42362  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
42363  if (likely(__pyx_t_11)) {
42364  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
42365  __Pyx_INCREF(__pyx_t_11);
42366  __Pyx_INCREF(function);
42367  __Pyx_DECREF_SET(__pyx_t_5, function);
42368  }
42369  }
42370  __pyx_t_12 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_11, __pyx_kp_s_INFO_WaveTools_py_performing_ser) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_INFO_WaveTools_py_performing_ser);
42371  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42372  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2285, __pyx_L1_error)
42373  __Pyx_GOTREF(__pyx_t_12);
42374  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42375  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42376 
42377  /* "WaveTools.py":2287
42378  * logEvent("INFO WaveTools.py: performing series decomposition with spectral windows")
42379  * # Portion of overlap, compared to window time
42380  * try: # <<<<<<<<<<<<<<
42381  * self.overlap = window_params["Overlap"]
42382  * except:
42383  */
42384  {
42385  __Pyx_PyThreadState_declare
42386  __Pyx_PyThreadState_assign
42387  __Pyx_ExceptionSave(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
42388  __Pyx_XGOTREF(__pyx_t_22);
42389  __Pyx_XGOTREF(__pyx_t_21);
42390  __Pyx_XGOTREF(__pyx_t_20);
42391  /*try:*/ {
42392 
42393  /* "WaveTools.py":2288
42394  * # Portion of overlap, compared to window time
42395  * try:
42396  * self.overlap = window_params["Overlap"] # <<<<<<<<<<<<<<
42397  * except:
42398  * self.overlap = 0.7
42399  */
42400  __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_v_window_params, __pyx_n_s_Overlap); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2288, __pyx_L47_error)
42401  __Pyx_GOTREF(__pyx_t_12);
42402  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2288, __pyx_L47_error)
42403  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42404  __pyx_v_self->overlap = __pyx_t_2;
42405 
42406  /* "WaveTools.py":2287
42407  * logEvent("INFO WaveTools.py: performing series decomposition with spectral windows")
42408  * # Portion of overlap, compared to window time
42409  * try: # <<<<<<<<<<<<<<
42410  * self.overlap = window_params["Overlap"]
42411  * except:
42412  */
42413  }
42414  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
42415  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
42416  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
42417  goto __pyx_L52_try_end;
42418  __pyx_L47_error:;
42419  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42420  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
42421  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
42422  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42423  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42424  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42425  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42426 
42427  /* "WaveTools.py":2289
42428  * try:
42429  * self.overlap = window_params["Overlap"]
42430  * except: # <<<<<<<<<<<<<<
42431  * self.overlap = 0.7
42432  * logEvent("INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)")
42433  */
42434  /*except:*/ {
42435  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
42436  if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_5, &__pyx_t_11) < 0) __PYX_ERR(0, 2289, __pyx_L49_except_error)
42437  __Pyx_GOTREF(__pyx_t_12);
42438  __Pyx_GOTREF(__pyx_t_5);
42439  __Pyx_GOTREF(__pyx_t_11);
42440 
42441  /* "WaveTools.py":2290
42442  * self.overlap = window_params["Overlap"]
42443  * except:
42444  * self.overlap = 0.7 # <<<<<<<<<<<<<<
42445  * logEvent("INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)")
42446  *
42447  */
42448  __pyx_v_self->overlap = 0.7;
42449 
42450  /* "WaveTools.py":2291
42451  * except:
42452  * self.overlap = 0.7
42453  * logEvent("INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)") # <<<<<<<<<<<<<<
42454  *
42455  * try:
42456  */
42457  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2291, __pyx_L49_except_error)
42458  __Pyx_GOTREF(__pyx_t_6);
42459  __pyx_t_14 = NULL;
42460  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
42461  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
42462  if (likely(__pyx_t_14)) {
42463  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
42464  __Pyx_INCREF(__pyx_t_14);
42465  __Pyx_INCREF(function);
42466  __Pyx_DECREF_SET(__pyx_t_6, function);
42467  }
42468  }
42469  __pyx_t_7 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_kp_s_INFO_WaveTools_py_Overlap_entry) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_INFO_WaveTools_py_Overlap_entry);
42470  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
42471  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2291, __pyx_L49_except_error)
42472  __Pyx_GOTREF(__pyx_t_7);
42473  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42474  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
42475  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42476  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42477  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42478  goto __pyx_L48_exception_handled;
42479  }
42480  __pyx_L49_except_error:;
42481 
42482  /* "WaveTools.py":2287
42483  * logEvent("INFO WaveTools.py: performing series decomposition with spectral windows")
42484  * # Portion of overlap, compared to window time
42485  * try: # <<<<<<<<<<<<<<
42486  * self.overlap = window_params["Overlap"]
42487  * except:
42488  */
42489  __Pyx_XGIVEREF(__pyx_t_22);
42490  __Pyx_XGIVEREF(__pyx_t_21);
42491  __Pyx_XGIVEREF(__pyx_t_20);
42492  __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
42493  goto __pyx_L1_error;
42494  __pyx_L48_exception_handled:;
42495  __Pyx_XGIVEREF(__pyx_t_22);
42496  __Pyx_XGIVEREF(__pyx_t_21);
42497  __Pyx_XGIVEREF(__pyx_t_20);
42498  __Pyx_ExceptionReset(__pyx_t_22, __pyx_t_21, __pyx_t_20);
42499  __pyx_L52_try_end:;
42500  }
42501 
42502  /* "WaveTools.py":2293
42503  * logEvent("INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)")
42504  *
42505  * try: # <<<<<<<<<<<<<<
42506  * self.cutoff = window_params["Cutoff"]
42507  * except:
42508  */
42509  {
42510  __Pyx_PyThreadState_declare
42511  __Pyx_PyThreadState_assign
42512  __Pyx_ExceptionSave(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
42513  __Pyx_XGOTREF(__pyx_t_20);
42514  __Pyx_XGOTREF(__pyx_t_21);
42515  __Pyx_XGOTREF(__pyx_t_22);
42516  /*try:*/ {
42517 
42518  /* "WaveTools.py":2294
42519  *
42520  * try:
42521  * self.cutoff = window_params["Cutoff"] # <<<<<<<<<<<<<<
42522  * except:
42523  * self.cutoff= 0.1
42524  */
42525  __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_window_params, __pyx_n_s_Cutoff); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2294, __pyx_L55_error)
42526  __Pyx_GOTREF(__pyx_t_11);
42527  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2294, __pyx_L55_error)
42528  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42529  __pyx_v_self->cutoff = __pyx_t_2;
42530 
42531  /* "WaveTools.py":2293
42532  * logEvent("INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)")
42533  *
42534  * try: # <<<<<<<<<<<<<<
42535  * self.cutoff = window_params["Cutoff"]
42536  * except:
42537  */
42538  }
42539  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
42540  __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
42541  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
42542  goto __pyx_L60_try_end;
42543  __pyx_L55_error:;
42544  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42545  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
42546  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
42547  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42548  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42549  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42550  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42551 
42552  /* "WaveTools.py":2295
42553  * try:
42554  * self.cutoff = window_params["Cutoff"]
42555  * except: # <<<<<<<<<<<<<<
42556  * self.cutoff= 0.1
42557  * logEvent("INFO WaveTools.py: Cutoff entry in window_params dictionary not found. Setting default value of 0.1 (1/10 of the window length)")
42558  */
42559  /*except:*/ {
42560  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
42561  if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_5, &__pyx_t_12) < 0) __PYX_ERR(0, 2295, __pyx_L57_except_error)
42562  __Pyx_GOTREF(__pyx_t_11);
42563  __Pyx_GOTREF(__pyx_t_5);
42564  __Pyx_GOTREF(__pyx_t_12);
42565 
42566  /* "WaveTools.py":2296
42567  * self.cutoff = window_params["Cutoff"]
42568  * except:
42569  * self.cutoff= 0.1 # <<<<<<<<<<<<<<
42570  * logEvent("INFO WaveTools.py: Cutoff entry in window_params dictionary not found. Setting default value of 0.1 (1/10 of the window length)")
42571  *
42572  */
42573  __pyx_v_self->cutoff = 0.1;
42574 
42575  /* "WaveTools.py":2297
42576  * except:
42577  * self.cutoff= 0.1
42578  * logEvent("INFO WaveTools.py: Cutoff entry in window_params dictionary not found. Setting default value of 0.1 (1/10 of the window length)") # <<<<<<<<<<<<<<
42579  *
42580  *
42581  */
42582  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2297, __pyx_L57_except_error)
42583  __Pyx_GOTREF(__pyx_t_6);
42584  __pyx_t_14 = NULL;
42585  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
42586  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
42587  if (likely(__pyx_t_14)) {
42588  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
42589  __Pyx_INCREF(__pyx_t_14);
42590  __Pyx_INCREF(function);
42591  __Pyx_DECREF_SET(__pyx_t_6, function);
42592  }
42593  }
42594  __pyx_t_7 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_kp_s_INFO_WaveTools_py_Cutoff_entry_i) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_INFO_WaveTools_py_Cutoff_entry_i);
42595  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
42596  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2297, __pyx_L57_except_error)
42597  __Pyx_GOTREF(__pyx_t_7);
42598  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42599  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
42600  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42601  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
42602  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42603  goto __pyx_L56_exception_handled;
42604  }
42605  __pyx_L57_except_error:;
42606 
42607  /* "WaveTools.py":2293
42608  * logEvent("INFO WaveTools.py: Overlap entry in window_params dictionary not found. Setting default value of 0.7 (70% of the window length)")
42609  *
42610  * try: # <<<<<<<<<<<<<<
42611  * self.cutoff = window_params["Cutoff"]
42612  * except:
42613  */
42614  __Pyx_XGIVEREF(__pyx_t_20);
42615  __Pyx_XGIVEREF(__pyx_t_21);
42616  __Pyx_XGIVEREF(__pyx_t_22);
42617  __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
42618  goto __pyx_L1_error;
42619  __pyx_L56_exception_handled:;
42620  __Pyx_XGIVEREF(__pyx_t_20);
42621  __Pyx_XGIVEREF(__pyx_t_21);
42622  __Pyx_XGIVEREF(__pyx_t_22);
42623  __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
42624  __pyx_L60_try_end:;
42625  }
42626 
42627  /* "WaveTools.py":2303
42628  * # Portion of window filtered with the Costap filter
42629  * # Setting the handover time, either at the middle of the overlap or just after the filter
42630  * self.handover = max(1.1 *self.cutoff, old_div(self.overlap, 2.)) # <<<<<<<<<<<<<<
42631  * if (self.handover > 0.9 * self.overlap):
42632  * logEvent("ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap")
42633  */
42634  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2303, __pyx_L1_error)
42635  __Pyx_GOTREF(__pyx_t_5);
42636  __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->overlap); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2303, __pyx_L1_error)
42637  __Pyx_GOTREF(__pyx_t_11);
42638  __pyx_t_7 = NULL;
42639  __pyx_t_3 = 0;
42640  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
42641  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
42642  if (likely(__pyx_t_7)) {
42643  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
42644  __Pyx_INCREF(__pyx_t_7);
42645  __Pyx_INCREF(function);
42646  __Pyx_DECREF_SET(__pyx_t_5, function);
42647  __pyx_t_3 = 1;
42648  }
42649  }
42650  #if CYTHON_FAST_PYCALL
42651  if (PyFunction_Check(__pyx_t_5)) {
42652  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_11, __pyx_float_2_};
42653  __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2303, __pyx_L1_error)
42654  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42655  __Pyx_GOTREF(__pyx_t_12);
42656  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42657  } else
42658  #endif
42659  #if CYTHON_FAST_PYCCALL
42660  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
42661  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_11, __pyx_float_2_};
42662  __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2303, __pyx_L1_error)
42663  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42664  __Pyx_GOTREF(__pyx_t_12);
42665  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42666  } else
42667  #endif
42668  {
42669  __pyx_t_6 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2303, __pyx_L1_error)
42670  __Pyx_GOTREF(__pyx_t_6);
42671  if (__pyx_t_7) {
42672  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
42673  }
42674  __Pyx_GIVEREF(__pyx_t_11);
42675  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, __pyx_t_11);
42676  __Pyx_INCREF(__pyx_float_2_);
42677  __Pyx_GIVEREF(__pyx_float_2_);
42678  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_float_2_);
42679  __pyx_t_11 = 0;
42680  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2303, __pyx_L1_error)
42681  __Pyx_GOTREF(__pyx_t_12);
42682  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42683  }
42684  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42685  __pyx_t_2 = (1.1 * __pyx_v_self->cutoff);
42686  __pyx_t_6 = PyFloat_FromDouble(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2303, __pyx_L1_error)
42687  __Pyx_GOTREF(__pyx_t_6);
42688  __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2303, __pyx_L1_error)
42689  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42690  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2303, __pyx_L1_error)
42691  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42692  if (__pyx_t_10) {
42693  __Pyx_INCREF(__pyx_t_12);
42694  __pyx_t_5 = __pyx_t_12;
42695  } else {
42696  __pyx_t_11 = PyFloat_FromDouble(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2303, __pyx_L1_error)
42697  __Pyx_GOTREF(__pyx_t_11);
42698  __pyx_t_5 = __pyx_t_11;
42699  __pyx_t_11 = 0;
42700  }
42701  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42702  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L1_error)
42703  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42704  __pyx_v_self->handover = __pyx_t_2;
42705 
42706  /* "WaveTools.py":2304
42707  * # Setting the handover time, either at the middle of the overlap or just after the filter
42708  * self.handover = max(1.1 *self.cutoff, old_div(self.overlap, 2.))
42709  * if (self.handover > 0.9 * self.overlap): # <<<<<<<<<<<<<<
42710  * logEvent("ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap")
42711  * sys.exit(1)
42712  */
42713  __pyx_t_10 = ((__pyx_v_self->handover > (0.9 * __pyx_v_self->overlap)) != 0);
42714  if (__pyx_t_10) {
42715 
42716  /* "WaveTools.py":2305
42717  * self.handover = max(1.1 *self.cutoff, old_div(self.overlap, 2.))
42718  * if (self.handover > 0.9 * self.overlap):
42719  * logEvent("ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap") # <<<<<<<<<<<<<<
42720  * sys.exit(1)
42721  * self.Twindow = self.Tm * self.Nwaves # setting the window duration (approx.). Twindow = Tmean * Nwaves
42722  */
42723  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2305, __pyx_L1_error)
42724  __Pyx_GOTREF(__pyx_t_12);
42725  __pyx_t_11 = NULL;
42726  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
42727  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
42728  if (likely(__pyx_t_11)) {
42729  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
42730  __Pyx_INCREF(__pyx_t_11);
42731  __Pyx_INCREF(function);
42732  __Pyx_DECREF_SET(__pyx_t_12, function);
42733  }
42734  }
42735  __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_11, __pyx_kp_s_ERROR_Wavetools_py_Window_handov) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_s_ERROR_Wavetools_py_Window_handov);
42736  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
42737  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2305, __pyx_L1_error)
42738  __Pyx_GOTREF(__pyx_t_5);
42739  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42740  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42741 
42742  /* "WaveTools.py":2306
42743  * if (self.handover > 0.9 * self.overlap):
42744  * logEvent("ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap")
42745  * sys.exit(1) # <<<<<<<<<<<<<<
42746  * self.Twindow = self.Tm * self.Nwaves # setting the window duration (approx.). Twindow = Tmean * Nwaves
42747  * self.Toverlap = self.overlap * self.Twindow
42748  */
42749  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2306, __pyx_L1_error)
42750  __Pyx_GOTREF(__pyx_t_12);
42751  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2306, __pyx_L1_error)
42752  __Pyx_GOTREF(__pyx_t_11);
42753  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42754  __pyx_t_12 = NULL;
42755  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
42756  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
42757  if (likely(__pyx_t_12)) {
42758  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
42759  __Pyx_INCREF(__pyx_t_12);
42760  __Pyx_INCREF(function);
42761  __Pyx_DECREF_SET(__pyx_t_11, function);
42762  }
42763  }
42764  __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_int_1);
42765  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42766  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2306, __pyx_L1_error)
42767  __Pyx_GOTREF(__pyx_t_5);
42768  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42769  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42770 
42771  /* "WaveTools.py":2304
42772  * # Setting the handover time, either at the middle of the overlap or just after the filter
42773  * self.handover = max(1.1 *self.cutoff, old_div(self.overlap, 2.))
42774  * if (self.handover > 0.9 * self.overlap): # <<<<<<<<<<<<<<
42775  * logEvent("ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap")
42776  * sys.exit(1)
42777  */
42778  }
42779 
42780  /* "WaveTools.py":2307
42781  * logEvent("ERROR! Wavetools.py: Window handover is not optimal as the cutoff is too close to the overlap. Decrease cutoff or increase overlap")
42782  * sys.exit(1)
42783  * self.Twindow = self.Tm * self.Nwaves # setting the window duration (approx.). Twindow = Tmean * Nwaves # <<<<<<<<<<<<<<
42784  * self.Toverlap = self.overlap * self.Twindow
42785  * self.Nwindows = int( old_div((self.tlength - self.Twindow ), (self.Twindow - self.Toverlap)) ) + 1 #Getting the actual number of windows (N-1) * (Twindow - Toverlap) + Twindow = total time
42786  */
42787  __pyx_v_self->Twindow = (__pyx_v_self->Tm * __pyx_v_self->Nwaves);
42788 
42789  /* "WaveTools.py":2308
42790  * sys.exit(1)
42791  * self.Twindow = self.Tm * self.Nwaves # setting the window duration (approx.). Twindow = Tmean * Nwaves
42792  * self.Toverlap = self.overlap * self.Twindow # <<<<<<<<<<<<<<
42793  * self.Nwindows = int( old_div((self.tlength - self.Twindow ), (self.Twindow - self.Toverlap)) ) + 1 #Getting the actual number of windows (N-1) * (Twindow - Toverlap) + Twindow = total time
42794  * self.Twindow = old_div(self.tlength,(1. + (1. - self.overlap)*(self.Nwindows-1))) # Correct Twindow and Toverlap for duration and integer number of windows
42795  */
42796  __pyx_v_self->Toverlap = (__pyx_v_self->overlap * __pyx_v_self->Twindow);
42797 
42798  /* "WaveTools.py":2309
42799  * self.Twindow = self.Tm * self.Nwaves # setting the window duration (approx.). Twindow = Tmean * Nwaves
42800  * self.Toverlap = self.overlap * self.Twindow
42801  * self.Nwindows = int( old_div((self.tlength - self.Twindow ), (self.Twindow - self.Toverlap)) ) + 1 #Getting the actual number of windows (N-1) * (Twindow - Toverlap) + Twindow = total time # <<<<<<<<<<<<<<
42802  * self.Twindow = old_div(self.tlength,(1. + (1. - self.overlap)*(self.Nwindows-1))) # Correct Twindow and Toverlap for duration and integer number of windows
42803  * self.Toverlap = self.overlap*self.Twindow
42804  */
42805  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_old_div); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2309, __pyx_L1_error)
42806  __Pyx_GOTREF(__pyx_t_11);
42807  __pyx_t_12 = PyFloat_FromDouble((__pyx_v_self->tlength - __pyx_v_self->Twindow)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2309, __pyx_L1_error)
42808  __Pyx_GOTREF(__pyx_t_12);
42809  __pyx_t_6 = PyFloat_FromDouble((__pyx_v_self->Twindow - __pyx_v_self->Toverlap)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2309, __pyx_L1_error)
42810  __Pyx_GOTREF(__pyx_t_6);
42811  __pyx_t_7 = NULL;
42812  __pyx_t_3 = 0;
42813  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
42814  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
42815  if (likely(__pyx_t_7)) {
42816  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
42817  __Pyx_INCREF(__pyx_t_7);
42818  __Pyx_INCREF(function);
42819  __Pyx_DECREF_SET(__pyx_t_11, function);
42820  __pyx_t_3 = 1;
42821  }
42822  }
42823  #if CYTHON_FAST_PYCALL
42824  if (PyFunction_Check(__pyx_t_11)) {
42825  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_12, __pyx_t_6};
42826  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2309, __pyx_L1_error)
42827  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42828  __Pyx_GOTREF(__pyx_t_5);
42829  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42830  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42831  } else
42832  #endif
42833  #if CYTHON_FAST_PYCCALL
42834  if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
42835  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_12, __pyx_t_6};
42836  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2309, __pyx_L1_error)
42837  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
42838  __Pyx_GOTREF(__pyx_t_5);
42839  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42840  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42841  } else
42842  #endif
42843  {
42844  __pyx_t_14 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2309, __pyx_L1_error)
42845  __Pyx_GOTREF(__pyx_t_14);
42846  if (__pyx_t_7) {
42847  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
42848  }
42849  __Pyx_GIVEREF(__pyx_t_12);
42850  PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_3, __pyx_t_12);
42851  __Pyx_GIVEREF(__pyx_t_6);
42852  PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_3, __pyx_t_6);
42853  __pyx_t_12 = 0;
42854  __pyx_t_6 = 0;
42855  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2309, __pyx_L1_error)
42856  __Pyx_GOTREF(__pyx_t_5);
42857  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42858  }
42859  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42860  __pyx_t_11 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2309, __pyx_L1_error)
42861  __Pyx_GOTREF(__pyx_t_11);
42862  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42863  __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2309, __pyx_L1_error)
42864  __Pyx_GOTREF(__pyx_t_5);
42865  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42866  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2309, __pyx_L1_error)
42867  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42868  __pyx_v_self->Nwindows = __pyx_t_3;
42869 
42870  /* "WaveTools.py":2310
42871  * self.Toverlap = self.overlap * self.Twindow
42872  * self.Nwindows = int( old_div((self.tlength - self.Twindow ), (self.Twindow - self.Toverlap)) ) + 1 #Getting the actual number of windows (N-1) * (Twindow - Toverlap) + Twindow = total time
42873  * self.Twindow = old_div(self.tlength,(1. + (1. - self.overlap)*(self.Nwindows-1))) # Correct Twindow and Toverlap for duration and integer number of windows # <<<<<<<<<<<<<<
42874  * self.Toverlap = self.overlap*self.Twindow
42875  * logEvent("INFO: Wavetools.py: Correcting window duration for matching the exact time range of the series. Window duration correspond to %s waves approx." %(old_div(self.Twindow, self.Tm)) )
42876  */
42877  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_old_div); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2310, __pyx_L1_error)
42878  __Pyx_GOTREF(__pyx_t_11);
42879  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->tlength); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2310, __pyx_L1_error)
42880  __Pyx_GOTREF(__pyx_t_14);
42881  __pyx_t_6 = PyFloat_FromDouble((1. + ((1. - __pyx_v_self->overlap) * (__pyx_v_self->Nwindows - 1)))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2310, __pyx_L1_error)
42882  __Pyx_GOTREF(__pyx_t_6);
42883  __pyx_t_12 = NULL;
42884  __pyx_t_3 = 0;
42885  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
42886  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
42887  if (likely(__pyx_t_12)) {
42888  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
42889  __Pyx_INCREF(__pyx_t_12);
42890  __Pyx_INCREF(function);
42891  __Pyx_DECREF_SET(__pyx_t_11, function);
42892  __pyx_t_3 = 1;
42893  }
42894  }
42895  #if CYTHON_FAST_PYCALL
42896  if (PyFunction_Check(__pyx_t_11)) {
42897  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_14, __pyx_t_6};
42898  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2310, __pyx_L1_error)
42899  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42900  __Pyx_GOTREF(__pyx_t_5);
42901  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42902  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42903  } else
42904  #endif
42905  #if CYTHON_FAST_PYCCALL
42906  if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
42907  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_14, __pyx_t_6};
42908  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2310, __pyx_L1_error)
42909  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
42910  __Pyx_GOTREF(__pyx_t_5);
42911  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42912  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
42913  } else
42914  #endif
42915  {
42916  __pyx_t_7 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2310, __pyx_L1_error)
42917  __Pyx_GOTREF(__pyx_t_7);
42918  if (__pyx_t_12) {
42919  __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
42920  }
42921  __Pyx_GIVEREF(__pyx_t_14);
42922  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_3, __pyx_t_14);
42923  __Pyx_GIVEREF(__pyx_t_6);
42924  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_3, __pyx_t_6);
42925  __pyx_t_14 = 0;
42926  __pyx_t_6 = 0;
42927  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2310, __pyx_L1_error)
42928  __Pyx_GOTREF(__pyx_t_5);
42929  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
42930  }
42931  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
42932  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2310, __pyx_L1_error)
42933  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
42934  __pyx_v_self->Twindow = __pyx_t_2;
42935 
42936  /* "WaveTools.py":2311
42937  * self.Nwindows = int( old_div((self.tlength - self.Twindow ), (self.Twindow - self.Toverlap)) ) + 1 #Getting the actual number of windows (N-1) * (Twindow - Toverlap) + Twindow = total time
42938  * self.Twindow = old_div(self.tlength,(1. + (1. - self.overlap)*(self.Nwindows-1))) # Correct Twindow and Toverlap for duration and integer number of windows
42939  * self.Toverlap = self.overlap*self.Twindow # <<<<<<<<<<<<<<
42940  * logEvent("INFO: Wavetools.py: Correcting window duration for matching the exact time range of the series. Window duration correspond to %s waves approx." %(old_div(self.Twindow, self.Tm)) )
42941  * diff = (self.Nwindows-1.)*(self.Twindow -self.Toverlap)+self.Twindow - self.tlength
42942  */
42943  __pyx_v_self->Toverlap = (__pyx_v_self->overlap * __pyx_v_self->Twindow);
42944 
42945  /* "WaveTools.py":2312
42946  * self.Twindow = old_div(self.tlength,(1. + (1. - self.overlap)*(self.Nwindows-1))) # Correct Twindow and Toverlap for duration and integer number of windows
42947  * self.Toverlap = self.overlap*self.Twindow
42948  * logEvent("INFO: Wavetools.py: Correcting window duration for matching the exact time range of the series. Window duration correspond to %s waves approx." %(old_div(self.Twindow, self.Tm)) ) # <<<<<<<<<<<<<<
42949  * diff = (self.Nwindows-1.)*(self.Twindow -self.Toverlap)+self.Twindow - self.tlength
42950  * logEvent("INFO: Wavetools.py: Checking duration of windowed time series: %s per cent difference from original duration" %(100*diff) )
42951  */
42952  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2312, __pyx_L1_error)
42953  __Pyx_GOTREF(__pyx_t_11);
42954  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2312, __pyx_L1_error)
42955  __Pyx_GOTREF(__pyx_t_6);
42956  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->Twindow); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2312, __pyx_L1_error)
42957  __Pyx_GOTREF(__pyx_t_14);
42958  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->Tm); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2312, __pyx_L1_error)
42959  __Pyx_GOTREF(__pyx_t_12);
42960  __pyx_t_4 = NULL;
42961  __pyx_t_3 = 0;
42962  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
42963  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
42964  if (likely(__pyx_t_4)) {
42965  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
42966  __Pyx_INCREF(__pyx_t_4);
42967  __Pyx_INCREF(function);
42968  __Pyx_DECREF_SET(__pyx_t_6, function);
42969  __pyx_t_3 = 1;
42970  }
42971  }
42972  #if CYTHON_FAST_PYCALL
42973  if (PyFunction_Check(__pyx_t_6)) {
42974  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_14, __pyx_t_12};
42975  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2312, __pyx_L1_error)
42976  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42977  __Pyx_GOTREF(__pyx_t_7);
42978  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42979  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42980  } else
42981  #endif
42982  #if CYTHON_FAST_PYCCALL
42983  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
42984  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_14, __pyx_t_12};
42985  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2312, __pyx_L1_error)
42986  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
42987  __Pyx_GOTREF(__pyx_t_7);
42988  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
42989  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
42990  } else
42991  #endif
42992  {
42993  __pyx_t_23 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2312, __pyx_L1_error)
42994  __Pyx_GOTREF(__pyx_t_23);
42995  if (__pyx_t_4) {
42996  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_4); __pyx_t_4 = NULL;
42997  }
42998  __Pyx_GIVEREF(__pyx_t_14);
42999  PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_3, __pyx_t_14);
43000  __Pyx_GIVEREF(__pyx_t_12);
43001  PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_3, __pyx_t_12);
43002  __pyx_t_14 = 0;
43003  __pyx_t_12 = 0;
43004  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2312, __pyx_L1_error)
43005  __Pyx_GOTREF(__pyx_t_7);
43006  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43007  }
43008  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43009  __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_INFO_Wavetools_py_Correcting_win, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2312, __pyx_L1_error)
43010  __Pyx_GOTREF(__pyx_t_6);
43011  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43012  __pyx_t_7 = NULL;
43013  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
43014  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
43015  if (likely(__pyx_t_7)) {
43016  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
43017  __Pyx_INCREF(__pyx_t_7);
43018  __Pyx_INCREF(function);
43019  __Pyx_DECREF_SET(__pyx_t_11, function);
43020  }
43021  }
43022  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_6);
43023  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
43024  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43025  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2312, __pyx_L1_error)
43026  __Pyx_GOTREF(__pyx_t_5);
43027  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
43028  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43029 
43030  /* "WaveTools.py":2313
43031  * self.Toverlap = self.overlap*self.Twindow
43032  * logEvent("INFO: Wavetools.py: Correcting window duration for matching the exact time range of the series. Window duration correspond to %s waves approx." %(old_div(self.Twindow, self.Tm)) )
43033  * diff = (self.Nwindows-1.)*(self.Twindow -self.Toverlap)+self.Twindow - self.tlength # <<<<<<<<<<<<<<
43034  * logEvent("INFO: Wavetools.py: Checking duration of windowed time series: %s per cent difference from original duration" %(100*diff) )
43035  * logEvent("INFO: Wavetools.py: Using %s windows for reconstruction with %s sec duration and %s per cent overlap" %(self.Nwindows, self.Twindow,100*self.overlap ))
43036  */
43037  __pyx_v_diff = ((((__pyx_v_self->Nwindows - 1.) * (__pyx_v_self->Twindow - __pyx_v_self->Toverlap)) + __pyx_v_self->Twindow) - __pyx_v_self->tlength);
43038 
43039  /* "WaveTools.py":2314
43040  * logEvent("INFO: Wavetools.py: Correcting window duration for matching the exact time range of the series. Window duration correspond to %s waves approx." %(old_div(self.Twindow, self.Tm)) )
43041  * diff = (self.Nwindows-1.)*(self.Twindow -self.Toverlap)+self.Twindow - self.tlength
43042  * logEvent("INFO: Wavetools.py: Checking duration of windowed time series: %s per cent difference from original duration" %(100*diff) ) # <<<<<<<<<<<<<<
43043  * logEvent("INFO: Wavetools.py: Using %s windows for reconstruction with %s sec duration and %s per cent overlap" %(self.Nwindows, self.Twindow,100*self.overlap ))
43044  * # Setting where each window starts and ends
43045  */
43046  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2314, __pyx_L1_error)
43047  __Pyx_GOTREF(__pyx_t_11);
43048  __pyx_t_6 = PyFloat_FromDouble((100.0 * __pyx_v_diff)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2314, __pyx_L1_error)
43049  __Pyx_GOTREF(__pyx_t_6);
43050  __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_INFO_Wavetools_py_Checking_durat, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2314, __pyx_L1_error)
43051  __Pyx_GOTREF(__pyx_t_7);
43052  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43053  __pyx_t_6 = NULL;
43054  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
43055  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
43056  if (likely(__pyx_t_6)) {
43057  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
43058  __Pyx_INCREF(__pyx_t_6);
43059  __Pyx_INCREF(function);
43060  __Pyx_DECREF_SET(__pyx_t_11, function);
43061  }
43062  }
43063  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7);
43064  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
43065  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43066  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2314, __pyx_L1_error)
43067  __Pyx_GOTREF(__pyx_t_5);
43068  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
43069  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43070 
43071  /* "WaveTools.py":2315
43072  * diff = (self.Nwindows-1.)*(self.Twindow -self.Toverlap)+self.Twindow - self.tlength
43073  * logEvent("INFO: Wavetools.py: Checking duration of windowed time series: %s per cent difference from original duration" %(100*diff) )
43074  * logEvent("INFO: Wavetools.py: Using %s windows for reconstruction with %s sec duration and %s per cent overlap" %(self.Nwindows, self.Twindow,100*self.overlap )) # <<<<<<<<<<<<<<
43075  * # Setting where each window starts and ends
43076  * for jj in range(self.Nwindows):
43077  */
43078  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2315, __pyx_L1_error)
43079  __Pyx_GOTREF(__pyx_t_11);
43080  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->Nwindows); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2315, __pyx_L1_error)
43081  __Pyx_GOTREF(__pyx_t_7);
43082  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->Twindow); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2315, __pyx_L1_error)
43083  __Pyx_GOTREF(__pyx_t_6);
43084  __pyx_t_23 = PyFloat_FromDouble((100.0 * __pyx_v_self->overlap)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2315, __pyx_L1_error)
43085  __Pyx_GOTREF(__pyx_t_23);
43086  __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2315, __pyx_L1_error)
43087  __Pyx_GOTREF(__pyx_t_12);
43088  __Pyx_GIVEREF(__pyx_t_7);
43089  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
43090  __Pyx_GIVEREF(__pyx_t_6);
43091  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6);
43092  __Pyx_GIVEREF(__pyx_t_23);
43093  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_23);
43094  __pyx_t_7 = 0;
43095  __pyx_t_6 = 0;
43096  __pyx_t_23 = 0;
43097  __pyx_t_23 = __Pyx_PyString_Format(__pyx_kp_s_INFO_Wavetools_py_Using_s_window, __pyx_t_12); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2315, __pyx_L1_error)
43098  __Pyx_GOTREF(__pyx_t_23);
43099  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43100  __pyx_t_12 = NULL;
43101  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
43102  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
43103  if (likely(__pyx_t_12)) {
43104  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
43105  __Pyx_INCREF(__pyx_t_12);
43106  __Pyx_INCREF(function);
43107  __Pyx_DECREF_SET(__pyx_t_11, function);
43108  }
43109  }
43110  __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_23);
43111  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
43112  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43113  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2315, __pyx_L1_error)
43114  __Pyx_GOTREF(__pyx_t_5);
43115  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
43116  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43117 
43118  /* "WaveTools.py":2317
43119  * logEvent("INFO: Wavetools.py: Using %s windows for reconstruction with %s sec duration and %s per cent overlap" %(self.Nwindows, self.Twindow,100*self.overlap ))
43120  * # Setting where each window starts and ends
43121  * for jj in range(self.Nwindows): # <<<<<<<<<<<<<<
43122  * span = np.zeros(2,"d")
43123  * tfirst = self.time[0] + self.Twindow
43124  */
43125  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_range); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2317, __pyx_L1_error)
43126  __Pyx_GOTREF(__pyx_t_11);
43127  __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_self->Nwindows); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2317, __pyx_L1_error)
43128  __Pyx_GOTREF(__pyx_t_23);
43129  __pyx_t_12 = NULL;
43130  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
43131  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
43132  if (likely(__pyx_t_12)) {
43133  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
43134  __Pyx_INCREF(__pyx_t_12);
43135  __Pyx_INCREF(function);
43136  __Pyx_DECREF_SET(__pyx_t_11, function);
43137  }
43138  }
43139  __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_23);
43140  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
43141  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43142  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2317, __pyx_L1_error)
43143  __Pyx_GOTREF(__pyx_t_5);
43144  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
43145  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
43146  __pyx_t_11 = __pyx_t_5; __Pyx_INCREF(__pyx_t_11); __pyx_t_8 = 0;
43147  __pyx_t_13 = NULL;
43148  } else {
43149  __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2317, __pyx_L1_error)
43150  __Pyx_GOTREF(__pyx_t_11);
43151  __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2317, __pyx_L1_error)
43152  }
43153  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43154  for (;;) {
43155  if (likely(!__pyx_t_13)) {
43156  if (likely(PyList_CheckExact(__pyx_t_11))) {
43157  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_11)) break;
43158  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
43159  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2317, __pyx_L1_error)
43160  #else
43161  __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2317, __pyx_L1_error)
43162  __Pyx_GOTREF(__pyx_t_5);
43163  #endif
43164  } else {
43165  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
43166  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
43167  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2317, __pyx_L1_error)
43168  #else
43169  __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2317, __pyx_L1_error)
43170  __Pyx_GOTREF(__pyx_t_5);
43171  #endif
43172  }
43173  } else {
43174  __pyx_t_5 = __pyx_t_13(__pyx_t_11);
43175  if (unlikely(!__pyx_t_5)) {
43176  PyObject* exc_type = PyErr_Occurred();
43177  if (exc_type) {
43178  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
43179  else __PYX_ERR(0, 2317, __pyx_L1_error)
43180  }
43181  break;
43182  }
43183  __Pyx_GOTREF(__pyx_t_5);
43184  }
43185  __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_5);
43186  __pyx_t_5 = 0;
43187 
43188  /* "WaveTools.py":2318
43189  * # Setting where each window starts and ends
43190  * for jj in range(self.Nwindows):
43191  * span = np.zeros(2,"d") # <<<<<<<<<<<<<<
43192  * tfirst = self.time[0] + self.Twindow
43193  * tlast = self.time[-1] - self.Twindow
43194  */
43195  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2318, __pyx_L1_error)
43196  __Pyx_GOTREF(__pyx_t_5);
43197  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2318, __pyx_L1_error)
43198  __Pyx_GOTREF(__pyx_t_23);
43199  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43200  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2318, __pyx_L1_error)
43201  __Pyx_GOTREF(__pyx_t_5);
43202  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43203  __Pyx_XDECREF_SET(__pyx_v_span, __pyx_t_5);
43204  __pyx_t_5 = 0;
43205 
43206  /* "WaveTools.py":2319
43207  * for jj in range(self.Nwindows):
43208  * span = np.zeros(2,"d")
43209  * tfirst = self.time[0] + self.Twindow # <<<<<<<<<<<<<<
43210  * tlast = self.time[-1] - self.Twindow
43211  * if jj == 0:
43212  */
43213  __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->time), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2319, __pyx_L1_error)
43214  __Pyx_GOTREF(__pyx_t_5);
43215  __pyx_t_23 = PyFloat_FromDouble(__pyx_v_self->Twindow); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2319, __pyx_L1_error)
43216  __Pyx_GOTREF(__pyx_t_23);
43217  __pyx_t_12 = PyNumber_Add(__pyx_t_5, __pyx_t_23); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2319, __pyx_L1_error)
43218  __Pyx_GOTREF(__pyx_t_12);
43219  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43220  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43221  __Pyx_XDECREF_SET(__pyx_v_tfirst, __pyx_t_12);
43222  __pyx_t_12 = 0;
43223 
43224  /* "WaveTools.py":2320
43225  * span = np.zeros(2,"d")
43226  * tfirst = self.time[0] + self.Twindow
43227  * tlast = self.time[-1] - self.Twindow # <<<<<<<<<<<<<<
43228  * if jj == 0:
43229  * ispan1 = 0
43230  */
43231  __pyx_t_12 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->time), -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2320, __pyx_L1_error)
43232  __Pyx_GOTREF(__pyx_t_12);
43233  __pyx_t_23 = PyFloat_FromDouble(__pyx_v_self->Twindow); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2320, __pyx_L1_error)
43234  __Pyx_GOTREF(__pyx_t_23);
43235  __pyx_t_5 = PyNumber_Subtract(__pyx_t_12, __pyx_t_23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2320, __pyx_L1_error)
43236  __Pyx_GOTREF(__pyx_t_5);
43237  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43238  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43239  __Pyx_XDECREF_SET(__pyx_v_tlast, __pyx_t_5);
43240  __pyx_t_5 = 0;
43241 
43242  /* "WaveTools.py":2321
43243  * tfirst = self.time[0] + self.Twindow
43244  * tlast = self.time[-1] - self.Twindow
43245  * if jj == 0: # <<<<<<<<<<<<<<
43246  * ispan1 = 0
43247  * ispan2 = np.where(self.time> tfirst)[0][0]
43248  */
43249  __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_jj, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2321, __pyx_L1_error)
43250  __Pyx_GOTREF(__pyx_t_5);
43251  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2321, __pyx_L1_error)
43252  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43253  if (__pyx_t_10) {
43254 
43255  /* "WaveTools.py":2322
43256  * tlast = self.time[-1] - self.Twindow
43257  * if jj == 0:
43258  * ispan1 = 0 # <<<<<<<<<<<<<<
43259  * ispan2 = np.where(self.time> tfirst)[0][0]
43260  * elif jj == self.Nwindows-1:
43261  */
43262  __Pyx_INCREF(__pyx_int_0);
43263  __Pyx_XDECREF_SET(__pyx_v_ispan1, __pyx_int_0);
43264 
43265  /* "WaveTools.py":2323
43266  * if jj == 0:
43267  * ispan1 = 0
43268  * ispan2 = np.where(self.time> tfirst)[0][0] # <<<<<<<<<<<<<<
43269  * elif jj == self.Nwindows-1:
43270  * ispan1 = np.where(self.time > tlast)[0][0]
43271  */
43272  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2323, __pyx_L1_error)
43273  __Pyx_GOTREF(__pyx_t_23);
43274  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_where); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2323, __pyx_L1_error)
43275  __Pyx_GOTREF(__pyx_t_12);
43276  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43277  __pyx_t_23 = PyObject_RichCompare(((PyObject *)__pyx_v_self->time), __pyx_v_tfirst, Py_GT); __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2323, __pyx_L1_error)
43278  __pyx_t_6 = NULL;
43279  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
43280  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
43281  if (likely(__pyx_t_6)) {
43282  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
43283  __Pyx_INCREF(__pyx_t_6);
43284  __Pyx_INCREF(function);
43285  __Pyx_DECREF_SET(__pyx_t_12, function);
43286  }
43287  }
43288  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_6, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_23);
43289  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
43290  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43291  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2323, __pyx_L1_error)
43292  __Pyx_GOTREF(__pyx_t_5);
43293  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43294  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2323, __pyx_L1_error)
43295  __Pyx_GOTREF(__pyx_t_12);
43296  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43297  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2323, __pyx_L1_error)
43298  __Pyx_GOTREF(__pyx_t_5);
43299  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43300  __Pyx_XDECREF_SET(__pyx_v_ispan2, __pyx_t_5);
43301  __pyx_t_5 = 0;
43302 
43303  /* "WaveTools.py":2321
43304  * tfirst = self.time[0] + self.Twindow
43305  * tlast = self.time[-1] - self.Twindow
43306  * if jj == 0: # <<<<<<<<<<<<<<
43307  * ispan1 = 0
43308  * ispan2 = np.where(self.time> tfirst)[0][0]
43309  */
43310  goto __pyx_L66;
43311  }
43312 
43313  /* "WaveTools.py":2324
43314  * ispan1 = 0
43315  * ispan2 = np.where(self.time> tfirst)[0][0]
43316  * elif jj == self.Nwindows-1: # <<<<<<<<<<<<<<
43317  * ispan1 = np.where(self.time > tlast)[0][0]
43318  * ispan2 = len(self.time)-1
43319  */
43320  __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_self->Nwindows - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2324, __pyx_L1_error)
43321  __Pyx_GOTREF(__pyx_t_5);
43322  __pyx_t_12 = PyObject_RichCompare(__pyx_v_jj, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2324, __pyx_L1_error)
43323  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43324  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2324, __pyx_L1_error)
43325  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43326  if (__pyx_t_10) {
43327 
43328  /* "WaveTools.py":2325
43329  * ispan2 = np.where(self.time> tfirst)[0][0]
43330  * elif jj == self.Nwindows-1:
43331  * ispan1 = np.where(self.time > tlast)[0][0] # <<<<<<<<<<<<<<
43332  * ispan2 = len(self.time)-1
43333  * else:
43334  */
43335  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2325, __pyx_L1_error)
43336  __Pyx_GOTREF(__pyx_t_5);
43337  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_where); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2325, __pyx_L1_error)
43338  __Pyx_GOTREF(__pyx_t_23);
43339  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43340  __pyx_t_5 = PyObject_RichCompare(((PyObject *)__pyx_v_self->time), __pyx_v_tlast, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2325, __pyx_L1_error)
43341  __pyx_t_6 = NULL;
43342  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
43343  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_23);
43344  if (likely(__pyx_t_6)) {
43345  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
43346  __Pyx_INCREF(__pyx_t_6);
43347  __Pyx_INCREF(function);
43348  __Pyx_DECREF_SET(__pyx_t_23, function);
43349  }
43350  }
43351  __pyx_t_12 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_5);
43352  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
43353  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43354  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2325, __pyx_L1_error)
43355  __Pyx_GOTREF(__pyx_t_12);
43356  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43357  __pyx_t_23 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2325, __pyx_L1_error)
43358  __Pyx_GOTREF(__pyx_t_23);
43359  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43360  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_23, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2325, __pyx_L1_error)
43361  __Pyx_GOTREF(__pyx_t_12);
43362  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43363  __Pyx_XDECREF_SET(__pyx_v_ispan1, __pyx_t_12);
43364  __pyx_t_12 = 0;
43365 
43366  /* "WaveTools.py":2326
43367  * elif jj == self.Nwindows-1:
43368  * ispan1 = np.where(self.time > tlast)[0][0]
43369  * ispan2 = len(self.time)-1 # <<<<<<<<<<<<<<
43370  * else:
43371  * tstart = self.time[ispan2] - self.Toverlap
43372  */
43373  __pyx_t_12 = ((PyObject *)__pyx_v_self->time);
43374  __Pyx_INCREF(__pyx_t_12);
43375  __pyx_t_16 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2326, __pyx_L1_error)
43376  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43377  __pyx_t_12 = PyInt_FromSsize_t((__pyx_t_16 - 1)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2326, __pyx_L1_error)
43378  __Pyx_GOTREF(__pyx_t_12);
43379  __Pyx_XDECREF_SET(__pyx_v_ispan2, __pyx_t_12);
43380  __pyx_t_12 = 0;
43381 
43382  /* "WaveTools.py":2324
43383  * ispan1 = 0
43384  * ispan2 = np.where(self.time> tfirst)[0][0]
43385  * elif jj == self.Nwindows-1: # <<<<<<<<<<<<<<
43386  * ispan1 = np.where(self.time > tlast)[0][0]
43387  * ispan2 = len(self.time)-1
43388  */
43389  goto __pyx_L66;
43390  }
43391 
43392  /* "WaveTools.py":2328
43393  * ispan2 = len(self.time)-1
43394  * else:
43395  * tstart = self.time[ispan2] - self.Toverlap # <<<<<<<<<<<<<<
43396  * ispan1 = np.where(self.time > tstart)[0][0]
43397  * ispan2 = np.where(self.time > tstart + self.Twindow )[0][0]
43398  */
43399  /*else*/ {
43400  if (unlikely(!__pyx_v_ispan2)) { __Pyx_RaiseUnboundLocalError("ispan2"); __PYX_ERR(0, 2328, __pyx_L1_error) }
43401  __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->time), __pyx_v_ispan2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2328, __pyx_L1_error)
43402  __Pyx_GOTREF(__pyx_t_12);
43403  __pyx_t_23 = PyFloat_FromDouble(__pyx_v_self->Toverlap); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2328, __pyx_L1_error)
43404  __Pyx_GOTREF(__pyx_t_23);
43405  __pyx_t_5 = PyNumber_Subtract(__pyx_t_12, __pyx_t_23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2328, __pyx_L1_error)
43406  __Pyx_GOTREF(__pyx_t_5);
43407  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43408  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43409  __Pyx_XDECREF_SET(__pyx_v_tstart, __pyx_t_5);
43410  __pyx_t_5 = 0;
43411 
43412  /* "WaveTools.py":2329
43413  * else:
43414  * tstart = self.time[ispan2] - self.Toverlap
43415  * ispan1 = np.where(self.time > tstart)[0][0] # <<<<<<<<<<<<<<
43416  * ispan2 = np.where(self.time > tstart + self.Twindow )[0][0]
43417  * span[0] = ispan1
43418  */
43419  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2329, __pyx_L1_error)
43420  __Pyx_GOTREF(__pyx_t_23);
43421  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_where); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2329, __pyx_L1_error)
43422  __Pyx_GOTREF(__pyx_t_12);
43423  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43424  __pyx_t_23 = PyObject_RichCompare(((PyObject *)__pyx_v_self->time), __pyx_v_tstart, Py_GT); __Pyx_XGOTREF(__pyx_t_23); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2329, __pyx_L1_error)
43425  __pyx_t_6 = NULL;
43426  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
43427  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_12);
43428  if (likely(__pyx_t_6)) {
43429  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
43430  __Pyx_INCREF(__pyx_t_6);
43431  __Pyx_INCREF(function);
43432  __Pyx_DECREF_SET(__pyx_t_12, function);
43433  }
43434  }
43435  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_6, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_23);
43436  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
43437  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43438  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2329, __pyx_L1_error)
43439  __Pyx_GOTREF(__pyx_t_5);
43440  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43441  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2329, __pyx_L1_error)
43442  __Pyx_GOTREF(__pyx_t_12);
43443  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43444  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2329, __pyx_L1_error)
43445  __Pyx_GOTREF(__pyx_t_5);
43446  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43447  __Pyx_XDECREF_SET(__pyx_v_ispan1, __pyx_t_5);
43448  __pyx_t_5 = 0;
43449 
43450  /* "WaveTools.py":2330
43451  * tstart = self.time[ispan2] - self.Toverlap
43452  * ispan1 = np.where(self.time > tstart)[0][0]
43453  * ispan2 = np.where(self.time > tstart + self.Twindow )[0][0] # <<<<<<<<<<<<<<
43454  * span[0] = ispan1
43455  * span[1] = ispan2
43456  */
43457  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2330, __pyx_L1_error)
43458  __Pyx_GOTREF(__pyx_t_12);
43459  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_where); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2330, __pyx_L1_error)
43460  __Pyx_GOTREF(__pyx_t_23);
43461  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43462  __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->Twindow); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2330, __pyx_L1_error)
43463  __Pyx_GOTREF(__pyx_t_12);
43464  __pyx_t_6 = PyNumber_Add(__pyx_v_tstart, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2330, __pyx_L1_error)
43465  __Pyx_GOTREF(__pyx_t_6);
43466  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43467  __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_self->time), __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2330, __pyx_L1_error)
43468  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43469  __pyx_t_6 = NULL;
43470  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
43471  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_23);
43472  if (likely(__pyx_t_6)) {
43473  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
43474  __Pyx_INCREF(__pyx_t_6);
43475  __Pyx_INCREF(function);
43476  __Pyx_DECREF_SET(__pyx_t_23, function);
43477  }
43478  }
43479  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_6, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_12);
43480  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
43481  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43482  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2330, __pyx_L1_error)
43483  __Pyx_GOTREF(__pyx_t_5);
43484  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43485  __pyx_t_23 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2330, __pyx_L1_error)
43486  __Pyx_GOTREF(__pyx_t_23);
43487  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43488  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_23, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2330, __pyx_L1_error)
43489  __Pyx_GOTREF(__pyx_t_5);
43490  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43491  __Pyx_XDECREF_SET(__pyx_v_ispan2, __pyx_t_5);
43492  __pyx_t_5 = 0;
43493  }
43494  __pyx_L66:;
43495 
43496  /* "WaveTools.py":2331
43497  * ispan1 = np.where(self.time > tstart)[0][0]
43498  * ispan2 = np.where(self.time > tstart + self.Twindow )[0][0]
43499  * span[0] = ispan1 # <<<<<<<<<<<<<<
43500  * span[1] = ispan2
43501  * # Storing time series in windows and handover times
43502  */
43503  if (unlikely(__Pyx_SetItemInt(__pyx_v_span, 0, __pyx_v_ispan1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2331, __pyx_L1_error)
43504 
43505  /* "WaveTools.py":2332
43506  * ispan2 = np.where(self.time > tstart + self.Twindow )[0][0]
43507  * span[0] = ispan1
43508  * span[1] = ispan2 # <<<<<<<<<<<<<<
43509  * # Storing time series in windows and handover times
43510  * self.windows_handover.append( self.time[ispan2] - self.handover*self.Twindow )
43511  */
43512  if (unlikely(__Pyx_SetItemInt(__pyx_v_span, 1, __pyx_v_ispan2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2332, __pyx_L1_error)
43513 
43514  /* "WaveTools.py":2334
43515  * span[1] = ispan2
43516  * # Storing time series in windows and handover times
43517  * self.windows_handover.append( self.time[ispan2] - self.handover*self.Twindow ) # <<<<<<<<<<<<<<
43518  * self.windows_rec.append(np.array(list(zip(self.time[ispan1:ispan2],self.etaS[ispan1:ispan2]))))
43519  * # Decomposing windows to frequency domain
43520  */
43521  if (unlikely(__pyx_v_self->windows_handover == Py_None)) {
43522  PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
43523  __PYX_ERR(0, 2334, __pyx_L1_error)
43524  }
43525  __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->time), __pyx_v_ispan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __pyx_L1_error)
43526  __Pyx_GOTREF(__pyx_t_5);
43527  __pyx_t_23 = PyFloat_FromDouble((__pyx_v_self->handover * __pyx_v_self->Twindow)); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2334, __pyx_L1_error)
43528  __Pyx_GOTREF(__pyx_t_23);
43529  __pyx_t_12 = PyNumber_Subtract(__pyx_t_5, __pyx_t_23); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2334, __pyx_L1_error)
43530  __Pyx_GOTREF(__pyx_t_12);
43531  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43532  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43533  __pyx_t_24 = __Pyx_PyList_Append(__pyx_v_self->windows_handover, __pyx_t_12); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 2334, __pyx_L1_error)
43534  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43535 
43536  /* "WaveTools.py":2335
43537  * # Storing time series in windows and handover times
43538  * self.windows_handover.append( self.time[ispan2] - self.handover*self.Twindow )
43539  * self.windows_rec.append(np.array(list(zip(self.time[ispan1:ispan2],self.etaS[ispan1:ispan2])))) # <<<<<<<<<<<<<<
43540  * # Decomposing windows to frequency domain
43541  * self.decompose_window = []
43542  */
43543  if (unlikely(__pyx_v_self->windows_rec == Py_None)) {
43544  PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
43545  __PYX_ERR(0, 2335, __pyx_L1_error)
43546  }
43547  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2335, __pyx_L1_error)
43548  __Pyx_GOTREF(__pyx_t_23);
43549  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2335, __pyx_L1_error)
43550  __Pyx_GOTREF(__pyx_t_5);
43551  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43552  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_zip); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2335, __pyx_L1_error)
43553  __Pyx_GOTREF(__pyx_t_6);
43554  __pyx_t_7 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->time), 0, 0, &__pyx_v_ispan1, &__pyx_v_ispan2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2335, __pyx_L1_error)
43555  __Pyx_GOTREF(__pyx_t_7);
43556  __pyx_t_14 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->etaS), 0, 0, &__pyx_v_ispan1, &__pyx_v_ispan2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2335, __pyx_L1_error)
43557  __Pyx_GOTREF(__pyx_t_14);
43558  __pyx_t_4 = NULL;
43559  __pyx_t_3 = 0;
43560  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
43561  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
43562  if (likely(__pyx_t_4)) {
43563  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
43564  __Pyx_INCREF(__pyx_t_4);
43565  __Pyx_INCREF(function);
43566  __Pyx_DECREF_SET(__pyx_t_6, function);
43567  __pyx_t_3 = 1;
43568  }
43569  }
43570  #if CYTHON_FAST_PYCALL
43571  if (PyFunction_Check(__pyx_t_6)) {
43572  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_14};
43573  __pyx_t_23 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2335, __pyx_L1_error)
43574  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
43575  __Pyx_GOTREF(__pyx_t_23);
43576  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43577  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
43578  } else
43579  #endif
43580  #if CYTHON_FAST_PYCCALL
43581  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
43582  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_7, __pyx_t_14};
43583  __pyx_t_23 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2335, __pyx_L1_error)
43584  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
43585  __Pyx_GOTREF(__pyx_t_23);
43586  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43587  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
43588  } else
43589  #endif
43590  {
43591  __pyx_t_25 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2335, __pyx_L1_error)
43592  __Pyx_GOTREF(__pyx_t_25);
43593  if (__pyx_t_4) {
43594  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_4); __pyx_t_4 = NULL;
43595  }
43596  __Pyx_GIVEREF(__pyx_t_7);
43597  PyTuple_SET_ITEM(__pyx_t_25, 0+__pyx_t_3, __pyx_t_7);
43598  __Pyx_GIVEREF(__pyx_t_14);
43599  PyTuple_SET_ITEM(__pyx_t_25, 1+__pyx_t_3, __pyx_t_14);
43600  __pyx_t_7 = 0;
43601  __pyx_t_14 = 0;
43602  __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_25, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2335, __pyx_L1_error)
43603  __Pyx_GOTREF(__pyx_t_23);
43604  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
43605  }
43606  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43607  __pyx_t_6 = PySequence_List(__pyx_t_23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2335, __pyx_L1_error)
43608  __Pyx_GOTREF(__pyx_t_6);
43609  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43610  __pyx_t_23 = NULL;
43611  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
43612  __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_5);
43613  if (likely(__pyx_t_23)) {
43614  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
43615  __Pyx_INCREF(__pyx_t_23);
43616  __Pyx_INCREF(function);
43617  __Pyx_DECREF_SET(__pyx_t_5, function);
43618  }
43619  }
43620  __pyx_t_12 = (__pyx_t_23) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_23, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
43621  __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
43622  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43623  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2335, __pyx_L1_error)
43624  __Pyx_GOTREF(__pyx_t_12);
43625  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43626  __pyx_t_24 = __Pyx_PyList_Append(__pyx_v_self->windows_rec, __pyx_t_12); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 2335, __pyx_L1_error)
43627  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43628 
43629  /* "WaveTools.py":2317
43630  * logEvent("INFO: Wavetools.py: Using %s windows for reconstruction with %s sec duration and %s per cent overlap" %(self.Nwindows, self.Twindow,100*self.overlap ))
43631  * # Setting where each window starts and ends
43632  * for jj in range(self.Nwindows): # <<<<<<<<<<<<<<
43633  * span = np.zeros(2,"d")
43634  * tfirst = self.time[0] + self.Twindow
43635  */
43636  }
43637  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
43638 
43639  /* "WaveTools.py":2337
43640  * self.windows_rec.append(np.array(list(zip(self.time[ispan1:ispan2],self.etaS[ispan1:ispan2]))))
43641  * # Decomposing windows to frequency domain
43642  * self.decompose_window = [] # <<<<<<<<<<<<<<
43643  * # style = "k-"
43644  * # ii = 0
43645  */
43646  __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L1_error)
43647  __Pyx_GOTREF(__pyx_t_11);
43648  __Pyx_GIVEREF(__pyx_t_11);
43649  __Pyx_GOTREF(__pyx_v_self->decompose_window);
43650  __Pyx_DECREF(__pyx_v_self->decompose_window);
43651  __pyx_v_self->decompose_window = ((PyObject*)__pyx_t_11);
43652  __pyx_t_11 = 0;
43653 
43654  /* "WaveTools.py":2341
43655  * # ii = 0
43656  *
43657  * for wind in self.windows_rec: # <<<<<<<<<<<<<<
43658  * nfft=len(wind[:,0])
43659  * wind[:,1] *=wind_filt(nfft,cutoff = self.cutoff)
43660  */
43661  if (unlikely(__pyx_v_self->windows_rec == Py_None)) {
43662  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
43663  __PYX_ERR(0, 2341, __pyx_L1_error)
43664  }
43665  __pyx_t_11 = __pyx_v_self->windows_rec; __Pyx_INCREF(__pyx_t_11); __pyx_t_8 = 0;
43666  for (;;) {
43667  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_11)) break;
43668  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
43669  __pyx_t_12 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_12); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2341, __pyx_L1_error)
43670  #else
43671  __pyx_t_12 = PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2341, __pyx_L1_error)
43672  __Pyx_GOTREF(__pyx_t_12);
43673  #endif
43674  __Pyx_XDECREF_SET(__pyx_v_wind, __pyx_t_12);
43675  __pyx_t_12 = 0;
43676 
43677  /* "WaveTools.py":2342
43678  *
43679  * for wind in self.windows_rec:
43680  * nfft=len(wind[:,0]) # <<<<<<<<<<<<<<
43681  * wind[:,1] *=wind_filt(nfft,cutoff = self.cutoff)
43682  * decomp = decompose_tseries(wind[:,0],wind[:,1],self.dt)
43683  */
43684  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_wind, __pyx_tuple__25); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2342, __pyx_L1_error)
43685  __Pyx_GOTREF(__pyx_t_12);
43686  __pyx_t_16 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2342, __pyx_L1_error)
43687  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43688  __pyx_v_nfft = __pyx_t_16;
43689 
43690  /* "WaveTools.py":2343
43691  * for wind in self.windows_rec:
43692  * nfft=len(wind[:,0])
43693  * wind[:,1] *=wind_filt(nfft,cutoff = self.cutoff) # <<<<<<<<<<<<<<
43694  * decomp = decompose_tseries(wind[:,0],wind[:,1],self.dt)
43695  * self.N = min(self.N, len(decomp[0]))
43696  */
43697  __Pyx_INCREF(__pyx_tuple__26);
43698  __pyx_t_26 = __pyx_tuple__26;
43699  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_wind, __pyx_t_26); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error)
43700  __Pyx_GOTREF(__pyx_t_12);
43701  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_nfft); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2343, __pyx_L1_error)
43702  __Pyx_GOTREF(__pyx_t_5);
43703  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __pyx_L1_error)
43704  __Pyx_GOTREF(__pyx_t_6);
43705  __Pyx_GIVEREF(__pyx_t_5);
43706  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
43707  __pyx_t_5 = 0;
43708  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2343, __pyx_L1_error)
43709  __Pyx_GOTREF(__pyx_t_5);
43710  __pyx_t_23 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2343, __pyx_L1_error)
43711  __Pyx_GOTREF(__pyx_t_23);
43712  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_cutoff, __pyx_t_23) < 0) __PYX_ERR(0, 2343, __pyx_L1_error)
43713  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43714  __pyx_t_23 = __Pyx_PyObject_Call(__pyx_v_wind_filt, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2343, __pyx_L1_error)
43715  __Pyx_GOTREF(__pyx_t_23);
43716  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43717  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43718  __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_12, __pyx_t_23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2343, __pyx_L1_error)
43719  __Pyx_GOTREF(__pyx_t_5);
43720  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43721  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43722  if (unlikely(PyObject_SetItem(__pyx_v_wind, __pyx_t_26, __pyx_t_5) < 0)) __PYX_ERR(0, 2343, __pyx_L1_error)
43723  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43724  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
43725 
43726  /* "WaveTools.py":2344
43727  * nfft=len(wind[:,0])
43728  * wind[:,1] *=wind_filt(nfft,cutoff = self.cutoff)
43729  * decomp = decompose_tseries(wind[:,0],wind[:,1],self.dt) # <<<<<<<<<<<<<<
43730  * self.N = min(self.N, len(decomp[0]))
43731  * Nftemp = self.N
43732  */
43733  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_decompose_tseries); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2344, __pyx_L1_error)
43734  __Pyx_GOTREF(__pyx_t_23);
43735  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_wind, __pyx_tuple__25); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error)
43736  __Pyx_GOTREF(__pyx_t_12);
43737  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_wind, __pyx_tuple__26); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error)
43738  __Pyx_GOTREF(__pyx_t_6);
43739  __pyx_t_25 = PyFloat_FromDouble(__pyx_v_self->dt); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2344, __pyx_L1_error)
43740  __Pyx_GOTREF(__pyx_t_25);
43741  __pyx_t_14 = NULL;
43742  __pyx_t_3 = 0;
43743  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
43744  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_23);
43745  if (likely(__pyx_t_14)) {
43746  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
43747  __Pyx_INCREF(__pyx_t_14);
43748  __Pyx_INCREF(function);
43749  __Pyx_DECREF_SET(__pyx_t_23, function);
43750  __pyx_t_3 = 1;
43751  }
43752  }
43753  #if CYTHON_FAST_PYCALL
43754  if (PyFunction_Check(__pyx_t_23)) {
43755  PyObject *__pyx_temp[4] = {__pyx_t_14, __pyx_t_12, __pyx_t_6, __pyx_t_25};
43756  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error)
43757  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
43758  __Pyx_GOTREF(__pyx_t_5);
43759  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43760  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43761  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
43762  } else
43763  #endif
43764  #if CYTHON_FAST_PYCCALL
43765  if (__Pyx_PyFastCFunction_Check(__pyx_t_23)) {
43766  PyObject *__pyx_temp[4] = {__pyx_t_14, __pyx_t_12, __pyx_t_6, __pyx_t_25};
43767  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_23, __pyx_temp+1-__pyx_t_3, 3+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error)
43768  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
43769  __Pyx_GOTREF(__pyx_t_5);
43770  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
43771  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43772  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
43773  } else
43774  #endif
43775  {
43776  __pyx_t_7 = PyTuple_New(3+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2344, __pyx_L1_error)
43777  __Pyx_GOTREF(__pyx_t_7);
43778  if (__pyx_t_14) {
43779  __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_14); __pyx_t_14 = NULL;
43780  }
43781  __Pyx_GIVEREF(__pyx_t_12);
43782  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_3, __pyx_t_12);
43783  __Pyx_GIVEREF(__pyx_t_6);
43784  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_3, __pyx_t_6);
43785  __Pyx_GIVEREF(__pyx_t_25);
43786  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_3, __pyx_t_25);
43787  __pyx_t_12 = 0;
43788  __pyx_t_6 = 0;
43789  __pyx_t_25 = 0;
43790  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_23, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2344, __pyx_L1_error)
43791  __Pyx_GOTREF(__pyx_t_5);
43792  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43793  }
43794  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43795  __Pyx_XDECREF_SET(__pyx_v_decomp, __pyx_t_5);
43796  __pyx_t_5 = 0;
43797 
43798  /* "WaveTools.py":2345
43799  * wind[:,1] *=wind_filt(nfft,cutoff = self.cutoff)
43800  * decomp = decompose_tseries(wind[:,0],wind[:,1],self.dt)
43801  * self.N = min(self.N, len(decomp[0])) # <<<<<<<<<<<<<<
43802  * Nftemp = self.N
43803  * ipeak = np.where(decomp[1] == max(decomp[1]))[0][0]
43804  */
43805  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_decomp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2345, __pyx_L1_error)
43806  __Pyx_GOTREF(__pyx_t_5);
43807  __pyx_t_16 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2345, __pyx_L1_error)
43808  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43809  __pyx_t_3 = __pyx_v_self->N;
43810  if (((__pyx_t_16 < __pyx_t_3) != 0)) {
43811  __pyx_t_18 = __pyx_t_16;
43812  } else {
43813  __pyx_t_18 = __pyx_t_3;
43814  }
43815  __pyx_v_self->N = __pyx_t_18;
43816 
43817  /* "WaveTools.py":2346
43818  * decomp = decompose_tseries(wind[:,0],wind[:,1],self.dt)
43819  * self.N = min(self.N, len(decomp[0]))
43820  * Nftemp = self.N # <<<<<<<<<<<<<<
43821  * ipeak = np.where(decomp[1] == max(decomp[1]))[0][0]
43822  * imax = min(ipeak + old_div(Nftemp,2),len(decomp[1]))
43823  */
43824  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2346, __pyx_L1_error)
43825  __Pyx_GOTREF(__pyx_t_5);
43826  __Pyx_XDECREF_SET(__pyx_v_Nftemp, __pyx_t_5);
43827  __pyx_t_5 = 0;
43828 
43829  /* "WaveTools.py":2347
43830  * self.N = min(self.N, len(decomp[0]))
43831  * Nftemp = self.N
43832  * ipeak = np.where(decomp[1] == max(decomp[1]))[0][0] # <<<<<<<<<<<<<<
43833  * imax = min(ipeak + old_div(Nftemp,2),len(decomp[1]))
43834  * imin = max(0,ipeak - old_div(Nftemp,2))
43835  */
43836  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_np); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2347, __pyx_L1_error)
43837  __Pyx_GOTREF(__pyx_t_23);
43838  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_where); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2347, __pyx_L1_error)
43839  __Pyx_GOTREF(__pyx_t_7);
43840  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43841  __pyx_t_23 = __Pyx_GetItemInt(__pyx_v_decomp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2347, __pyx_L1_error)
43842  __Pyx_GOTREF(__pyx_t_23);
43843  __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_decomp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2347, __pyx_L1_error)
43844  __Pyx_GOTREF(__pyx_t_25);
43845  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_25); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2347, __pyx_L1_error)
43846  __Pyx_GOTREF(__pyx_t_6);
43847  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
43848  __pyx_t_25 = PyObject_RichCompare(__pyx_t_23, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_25); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2347, __pyx_L1_error)
43849  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
43850  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43851  __pyx_t_6 = NULL;
43852  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
43853  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
43854  if (likely(__pyx_t_6)) {
43855  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
43856  __Pyx_INCREF(__pyx_t_6);
43857  __Pyx_INCREF(function);
43858  __Pyx_DECREF_SET(__pyx_t_7, function);
43859  }
43860  }
43861  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_t_25) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_25);
43862  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
43863  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
43864  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2347, __pyx_L1_error)
43865  __Pyx_GOTREF(__pyx_t_5);
43866  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43867  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2347, __pyx_L1_error)
43868  __Pyx_GOTREF(__pyx_t_7);
43869  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43870  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2347, __pyx_L1_error)
43871  __Pyx_GOTREF(__pyx_t_5);
43872  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43873  __Pyx_XDECREF_SET(__pyx_v_ipeak, __pyx_t_5);
43874  __pyx_t_5 = 0;
43875 
43876  /* "WaveTools.py":2348
43877  * Nftemp = self.N
43878  * ipeak = np.where(decomp[1] == max(decomp[1]))[0][0]
43879  * imax = min(ipeak + old_div(Nftemp,2),len(decomp[1])) # <<<<<<<<<<<<<<
43880  * imin = max(0,ipeak - old_div(Nftemp,2))
43881  * self.Nf = imax-imin
43882  */
43883  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_decomp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2348, __pyx_L1_error)
43884  __Pyx_GOTREF(__pyx_t_5);
43885  __pyx_t_18 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2348, __pyx_L1_error)
43886  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43887  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_old_div); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2348, __pyx_L1_error)
43888  __Pyx_GOTREF(__pyx_t_7);
43889  __pyx_t_25 = NULL;
43890  __pyx_t_3 = 0;
43891  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
43892  __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_7);
43893  if (likely(__pyx_t_25)) {
43894  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
43895  __Pyx_INCREF(__pyx_t_25);
43896  __Pyx_INCREF(function);
43897  __Pyx_DECREF_SET(__pyx_t_7, function);
43898  __pyx_t_3 = 1;
43899  }
43900  }
43901  #if CYTHON_FAST_PYCALL
43902  if (PyFunction_Check(__pyx_t_7)) {
43903  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_v_Nftemp, __pyx_int_2};
43904  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2348, __pyx_L1_error)
43905  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
43906  __Pyx_GOTREF(__pyx_t_5);
43907  } else
43908  #endif
43909  #if CYTHON_FAST_PYCCALL
43910  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
43911  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_v_Nftemp, __pyx_int_2};
43912  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2348, __pyx_L1_error)
43913  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
43914  __Pyx_GOTREF(__pyx_t_5);
43915  } else
43916  #endif
43917  {
43918  __pyx_t_6 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2348, __pyx_L1_error)
43919  __Pyx_GOTREF(__pyx_t_6);
43920  if (__pyx_t_25) {
43921  __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_25); __pyx_t_25 = NULL;
43922  }
43923  __Pyx_INCREF(__pyx_v_Nftemp);
43924  __Pyx_GIVEREF(__pyx_v_Nftemp);
43925  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, __pyx_v_Nftemp);
43926  __Pyx_INCREF(__pyx_int_2);
43927  __Pyx_GIVEREF(__pyx_int_2);
43928  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_int_2);
43929  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2348, __pyx_L1_error)
43930  __Pyx_GOTREF(__pyx_t_5);
43931  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43932  }
43933  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43934  __pyx_t_7 = PyNumber_Add(__pyx_v_ipeak, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2348, __pyx_L1_error)
43935  __Pyx_GOTREF(__pyx_t_7);
43936  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43937  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_18); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2348, __pyx_L1_error)
43938  __Pyx_GOTREF(__pyx_t_6);
43939  __pyx_t_25 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_25); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2348, __pyx_L1_error)
43940  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
43941  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_25); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2348, __pyx_L1_error)
43942  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
43943  if (__pyx_t_10) {
43944  __pyx_t_25 = PyInt_FromSsize_t(__pyx_t_18); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2348, __pyx_L1_error)
43945  __Pyx_GOTREF(__pyx_t_25);
43946  __pyx_t_5 = __pyx_t_25;
43947  __pyx_t_25 = 0;
43948  } else {
43949  __Pyx_INCREF(__pyx_t_7);
43950  __pyx_t_5 = __pyx_t_7;
43951  }
43952  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
43953  __pyx_t_7 = __pyx_t_5;
43954  __Pyx_INCREF(__pyx_t_7);
43955  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43956  __Pyx_XDECREF_SET(__pyx_v_imax, __pyx_t_7);
43957  __pyx_t_7 = 0;
43958 
43959  /* "WaveTools.py":2349
43960  * ipeak = np.where(decomp[1] == max(decomp[1]))[0][0]
43961  * imax = min(ipeak + old_div(Nftemp,2),len(decomp[1]))
43962  * imin = max(0,ipeak - old_div(Nftemp,2)) # <<<<<<<<<<<<<<
43963  * self.Nf = imax-imin
43964  * if (self.Nf < self.N):
43965  */
43966  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2349, __pyx_L1_error)
43967  __Pyx_GOTREF(__pyx_t_5);
43968  __pyx_t_25 = NULL;
43969  __pyx_t_3 = 0;
43970  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
43971  __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_5);
43972  if (likely(__pyx_t_25)) {
43973  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
43974  __Pyx_INCREF(__pyx_t_25);
43975  __Pyx_INCREF(function);
43976  __Pyx_DECREF_SET(__pyx_t_5, function);
43977  __pyx_t_3 = 1;
43978  }
43979  }
43980  #if CYTHON_FAST_PYCALL
43981  if (PyFunction_Check(__pyx_t_5)) {
43982  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_v_Nftemp, __pyx_int_2};
43983  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2349, __pyx_L1_error)
43984  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
43985  __Pyx_GOTREF(__pyx_t_7);
43986  } else
43987  #endif
43988  #if CYTHON_FAST_PYCCALL
43989  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
43990  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_v_Nftemp, __pyx_int_2};
43991  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2349, __pyx_L1_error)
43992  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
43993  __Pyx_GOTREF(__pyx_t_7);
43994  } else
43995  #endif
43996  {
43997  __pyx_t_6 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2349, __pyx_L1_error)
43998  __Pyx_GOTREF(__pyx_t_6);
43999  if (__pyx_t_25) {
44000  __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_25); __pyx_t_25 = NULL;
44001  }
44002  __Pyx_INCREF(__pyx_v_Nftemp);
44003  __Pyx_GIVEREF(__pyx_v_Nftemp);
44004  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_3, __pyx_v_Nftemp);
44005  __Pyx_INCREF(__pyx_int_2);
44006  __Pyx_GIVEREF(__pyx_int_2);
44007  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_3, __pyx_int_2);
44008  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2349, __pyx_L1_error)
44009  __Pyx_GOTREF(__pyx_t_7);
44010  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44011  }
44012  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44013  __pyx_t_5 = PyNumber_Subtract(__pyx_v_ipeak, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2349, __pyx_L1_error)
44014  __Pyx_GOTREF(__pyx_t_5);
44015  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44016  __pyx_t_15 = 0;
44017  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2349, __pyx_L1_error)
44018  __Pyx_GOTREF(__pyx_t_6);
44019  __pyx_t_25 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_25); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2349, __pyx_L1_error)
44020  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44021  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_25); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2349, __pyx_L1_error)
44022  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
44023  if (__pyx_t_10) {
44024  __Pyx_INCREF(__pyx_t_5);
44025  __pyx_t_7 = __pyx_t_5;
44026  } else {
44027  __pyx_t_25 = __Pyx_PyInt_From_long(__pyx_t_15); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2349, __pyx_L1_error)
44028  __Pyx_GOTREF(__pyx_t_25);
44029  __pyx_t_7 = __pyx_t_25;
44030  __pyx_t_25 = 0;
44031  }
44032  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44033  __pyx_t_5 = __pyx_t_7;
44034  __Pyx_INCREF(__pyx_t_5);
44035  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44036  __Pyx_XDECREF_SET(__pyx_v_imin, __pyx_t_5);
44037  __pyx_t_5 = 0;
44038 
44039  /* "WaveTools.py":2350
44040  * imax = min(ipeak + old_div(Nftemp,2),len(decomp[1]))
44041  * imin = max(0,ipeak - old_div(Nftemp,2))
44042  * self.Nf = imax-imin # <<<<<<<<<<<<<<
44043  * if (self.Nf < self.N):
44044  * if imin == 0:
44045  */
44046  __pyx_t_5 = PyNumber_Subtract(__pyx_v_imax, __pyx_v_imin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2350, __pyx_L1_error)
44047  __Pyx_GOTREF(__pyx_t_5);
44048  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2350, __pyx_L1_error)
44049  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44050  __pyx_v_self->Nf = __pyx_t_3;
44051 
44052  /* "WaveTools.py":2351
44053  * imin = max(0,ipeak - old_div(Nftemp,2))
44054  * self.Nf = imax-imin
44055  * if (self.Nf < self.N): # <<<<<<<<<<<<<<
44056  * if imin == 0:
44057  * imax = imax + (self.N - self.Nf)
44058  */
44059  __pyx_t_10 = ((__pyx_v_self->Nf < __pyx_v_self->N) != 0);
44060  if (__pyx_t_10) {
44061 
44062  /* "WaveTools.py":2352
44063  * self.Nf = imax-imin
44064  * if (self.Nf < self.N):
44065  * if imin == 0: # <<<<<<<<<<<<<<
44066  * imax = imax + (self.N - self.Nf)
44067  * else:
44068  */
44069  __pyx_t_5 = __Pyx_PyInt_EqObjC(__pyx_v_imin, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2352, __pyx_L1_error)
44070  __Pyx_GOTREF(__pyx_t_5);
44071  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2352, __pyx_L1_error)
44072  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44073  if (__pyx_t_10) {
44074 
44075  /* "WaveTools.py":2353
44076  * if (self.Nf < self.N):
44077  * if imin == 0:
44078  * imax = imax + (self.N - self.Nf) # <<<<<<<<<<<<<<
44079  * else:
44080  * imin = imin - (self.N - self.Nf)
44081  */
44082  __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_self->N - __pyx_v_self->Nf)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2353, __pyx_L1_error)
44083  __Pyx_GOTREF(__pyx_t_5);
44084  __pyx_t_7 = PyNumber_Add(__pyx_v_imax, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2353, __pyx_L1_error)
44085  __Pyx_GOTREF(__pyx_t_7);
44086  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44087  __Pyx_DECREF_SET(__pyx_v_imax, __pyx_t_7);
44088  __pyx_t_7 = 0;
44089 
44090  /* "WaveTools.py":2352
44091  * self.Nf = imax-imin
44092  * if (self.Nf < self.N):
44093  * if imin == 0: # <<<<<<<<<<<<<<
44094  * imax = imax + (self.N - self.Nf)
44095  * else:
44096  */
44097  goto __pyx_L70;
44098  }
44099 
44100  /* "WaveTools.py":2355
44101  * imax = imax + (self.N - self.Nf)
44102  * else:
44103  * imin = imin - (self.N - self.Nf) # <<<<<<<<<<<<<<
44104  * self.Nf = self.N
44105  *
44106  */
44107  /*else*/ {
44108  __pyx_t_7 = __Pyx_PyInt_From_int((__pyx_v_self->N - __pyx_v_self->Nf)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2355, __pyx_L1_error)
44109  __Pyx_GOTREF(__pyx_t_7);
44110  __pyx_t_5 = PyNumber_Subtract(__pyx_v_imin, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2355, __pyx_L1_error)
44111  __Pyx_GOTREF(__pyx_t_5);
44112  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44113  __Pyx_DECREF_SET(__pyx_v_imin, __pyx_t_5);
44114  __pyx_t_5 = 0;
44115  }
44116  __pyx_L70:;
44117 
44118  /* "WaveTools.py":2356
44119  * else:
44120  * imin = imin - (self.N - self.Nf)
44121  * self.Nf = self.N # <<<<<<<<<<<<<<
44122  *
44123  * decomp[1] = decomp[1][imin:imax]
44124  */
44125  __pyx_t_3 = __pyx_v_self->N;
44126  __pyx_v_self->Nf = __pyx_t_3;
44127 
44128  /* "WaveTools.py":2351
44129  * imin = max(0,ipeak - old_div(Nftemp,2))
44130  * self.Nf = imax-imin
44131  * if (self.Nf < self.N): # <<<<<<<<<<<<<<
44132  * if imin == 0:
44133  * imax = imax + (self.N - self.Nf)
44134  */
44135  }
44136 
44137  /* "WaveTools.py":2358
44138  * self.Nf = self.N
44139  *
44140  * decomp[1] = decomp[1][imin:imax] # <<<<<<<<<<<<<<
44141  * decomp[0] = decomp[0][imin:imax]
44142  * decomp[2] = -decomp[2][imin:imax]
44143  */
44144  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_decomp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2358, __pyx_L1_error)
44145  __Pyx_GOTREF(__pyx_t_5);
44146  __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_v_imin, &__pyx_v_imax, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2358, __pyx_L1_error)
44147  __Pyx_GOTREF(__pyx_t_7);
44148  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44149  if (unlikely(__Pyx_SetItemInt(__pyx_v_decomp, 1, __pyx_t_7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2358, __pyx_L1_error)
44150  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44151 
44152  /* "WaveTools.py":2359
44153  *
44154  * decomp[1] = decomp[1][imin:imax]
44155  * decomp[0] = decomp[0][imin:imax] # <<<<<<<<<<<<<<
44156  * decomp[2] = -decomp[2][imin:imax]
44157  * ki = dispersion(decomp[0],self.depth,g=self.gAbs)
44158  */
44159  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_decomp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2359, __pyx_L1_error)
44160  __Pyx_GOTREF(__pyx_t_7);
44161  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_7, 0, 0, &__pyx_v_imin, &__pyx_v_imax, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2359, __pyx_L1_error)
44162  __Pyx_GOTREF(__pyx_t_5);
44163  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44164  if (unlikely(__Pyx_SetItemInt(__pyx_v_decomp, 0, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2359, __pyx_L1_error)
44165  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44166 
44167  /* "WaveTools.py":2360
44168  * decomp[1] = decomp[1][imin:imax]
44169  * decomp[0] = decomp[0][imin:imax]
44170  * decomp[2] = -decomp[2][imin:imax] # <<<<<<<<<<<<<<
44171  * ki = dispersion(decomp[0],self.depth,g=self.gAbs)
44172  * kDir = np.zeros((len(ki),3),"d")
44173  */
44174  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_decomp, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2360, __pyx_L1_error)
44175  __Pyx_GOTREF(__pyx_t_5);
44176  __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_5, 0, 0, &__pyx_v_imin, &__pyx_v_imax, NULL, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2360, __pyx_L1_error)
44177  __Pyx_GOTREF(__pyx_t_7);
44178  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44179  __pyx_t_5 = PyNumber_Negative(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2360, __pyx_L1_error)
44180  __Pyx_GOTREF(__pyx_t_5);
44181  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44182  if (unlikely(__Pyx_SetItemInt(__pyx_v_decomp, 2, __pyx_t_5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2360, __pyx_L1_error)
44183  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44184 
44185  /* "WaveTools.py":2361
44186  * decomp[0] = decomp[0][imin:imax]
44187  * decomp[2] = -decomp[2][imin:imax]
44188  * ki = dispersion(decomp[0],self.depth,g=self.gAbs) # <<<<<<<<<<<<<<
44189  * kDir = np.zeros((len(ki),3),"d")
44190  * Tlag = np.zeros(ki.shape,)
44191  */
44192  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_dispersion); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2361, __pyx_L1_error)
44193  __Pyx_GOTREF(__pyx_t_5);
44194  __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_decomp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2361, __pyx_L1_error)
44195  __Pyx_GOTREF(__pyx_t_7);
44196  __pyx_t_25 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2361, __pyx_L1_error)
44197  __Pyx_GOTREF(__pyx_t_25);
44198  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2361, __pyx_L1_error)
44199  __Pyx_GOTREF(__pyx_t_6);
44200  __Pyx_GIVEREF(__pyx_t_7);
44201  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
44202  __Pyx_GIVEREF(__pyx_t_25);
44203  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_25);
44204  __pyx_t_7 = 0;
44205  __pyx_t_25 = 0;
44206  __pyx_t_25 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2361, __pyx_L1_error)
44207  __Pyx_GOTREF(__pyx_t_25);
44208  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->gAbs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2361, __pyx_L1_error)
44209  __Pyx_GOTREF(__pyx_t_7);
44210  if (PyDict_SetItem(__pyx_t_25, __pyx_n_s_g, __pyx_t_7) < 0) __PYX_ERR(0, 2361, __pyx_L1_error)
44211  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44212  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_25); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2361, __pyx_L1_error)
44213  __Pyx_GOTREF(__pyx_t_7);
44214  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44215  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44216  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
44217  __Pyx_XDECREF_SET(__pyx_v_ki, __pyx_t_7);
44218  __pyx_t_7 = 0;
44219 
44220  /* "WaveTools.py":2362
44221  * decomp[2] = -decomp[2][imin:imax]
44222  * ki = dispersion(decomp[0],self.depth,g=self.gAbs)
44223  * kDir = np.zeros((len(ki),3),"d") # <<<<<<<<<<<<<<
44224  * Tlag = np.zeros(ki.shape,)
44225  * for ii in range(len(ki)):
44226  */
44227  __Pyx_GetModuleGlobalName(__pyx_t_25, __pyx_n_s_np); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2362, __pyx_L1_error)
44228  __Pyx_GOTREF(__pyx_t_25);
44229  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_25, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2362, __pyx_L1_error)
44230  __Pyx_GOTREF(__pyx_t_6);
44231  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
44232  __pyx_t_18 = PyObject_Length(__pyx_v_ki); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2362, __pyx_L1_error)
44233  __pyx_t_25 = PyInt_FromSsize_t(__pyx_t_18); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2362, __pyx_L1_error)
44234  __Pyx_GOTREF(__pyx_t_25);
44235  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2362, __pyx_L1_error)
44236  __Pyx_GOTREF(__pyx_t_5);
44237  __Pyx_GIVEREF(__pyx_t_25);
44238  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_25);
44239  __Pyx_INCREF(__pyx_int_3);
44240  __Pyx_GIVEREF(__pyx_int_3);
44241  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_3);
44242  __pyx_t_25 = 0;
44243  __pyx_t_25 = NULL;
44244  __pyx_t_3 = 0;
44245  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
44246  __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_6);
44247  if (likely(__pyx_t_25)) {
44248  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
44249  __Pyx_INCREF(__pyx_t_25);
44250  __Pyx_INCREF(function);
44251  __Pyx_DECREF_SET(__pyx_t_6, function);
44252  __pyx_t_3 = 1;
44253  }
44254  }
44255  #if CYTHON_FAST_PYCALL
44256  if (PyFunction_Check(__pyx_t_6)) {
44257  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_5, __pyx_n_s_d};
44258  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2362, __pyx_L1_error)
44259  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
44260  __Pyx_GOTREF(__pyx_t_7);
44261  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44262  } else
44263  #endif
44264  #if CYTHON_FAST_PYCCALL
44265  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
44266  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_5, __pyx_n_s_d};
44267  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2362, __pyx_L1_error)
44268  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
44269  __Pyx_GOTREF(__pyx_t_7);
44270  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44271  } else
44272  #endif
44273  {
44274  __pyx_t_23 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2362, __pyx_L1_error)
44275  __Pyx_GOTREF(__pyx_t_23);
44276  if (__pyx_t_25) {
44277  __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_25); __pyx_t_25 = NULL;
44278  }
44279  __Pyx_GIVEREF(__pyx_t_5);
44280  PyTuple_SET_ITEM(__pyx_t_23, 0+__pyx_t_3, __pyx_t_5);
44281  __Pyx_INCREF(__pyx_n_s_d);
44282  __Pyx_GIVEREF(__pyx_n_s_d);
44283  PyTuple_SET_ITEM(__pyx_t_23, 1+__pyx_t_3, __pyx_n_s_d);
44284  __pyx_t_5 = 0;
44285  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2362, __pyx_L1_error)
44286  __Pyx_GOTREF(__pyx_t_7);
44287  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44288  }
44289  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44290  __Pyx_XDECREF_SET(__pyx_v_kDir, __pyx_t_7);
44291  __pyx_t_7 = 0;
44292 
44293  /* "WaveTools.py":2363
44294  * ki = dispersion(decomp[0],self.depth,g=self.gAbs)
44295  * kDir = np.zeros((len(ki),3),"d")
44296  * Tlag = np.zeros(ki.shape,) # <<<<<<<<<<<<<<
44297  * for ii in range(len(ki)):
44298  * kDir[ii,:] = ki[ii]*self.waveDir[:]
44299  */
44300  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2363, __pyx_L1_error)
44301  __Pyx_GOTREF(__pyx_t_6);
44302  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2363, __pyx_L1_error)
44303  __Pyx_GOTREF(__pyx_t_23);
44304  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44305  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_ki, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2363, __pyx_L1_error)
44306  __Pyx_GOTREF(__pyx_t_6);
44307  __pyx_t_5 = NULL;
44308  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
44309  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_23);
44310  if (likely(__pyx_t_5)) {
44311  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
44312  __Pyx_INCREF(__pyx_t_5);
44313  __Pyx_INCREF(function);
44314  __Pyx_DECREF_SET(__pyx_t_23, function);
44315  }
44316  }
44317  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_6);
44318  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
44319  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44320  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2363, __pyx_L1_error)
44321  __Pyx_GOTREF(__pyx_t_7);
44322  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44323  __Pyx_XDECREF_SET(__pyx_v_Tlag, __pyx_t_7);
44324  __pyx_t_7 = 0;
44325 
44326  /* "WaveTools.py":2364
44327  * kDir = np.zeros((len(ki),3),"d")
44328  * Tlag = np.zeros(ki.shape,)
44329  * for ii in range(len(ki)): # <<<<<<<<<<<<<<
44330  * kDir[ii,:] = ki[ii]*self.waveDir[:]
44331  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii])
44332  */
44333  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_range); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2364, __pyx_L1_error)
44334  __Pyx_GOTREF(__pyx_t_23);
44335  __pyx_t_18 = PyObject_Length(__pyx_v_ki); if (unlikely(__pyx_t_18 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2364, __pyx_L1_error)
44336  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_18); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2364, __pyx_L1_error)
44337  __Pyx_GOTREF(__pyx_t_6);
44338  __pyx_t_5 = NULL;
44339  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
44340  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_23);
44341  if (likely(__pyx_t_5)) {
44342  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
44343  __Pyx_INCREF(__pyx_t_5);
44344  __Pyx_INCREF(function);
44345  __Pyx_DECREF_SET(__pyx_t_23, function);
44346  }
44347  }
44348  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_6);
44349  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
44350  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44351  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2364, __pyx_L1_error)
44352  __Pyx_GOTREF(__pyx_t_7);
44353  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44354  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
44355  __pyx_t_23 = __pyx_t_7; __Pyx_INCREF(__pyx_t_23); __pyx_t_18 = 0;
44356  __pyx_t_13 = NULL;
44357  } else {
44358  __pyx_t_18 = -1; __pyx_t_23 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2364, __pyx_L1_error)
44359  __Pyx_GOTREF(__pyx_t_23);
44360  __pyx_t_13 = Py_TYPE(__pyx_t_23)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2364, __pyx_L1_error)
44361  }
44362  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44363  for (;;) {
44364  if (likely(!__pyx_t_13)) {
44365  if (likely(PyList_CheckExact(__pyx_t_23))) {
44366  if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_23)) break;
44367  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44368  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_18); __Pyx_INCREF(__pyx_t_7); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 2364, __pyx_L1_error)
44369  #else
44370  __pyx_t_7 = PySequence_ITEM(__pyx_t_23, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2364, __pyx_L1_error)
44371  __Pyx_GOTREF(__pyx_t_7);
44372  #endif
44373  } else {
44374  if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_23)) break;
44375  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44376  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_23, __pyx_t_18); __Pyx_INCREF(__pyx_t_7); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 2364, __pyx_L1_error)
44377  #else
44378  __pyx_t_7 = PySequence_ITEM(__pyx_t_23, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2364, __pyx_L1_error)
44379  __Pyx_GOTREF(__pyx_t_7);
44380  #endif
44381  }
44382  } else {
44383  __pyx_t_7 = __pyx_t_13(__pyx_t_23);
44384  if (unlikely(!__pyx_t_7)) {
44385  PyObject* exc_type = PyErr_Occurred();
44386  if (exc_type) {
44387  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
44388  else __PYX_ERR(0, 2364, __pyx_L1_error)
44389  }
44390  break;
44391  }
44392  __Pyx_GOTREF(__pyx_t_7);
44393  }
44394  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_7);
44395  __pyx_t_7 = 0;
44396 
44397  /* "WaveTools.py":2365
44398  * Tlag = np.zeros(ki.shape,)
44399  * for ii in range(len(ki)):
44400  * kDir[ii,:] = ki[ii]*self.waveDir[:] # <<<<<<<<<<<<<<
44401  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii])
44402  * self.Tlag = max(Tlag)
44403  */
44404  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_ki, __pyx_v_ii); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2365, __pyx_L1_error)
44405  __Pyx_GOTREF(__pyx_t_7);
44406  __pyx_t_6 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2365, __pyx_L1_error)
44407  __Pyx_GOTREF(__pyx_t_6);
44408  __pyx_t_5 = PyNumber_Multiply(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2365, __pyx_L1_error)
44409  __Pyx_GOTREF(__pyx_t_5);
44410  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44411  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44412  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2365, __pyx_L1_error)
44413  __Pyx_GOTREF(__pyx_t_6);
44414  __Pyx_INCREF(__pyx_v_ii);
44415  __Pyx_GIVEREF(__pyx_v_ii);
44416  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ii);
44417  __Pyx_INCREF(__pyx_slice__4);
44418  __Pyx_GIVEREF(__pyx_slice__4);
44419  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4);
44420  if (unlikely(PyObject_SetItem(__pyx_v_kDir, __pyx_t_6, __pyx_t_5) < 0)) __PYX_ERR(0, 2365, __pyx_L1_error)
44421  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44422  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44423 
44424  /* "WaveTools.py":2366
44425  * for ii in range(len(ki)):
44426  * kDir[ii,:] = ki[ii]*self.waveDir[:]
44427  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii]) # <<<<<<<<<<<<<<
44428  * self.Tlag = max(Tlag)
44429  * if self.Tlag > (old_div(self.Toverlap,2.) - self.cutoff*self.Twindow):
44430  */
44431  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2366, __pyx_L1_error)
44432  __Pyx_GOTREF(__pyx_t_6);
44433  __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2366, __pyx_L1_error)
44434  __Pyx_GOTREF(__pyx_t_7);
44435  __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2366, __pyx_L1_error)
44436  __Pyx_GOTREF(__pyx_t_25);
44437  __Pyx_INCREF(__pyx_v_ii);
44438  __Pyx_GIVEREF(__pyx_v_ii);
44439  PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_v_ii);
44440  __Pyx_INCREF(__pyx_slice__4);
44441  __Pyx_GIVEREF(__pyx_slice__4);
44442  PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_slice__4);
44443  __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_kDir, __pyx_t_25); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2366, __pyx_L1_error)
44444  __Pyx_GOTREF(__pyx_t_12);
44445  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
44446  __pyx_t_25 = PyNumber_Multiply(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2366, __pyx_L1_error)
44447  __Pyx_GOTREF(__pyx_t_25);
44448  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44449  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44450  __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_25); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2366, __pyx_L1_error)
44451  __Pyx_GOTREF(__pyx_t_12);
44452  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
44453  __pyx_t_25 = __Pyx_GetItemInt(__pyx_v_decomp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 2366, __pyx_L1_error)
44454  __Pyx_GOTREF(__pyx_t_25);
44455  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_25, __pyx_v_ii); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2366, __pyx_L1_error)
44456  __Pyx_GOTREF(__pyx_t_7);
44457  __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
44458  __pyx_t_25 = NULL;
44459  __pyx_t_3 = 0;
44460  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
44461  __pyx_t_25 = PyMethod_GET_SELF(__pyx_t_6);
44462  if (likely(__pyx_t_25)) {
44463  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
44464  __Pyx_INCREF(__pyx_t_25);
44465  __Pyx_INCREF(function);
44466  __Pyx_DECREF_SET(__pyx_t_6, function);
44467  __pyx_t_3 = 1;
44468  }
44469  }
44470  #if CYTHON_FAST_PYCALL
44471  if (PyFunction_Check(__pyx_t_6)) {
44472  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_12, __pyx_t_7};
44473  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2366, __pyx_L1_error)
44474  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
44475  __Pyx_GOTREF(__pyx_t_5);
44476  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44477  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44478  } else
44479  #endif
44480  #if CYTHON_FAST_PYCCALL
44481  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
44482  PyObject *__pyx_temp[3] = {__pyx_t_25, __pyx_t_12, __pyx_t_7};
44483  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2366, __pyx_L1_error)
44484  __Pyx_XDECREF(__pyx_t_25); __pyx_t_25 = 0;
44485  __Pyx_GOTREF(__pyx_t_5);
44486  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44487  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
44488  } else
44489  #endif
44490  {
44491  __pyx_t_14 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2366, __pyx_L1_error)
44492  __Pyx_GOTREF(__pyx_t_14);
44493  if (__pyx_t_25) {
44494  __Pyx_GIVEREF(__pyx_t_25); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_25); __pyx_t_25 = NULL;
44495  }
44496  __Pyx_GIVEREF(__pyx_t_12);
44497  PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_3, __pyx_t_12);
44498  __Pyx_GIVEREF(__pyx_t_7);
44499  PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_3, __pyx_t_7);
44500  __pyx_t_12 = 0;
44501  __pyx_t_7 = 0;
44502  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2366, __pyx_L1_error)
44503  __Pyx_GOTREF(__pyx_t_5);
44504  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44505  }
44506  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44507  if (unlikely(PyObject_SetItem(__pyx_v_Tlag, __pyx_v_ii, __pyx_t_5) < 0)) __PYX_ERR(0, 2366, __pyx_L1_error)
44508  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44509 
44510  /* "WaveTools.py":2364
44511  * kDir = np.zeros((len(ki),3),"d")
44512  * Tlag = np.zeros(ki.shape,)
44513  * for ii in range(len(ki)): # <<<<<<<<<<<<<<
44514  * kDir[ii,:] = ki[ii]*self.waveDir[:]
44515  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii])
44516  */
44517  }
44518  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44519 
44520  /* "WaveTools.py":2367
44521  * kDir[ii,:] = ki[ii]*self.waveDir[:]
44522  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii])
44523  * self.Tlag = max(Tlag) # <<<<<<<<<<<<<<
44524  * if self.Tlag > (old_div(self.Toverlap,2.) - self.cutoff*self.Twindow):
44525  * logEvent("ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone")
44526  */
44527  __pyx_t_23 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_Tlag); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2367, __pyx_L1_error)
44528  __Pyx_GOTREF(__pyx_t_23);
44529  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_23); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L1_error)
44530  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44531  __pyx_v_self->Tlag = __pyx_t_2;
44532 
44533  /* "WaveTools.py":2368
44534  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii])
44535  * self.Tlag = max(Tlag)
44536  * if self.Tlag > (old_div(self.Toverlap,2.) - self.cutoff*self.Twindow): # <<<<<<<<<<<<<<
44537  * logEvent("ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone")
44538  * sys.exit(1)
44539  */
44540  __pyx_t_23 = PyFloat_FromDouble(__pyx_v_self->Tlag); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2368, __pyx_L1_error)
44541  __Pyx_GOTREF(__pyx_t_23);
44542  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2368, __pyx_L1_error)
44543  __Pyx_GOTREF(__pyx_t_6);
44544  __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->Toverlap); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2368, __pyx_L1_error)
44545  __Pyx_GOTREF(__pyx_t_14);
44546  __pyx_t_7 = NULL;
44547  __pyx_t_3 = 0;
44548  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
44549  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
44550  if (likely(__pyx_t_7)) {
44551  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
44552  __Pyx_INCREF(__pyx_t_7);
44553  __Pyx_INCREF(function);
44554  __Pyx_DECREF_SET(__pyx_t_6, function);
44555  __pyx_t_3 = 1;
44556  }
44557  }
44558  #if CYTHON_FAST_PYCALL
44559  if (PyFunction_Check(__pyx_t_6)) {
44560  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_14, __pyx_float_2_};
44561  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2368, __pyx_L1_error)
44562  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
44563  __Pyx_GOTREF(__pyx_t_5);
44564  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44565  } else
44566  #endif
44567  #if CYTHON_FAST_PYCCALL
44568  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
44569  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_14, __pyx_float_2_};
44570  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_3, 2+__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2368, __pyx_L1_error)
44571  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
44572  __Pyx_GOTREF(__pyx_t_5);
44573  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
44574  } else
44575  #endif
44576  {
44577  __pyx_t_12 = PyTuple_New(2+__pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2368, __pyx_L1_error)
44578  __Pyx_GOTREF(__pyx_t_12);
44579  if (__pyx_t_7) {
44580  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
44581  }
44582  __Pyx_GIVEREF(__pyx_t_14);
44583  PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_3, __pyx_t_14);
44584  __Pyx_INCREF(__pyx_float_2_);
44585  __Pyx_GIVEREF(__pyx_float_2_);
44586  PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_3, __pyx_float_2_);
44587  __pyx_t_14 = 0;
44588  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2368, __pyx_L1_error)
44589  __Pyx_GOTREF(__pyx_t_5);
44590  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44591  }
44592  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44593  __pyx_t_6 = PyFloat_FromDouble((__pyx_v_self->cutoff * __pyx_v_self->Twindow)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2368, __pyx_L1_error)
44594  __Pyx_GOTREF(__pyx_t_6);
44595  __pyx_t_12 = PyNumber_Subtract(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2368, __pyx_L1_error)
44596  __Pyx_GOTREF(__pyx_t_12);
44597  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
44598  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44599  __pyx_t_6 = PyObject_RichCompare(__pyx_t_23, __pyx_t_12, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2368, __pyx_L1_error)
44600  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44601  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44602  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2368, __pyx_L1_error)
44603  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44604  if (__pyx_t_10) {
44605 
44606  /* "WaveTools.py":2369
44607  * self.Tlag = max(Tlag)
44608  * if self.Tlag > (old_div(self.Toverlap,2.) - self.cutoff*self.Twindow):
44609  * logEvent("ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone") # <<<<<<<<<<<<<<
44610  * sys.exit(1)
44611  * decomp.append(kDir)
44612  */
44613  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2369, __pyx_L1_error)
44614  __Pyx_GOTREF(__pyx_t_12);
44615  __pyx_t_23 = NULL;
44616  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
44617  __pyx_t_23 = PyMethod_GET_SELF(__pyx_t_12);
44618  if (likely(__pyx_t_23)) {
44619  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
44620  __Pyx_INCREF(__pyx_t_23);
44621  __Pyx_INCREF(function);
44622  __Pyx_DECREF_SET(__pyx_t_12, function);
44623  }
44624  }
44625  __pyx_t_6 = (__pyx_t_23) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_23, __pyx_kp_s_ERROR_WaveTools_py_Relaxation_zo) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_s_ERROR_WaveTools_py_Relaxation_zo);
44626  __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
44627  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2369, __pyx_L1_error)
44628  __Pyx_GOTREF(__pyx_t_6);
44629  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44630  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44631 
44632  /* "WaveTools.py":2370
44633  * if self.Tlag > (old_div(self.Toverlap,2.) - self.cutoff*self.Twindow):
44634  * logEvent("ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone")
44635  * sys.exit(1) # <<<<<<<<<<<<<<
44636  * decomp.append(kDir)
44637  * decomp.append(ki)
44638  */
44639  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2370, __pyx_L1_error)
44640  __Pyx_GOTREF(__pyx_t_12);
44641  __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exit); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2370, __pyx_L1_error)
44642  __Pyx_GOTREF(__pyx_t_23);
44643  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44644  __pyx_t_12 = NULL;
44645  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
44646  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_23);
44647  if (likely(__pyx_t_12)) {
44648  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
44649  __Pyx_INCREF(__pyx_t_12);
44650  __Pyx_INCREF(function);
44651  __Pyx_DECREF_SET(__pyx_t_23, function);
44652  }
44653  }
44654  __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_12, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_int_1);
44655  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
44656  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2370, __pyx_L1_error)
44657  __Pyx_GOTREF(__pyx_t_6);
44658  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44659  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44660 
44661  /* "WaveTools.py":2368
44662  * Tlag[ii] = old_div(sum(Lgen[:]*kDir[ii,:]),decomp[0][ii])
44663  * self.Tlag = max(Tlag)
44664  * if self.Tlag > (old_div(self.Toverlap,2.) - self.cutoff*self.Twindow): # <<<<<<<<<<<<<<
44665  * logEvent("ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone")
44666  * sys.exit(1)
44667  */
44668  }
44669 
44670  /* "WaveTools.py":2371
44671  * logEvent("ERROR!: WaveTools.py: Relaxation zone lenght does not allow for spatial coherency in the windows method.Please a) increase number of waves per window or b) increase overlap or c) decrease lenght of the relaxation zone")
44672  * sys.exit(1)
44673  * decomp.append(kDir) # <<<<<<<<<<<<<<
44674  * decomp.append(ki)
44675  *
44676  */
44677  __pyx_t_24 = __Pyx_PyObject_Append(__pyx_v_decomp, __pyx_v_kDir); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 2371, __pyx_L1_error)
44678 
44679  /* "WaveTools.py":2372
44680  * sys.exit(1)
44681  * decomp.append(kDir)
44682  * decomp.append(ki) # <<<<<<<<<<<<<<
44683  *
44684  * self.decompose_window.append(decomp)
44685  */
44686  __pyx_t_24 = __Pyx_PyObject_Append(__pyx_v_decomp, __pyx_v_ki); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 2372, __pyx_L1_error)
44687 
44688  /* "WaveTools.py":2374
44689  * decomp.append(ki)
44690  *
44691  * self.decompose_window.append(decomp) # <<<<<<<<<<<<<<
44692  *
44693  *
44694  */
44695  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
44696  PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
44697  __PYX_ERR(0, 2374, __pyx_L1_error)
44698  }
44699  __pyx_t_24 = __Pyx_PyList_Append(__pyx_v_self->decompose_window, __pyx_v_decomp); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 2374, __pyx_L1_error)
44700 
44701  /* "WaveTools.py":2341
44702  * # ii = 0
44703  *
44704  * for wind in self.windows_rec: # <<<<<<<<<<<<<<
44705  * nfft=len(wind[:,0])
44706  * wind[:,1] *=wind_filt(nfft,cutoff = self.cutoff)
44707  */
44708  }
44709  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
44710 
44711  /* "WaveTools.py":2379
44712  * #c++ declarations
44713  *
44714  * for ii in range(len(self.windows_handover)): # <<<<<<<<<<<<<<
44715  * self.whand_c[ii] = self.windows_handover[ii]
44716  * self.T0[ii] = self.windows_rec[ii][0,0]
44717  */
44718  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2379, __pyx_L1_error)
44719  __Pyx_GOTREF(__pyx_t_6);
44720  __pyx_t_23 = __pyx_v_self->windows_handover;
44721  __Pyx_INCREF(__pyx_t_23);
44722  if (unlikely(__pyx_t_23 == Py_None)) {
44723  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
44724  __PYX_ERR(0, 2379, __pyx_L1_error)
44725  }
44726  __pyx_t_8 = PyList_GET_SIZE(__pyx_t_23); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2379, __pyx_L1_error)
44727  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44728  __pyx_t_23 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2379, __pyx_L1_error)
44729  __Pyx_GOTREF(__pyx_t_23);
44730  __pyx_t_12 = NULL;
44731  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
44732  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
44733  if (likely(__pyx_t_12)) {
44734  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
44735  __Pyx_INCREF(__pyx_t_12);
44736  __Pyx_INCREF(function);
44737  __Pyx_DECREF_SET(__pyx_t_6, function);
44738  }
44739  }
44740  __pyx_t_11 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_12, __pyx_t_23) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_23);
44741  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
44742  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44743  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error)
44744  __Pyx_GOTREF(__pyx_t_11);
44745  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44746  if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
44747  __pyx_t_6 = __pyx_t_11; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
44748  __pyx_t_13 = NULL;
44749  } else {
44750  __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2379, __pyx_L1_error)
44751  __Pyx_GOTREF(__pyx_t_6);
44752  __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2379, __pyx_L1_error)
44753  }
44754  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
44755  for (;;) {
44756  if (likely(!__pyx_t_13)) {
44757  if (likely(PyList_CheckExact(__pyx_t_6))) {
44758  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
44759  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44760  __pyx_t_11 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2379, __pyx_L1_error)
44761  #else
44762  __pyx_t_11 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error)
44763  __Pyx_GOTREF(__pyx_t_11);
44764  #endif
44765  } else {
44766  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
44767  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44768  __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2379, __pyx_L1_error)
44769  #else
44770  __pyx_t_11 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error)
44771  __Pyx_GOTREF(__pyx_t_11);
44772  #endif
44773  }
44774  } else {
44775  __pyx_t_11 = __pyx_t_13(__pyx_t_6);
44776  if (unlikely(!__pyx_t_11)) {
44777  PyObject* exc_type = PyErr_Occurred();
44778  if (exc_type) {
44779  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
44780  else __PYX_ERR(0, 2379, __pyx_L1_error)
44781  }
44782  break;
44783  }
44784  __Pyx_GOTREF(__pyx_t_11);
44785  }
44786  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_11);
44787  __pyx_t_11 = 0;
44788 
44789  /* "WaveTools.py":2380
44790  *
44791  * for ii in range(len(self.windows_handover)):
44792  * self.whand_c[ii] = self.windows_handover[ii] # <<<<<<<<<<<<<<
44793  * self.T0[ii] = self.windows_rec[ii][0,0]
44794  * self.whand_ = self.whand_c
44795  */
44796  if (unlikely(__pyx_v_self->windows_handover == Py_None)) {
44797  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
44798  __PYX_ERR(0, 2380, __pyx_L1_error)
44799  }
44800  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_self->windows_handover, __pyx_v_ii); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2380, __pyx_L1_error)
44801  __Pyx_GOTREF(__pyx_t_11);
44802  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L1_error)
44803  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
44804  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L1_error)
44805  (__pyx_v_self->whand_c[__pyx_t_18]) = __pyx_t_2;
44806 
44807  /* "WaveTools.py":2381
44808  * for ii in range(len(self.windows_handover)):
44809  * self.whand_c[ii] = self.windows_handover[ii]
44810  * self.T0[ii] = self.windows_rec[ii][0,0] # <<<<<<<<<<<<<<
44811  * self.whand_ = self.whand_c
44812  * self.T0_ = self.T0
44813  */
44814  if (unlikely(__pyx_v_self->windows_rec == Py_None)) {
44815  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
44816  __PYX_ERR(0, 2381, __pyx_L1_error)
44817  }
44818  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_self->windows_rec, __pyx_v_ii); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2381, __pyx_L1_error)
44819  __Pyx_GOTREF(__pyx_t_11);
44820  __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_tuple__46); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2381, __pyx_L1_error)
44821  __Pyx_GOTREF(__pyx_t_23);
44822  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
44823  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_23); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L1_error)
44824  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44825  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2381, __pyx_L1_error)
44826  (__pyx_v_self->T0[__pyx_t_18]) = __pyx_t_2;
44827 
44828  /* "WaveTools.py":2379
44829  * #c++ declarations
44830  *
44831  * for ii in range(len(self.windows_handover)): # <<<<<<<<<<<<<<
44832  * self.whand_c[ii] = self.windows_handover[ii]
44833  * self.T0[ii] = self.windows_rec[ii][0,0]
44834  */
44835  }
44836  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44837 
44838  /* "WaveTools.py":2382
44839  * self.whand_c[ii] = self.windows_handover[ii]
44840  * self.T0[ii] = self.windows_rec[ii][0,0]
44841  * self.whand_ = self.whand_c # <<<<<<<<<<<<<<
44842  * self.T0_ = self.T0
44843  * for ii in range(self.Nwindows):
44844  */
44845  __pyx_t_19 = __pyx_v_self->whand_c;
44846  __pyx_v_self->whand_ = __pyx_t_19;
44847 
44848  /* "WaveTools.py":2383
44849  * self.T0[ii] = self.windows_rec[ii][0,0]
44850  * self.whand_ = self.whand_c
44851  * self.T0_ = self.T0 # <<<<<<<<<<<<<<
44852  * for ii in range(self.Nwindows):
44853  * for jj in range(self.N):
44854  */
44855  __pyx_t_19 = __pyx_v_self->T0;
44856  __pyx_v_self->T0_ = __pyx_t_19;
44857 
44858  /* "WaveTools.py":2384
44859  * self.whand_ = self.whand_c
44860  * self.T0_ = self.T0
44861  * for ii in range(self.Nwindows): # <<<<<<<<<<<<<<
44862  * for jj in range(self.N):
44863  * ij = ii*self.N + jj
44864  */
44865  __Pyx_GetModuleGlobalName(__pyx_t_23, __pyx_n_s_range); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2384, __pyx_L1_error)
44866  __Pyx_GOTREF(__pyx_t_23);
44867  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->Nwindows); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2384, __pyx_L1_error)
44868  __Pyx_GOTREF(__pyx_t_11);
44869  __pyx_t_12 = NULL;
44870  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
44871  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_23);
44872  if (likely(__pyx_t_12)) {
44873  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
44874  __Pyx_INCREF(__pyx_t_12);
44875  __Pyx_INCREF(function);
44876  __Pyx_DECREF_SET(__pyx_t_23, function);
44877  }
44878  }
44879  __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_23, __pyx_t_12, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_23, __pyx_t_11);
44880  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
44881  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
44882  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2384, __pyx_L1_error)
44883  __Pyx_GOTREF(__pyx_t_6);
44884  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
44885  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
44886  __pyx_t_23 = __pyx_t_6; __Pyx_INCREF(__pyx_t_23); __pyx_t_8 = 0;
44887  __pyx_t_13 = NULL;
44888  } else {
44889  __pyx_t_8 = -1; __pyx_t_23 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2384, __pyx_L1_error)
44890  __Pyx_GOTREF(__pyx_t_23);
44891  __pyx_t_13 = Py_TYPE(__pyx_t_23)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2384, __pyx_L1_error)
44892  }
44893  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44894  for (;;) {
44895  if (likely(!__pyx_t_13)) {
44896  if (likely(PyList_CheckExact(__pyx_t_23))) {
44897  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_23)) break;
44898  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44899  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_23, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2384, __pyx_L1_error)
44900  #else
44901  __pyx_t_6 = PySequence_ITEM(__pyx_t_23, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2384, __pyx_L1_error)
44902  __Pyx_GOTREF(__pyx_t_6);
44903  #endif
44904  } else {
44905  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_23)) break;
44906  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44907  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_23, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2384, __pyx_L1_error)
44908  #else
44909  __pyx_t_6 = PySequence_ITEM(__pyx_t_23, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2384, __pyx_L1_error)
44910  __Pyx_GOTREF(__pyx_t_6);
44911  #endif
44912  }
44913  } else {
44914  __pyx_t_6 = __pyx_t_13(__pyx_t_23);
44915  if (unlikely(!__pyx_t_6)) {
44916  PyObject* exc_type = PyErr_Occurred();
44917  if (exc_type) {
44918  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
44919  else __PYX_ERR(0, 2384, __pyx_L1_error)
44920  }
44921  break;
44922  }
44923  __Pyx_GOTREF(__pyx_t_6);
44924  }
44925  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_6);
44926  __pyx_t_6 = 0;
44927 
44928  /* "WaveTools.py":2385
44929  * self.T0_ = self.T0
44930  * for ii in range(self.Nwindows):
44931  * for jj in range(self.N): # <<<<<<<<<<<<<<
44932  * ij = ii*self.N + jj
44933  * if(jj <len(self.decompose_window[ii][0])):
44934  */
44935  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_range); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2385, __pyx_L1_error)
44936  __Pyx_GOTREF(__pyx_t_11);
44937  __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2385, __pyx_L1_error)
44938  __Pyx_GOTREF(__pyx_t_12);
44939  __pyx_t_5 = NULL;
44940  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
44941  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
44942  if (likely(__pyx_t_5)) {
44943  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
44944  __Pyx_INCREF(__pyx_t_5);
44945  __Pyx_INCREF(function);
44946  __Pyx_DECREF_SET(__pyx_t_11, function);
44947  }
44948  }
44949  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_5, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_12);
44950  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
44951  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
44952  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2385, __pyx_L1_error)
44953  __Pyx_GOTREF(__pyx_t_6);
44954  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
44955  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
44956  __pyx_t_11 = __pyx_t_6; __Pyx_INCREF(__pyx_t_11); __pyx_t_18 = 0;
44957  __pyx_t_17 = NULL;
44958  } else {
44959  __pyx_t_18 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2385, __pyx_L1_error)
44960  __Pyx_GOTREF(__pyx_t_11);
44961  __pyx_t_17 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2385, __pyx_L1_error)
44962  }
44963  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
44964  for (;;) {
44965  if (likely(!__pyx_t_17)) {
44966  if (likely(PyList_CheckExact(__pyx_t_11))) {
44967  if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_11)) break;
44968  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44969  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 2385, __pyx_L1_error)
44970  #else
44971  __pyx_t_6 = PySequence_ITEM(__pyx_t_11, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2385, __pyx_L1_error)
44972  __Pyx_GOTREF(__pyx_t_6);
44973  #endif
44974  } else {
44975  if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
44976  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
44977  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_18); __Pyx_INCREF(__pyx_t_6); __pyx_t_18++; if (unlikely(0 < 0)) __PYX_ERR(0, 2385, __pyx_L1_error)
44978  #else
44979  __pyx_t_6 = PySequence_ITEM(__pyx_t_11, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2385, __pyx_L1_error)
44980  __Pyx_GOTREF(__pyx_t_6);
44981  #endif
44982  }
44983  } else {
44984  __pyx_t_6 = __pyx_t_17(__pyx_t_11);
44985  if (unlikely(!__pyx_t_6)) {
44986  PyObject* exc_type = PyErr_Occurred();
44987  if (exc_type) {
44988  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
44989  else __PYX_ERR(0, 2385, __pyx_L1_error)
44990  }
44991  break;
44992  }
44993  __Pyx_GOTREF(__pyx_t_6);
44994  }
44995  __Pyx_XDECREF_SET(__pyx_v_jj, __pyx_t_6);
44996  __pyx_t_6 = 0;
44997 
44998  /* "WaveTools.py":2386
44999  * for ii in range(self.Nwindows):
45000  * for jj in range(self.N):
45001  * ij = ii*self.N + jj # <<<<<<<<<<<<<<
45002  * if(jj <len(self.decompose_window[ii][0])):
45003  * self.omega_c[ij] = self.decompose_window[ii][0][jj]
45004  */
45005  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2386, __pyx_L1_error)
45006  __Pyx_GOTREF(__pyx_t_6);
45007  __pyx_t_12 = PyNumber_Multiply(__pyx_v_ii, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2386, __pyx_L1_error)
45008  __Pyx_GOTREF(__pyx_t_12);
45009  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45010  __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_v_jj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2386, __pyx_L1_error)
45011  __Pyx_GOTREF(__pyx_t_6);
45012  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45013  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_6);
45014  __pyx_t_6 = 0;
45015 
45016  /* "WaveTools.py":2387
45017  * for jj in range(self.N):
45018  * ij = ii*self.N + jj
45019  * if(jj <len(self.decompose_window[ii][0])): # <<<<<<<<<<<<<<
45020  * self.omega_c[ij] = self.decompose_window[ii][0][jj]
45021  * self.ki_c[ij] = self.decompose_window[ii][5][jj]
45022  */
45023  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
45024  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
45025  __PYX_ERR(0, 2387, __pyx_L1_error)
45026  }
45027  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->decompose_window, __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2387, __pyx_L1_error)
45028  __Pyx_GOTREF(__pyx_t_6);
45029  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2387, __pyx_L1_error)
45030  __Pyx_GOTREF(__pyx_t_12);
45031  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45032  __pyx_t_16 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_16 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2387, __pyx_L1_error)
45033  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45034  __pyx_t_12 = PyInt_FromSsize_t(__pyx_t_16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2387, __pyx_L1_error)
45035  __Pyx_GOTREF(__pyx_t_12);
45036  __pyx_t_6 = PyObject_RichCompare(__pyx_v_jj, __pyx_t_12, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2387, __pyx_L1_error)
45037  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45038  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 2387, __pyx_L1_error)
45039  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45040  if (__pyx_t_10) {
45041 
45042  /* "WaveTools.py":2388
45043  * ij = ii*self.N + jj
45044  * if(jj <len(self.decompose_window[ii][0])):
45045  * self.omega_c[ij] = self.decompose_window[ii][0][jj] # <<<<<<<<<<<<<<
45046  * self.ki_c[ij] = self.decompose_window[ii][5][jj]
45047  * self.tanh_c[ij] = np.tanh(self.ki_c[ij]*self.depth)
45048  */
45049  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
45050  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
45051  __PYX_ERR(0, 2388, __pyx_L1_error)
45052  }
45053  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->decompose_window, __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2388, __pyx_L1_error)
45054  __Pyx_GOTREF(__pyx_t_6);
45055  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2388, __pyx_L1_error)
45056  __Pyx_GOTREF(__pyx_t_12);
45057  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45058  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_jj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2388, __pyx_L1_error)
45059  __Pyx_GOTREF(__pyx_t_6);
45060  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45061  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2388, __pyx_L1_error)
45062  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45063  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2388, __pyx_L1_error)
45064  (__pyx_v_self->omega_c[__pyx_t_16]) = __pyx_t_2;
45065 
45066  /* "WaveTools.py":2389
45067  * if(jj <len(self.decompose_window[ii][0])):
45068  * self.omega_c[ij] = self.decompose_window[ii][0][jj]
45069  * self.ki_c[ij] = self.decompose_window[ii][5][jj] # <<<<<<<<<<<<<<
45070  * self.tanh_c[ij] = np.tanh(self.ki_c[ij]*self.depth)
45071  * self.ai_c[ij] = self.decompose_window[ii][1][jj]
45072  */
45073  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
45074  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
45075  __PYX_ERR(0, 2389, __pyx_L1_error)
45076  }
45077  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->decompose_window, __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2389, __pyx_L1_error)
45078  __Pyx_GOTREF(__pyx_t_6);
45079  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2389, __pyx_L1_error)
45080  __Pyx_GOTREF(__pyx_t_12);
45081  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45082  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_v_jj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2389, __pyx_L1_error)
45083  __Pyx_GOTREF(__pyx_t_6);
45084  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45085  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2389, __pyx_L1_error)
45086  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45087  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2389, __pyx_L1_error)
45088  (__pyx_v_self->ki_c[__pyx_t_16]) = __pyx_t_2;
45089 
45090  /* "WaveTools.py":2390
45091  * self.omega_c[ij] = self.decompose_window[ii][0][jj]
45092  * self.ki_c[ij] = self.decompose_window[ii][5][jj]
45093  * self.tanh_c[ij] = np.tanh(self.ki_c[ij]*self.depth) # <<<<<<<<<<<<<<
45094  * self.ai_c[ij] = self.decompose_window[ii][1][jj]
45095  * self.phi_c[ij] =self.decompose_window[ii][2][jj]
45096  */
45097  __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2390, __pyx_L1_error)
45098  __Pyx_GOTREF(__pyx_t_12);
45099  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_tanh); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2390, __pyx_L1_error)
45100  __Pyx_GOTREF(__pyx_t_5);
45101  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45102  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L1_error)
45103  __pyx_t_12 = PyFloat_FromDouble(((__pyx_v_self->ki_c[__pyx_t_16]) * __pyx_v_self->depth)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2390, __pyx_L1_error)
45104  __Pyx_GOTREF(__pyx_t_12);
45105  __pyx_t_14 = NULL;
45106  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
45107  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
45108  if (likely(__pyx_t_14)) {
45109  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
45110  __Pyx_INCREF(__pyx_t_14);
45111  __Pyx_INCREF(function);
45112  __Pyx_DECREF_SET(__pyx_t_5, function);
45113  }
45114  }
45115  __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_14, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12);
45116  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
45117  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45118  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2390, __pyx_L1_error)
45119  __Pyx_GOTREF(__pyx_t_6);
45120  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45121  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L1_error)
45122  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45123  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L1_error)
45124  (__pyx_v_self->tanh_c[__pyx_t_16]) = __pyx_t_2;
45125 
45126  /* "WaveTools.py":2391
45127  * self.ki_c[ij] = self.decompose_window[ii][5][jj]
45128  * self.tanh_c[ij] = np.tanh(self.ki_c[ij]*self.depth)
45129  * self.ai_c[ij] = self.decompose_window[ii][1][jj] # <<<<<<<<<<<<<<
45130  * self.phi_c[ij] =self.decompose_window[ii][2][jj]
45131  * for kk in range(3):
45132  */
45133  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
45134  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
45135  __PYX_ERR(0, 2391, __pyx_L1_error)
45136  }
45137  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->decompose_window, __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2391, __pyx_L1_error)
45138  __Pyx_GOTREF(__pyx_t_6);
45139  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2391, __pyx_L1_error)
45140  __Pyx_GOTREF(__pyx_t_5);
45141  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45142  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_jj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2391, __pyx_L1_error)
45143  __Pyx_GOTREF(__pyx_t_6);
45144  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45145  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2391, __pyx_L1_error)
45146  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45147  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2391, __pyx_L1_error)
45148  (__pyx_v_self->ai_c[__pyx_t_16]) = __pyx_t_2;
45149 
45150  /* "WaveTools.py":2392
45151  * self.tanh_c[ij] = np.tanh(self.ki_c[ij]*self.depth)
45152  * self.ai_c[ij] = self.decompose_window[ii][1][jj]
45153  * self.phi_c[ij] =self.decompose_window[ii][2][jj] # <<<<<<<<<<<<<<
45154  * for kk in range(3):
45155  * self.kDir_c[3*ij+kk] = self.decompose_window[ii][4][jj,kk]
45156  */
45157  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
45158  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
45159  __PYX_ERR(0, 2392, __pyx_L1_error)
45160  }
45161  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->decompose_window, __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2392, __pyx_L1_error)
45162  __Pyx_GOTREF(__pyx_t_6);
45163  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2392, __pyx_L1_error)
45164  __Pyx_GOTREF(__pyx_t_5);
45165  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45166  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_jj); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2392, __pyx_L1_error)
45167  __Pyx_GOTREF(__pyx_t_6);
45168  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45169  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L1_error)
45170  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45171  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2392, __pyx_L1_error)
45172  (__pyx_v_self->phi_c[__pyx_t_16]) = __pyx_t_2;
45173 
45174  /* "WaveTools.py":2393
45175  * self.ai_c[ij] = self.decompose_window[ii][1][jj]
45176  * self.phi_c[ij] =self.decompose_window[ii][2][jj]
45177  * for kk in range(3): # <<<<<<<<<<<<<<
45178  * self.kDir_c[3*ij+kk] = self.decompose_window[ii][4][jj,kk]
45179  * else:
45180  */
45181  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2393, __pyx_L1_error)
45182  __Pyx_GOTREF(__pyx_t_5);
45183  __pyx_t_12 = NULL;
45184  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
45185  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_5);
45186  if (likely(__pyx_t_12)) {
45187  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
45188  __Pyx_INCREF(__pyx_t_12);
45189  __Pyx_INCREF(function);
45190  __Pyx_DECREF_SET(__pyx_t_5, function);
45191  }
45192  }
45193  __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_12, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_3);
45194  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
45195  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2393, __pyx_L1_error)
45196  __Pyx_GOTREF(__pyx_t_6);
45197  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45198  if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
45199  __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_16 = 0;
45200  __pyx_t_27 = NULL;
45201  } else {
45202  __pyx_t_16 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2393, __pyx_L1_error)
45203  __Pyx_GOTREF(__pyx_t_5);
45204  __pyx_t_27 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2393, __pyx_L1_error)
45205  }
45206  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45207  for (;;) {
45208  if (likely(!__pyx_t_27)) {
45209  if (likely(PyList_CheckExact(__pyx_t_5))) {
45210  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_5)) break;
45211  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45212  __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 2393, __pyx_L1_error)
45213  #else
45214  __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2393, __pyx_L1_error)
45215  __Pyx_GOTREF(__pyx_t_6);
45216  #endif
45217  } else {
45218  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
45219  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45220  __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_16); __Pyx_INCREF(__pyx_t_6); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 2393, __pyx_L1_error)
45221  #else
45222  __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2393, __pyx_L1_error)
45223  __Pyx_GOTREF(__pyx_t_6);
45224  #endif
45225  }
45226  } else {
45227  __pyx_t_6 = __pyx_t_27(__pyx_t_5);
45228  if (unlikely(!__pyx_t_6)) {
45229  PyObject* exc_type = PyErr_Occurred();
45230  if (exc_type) {
45231  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
45232  else __PYX_ERR(0, 2393, __pyx_L1_error)
45233  }
45234  break;
45235  }
45236  __Pyx_GOTREF(__pyx_t_6);
45237  }
45238  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_6);
45239  __pyx_t_6 = 0;
45240 
45241  /* "WaveTools.py":2394
45242  * self.phi_c[ij] =self.decompose_window[ii][2][jj]
45243  * for kk in range(3):
45244  * self.kDir_c[3*ij+kk] = self.decompose_window[ii][4][jj,kk] # <<<<<<<<<<<<<<
45245  * else:
45246  * self.omega_c[ij] =1.
45247  */
45248  if (unlikely(__pyx_v_self->decompose_window == Py_None)) {
45249  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
45250  __PYX_ERR(0, 2394, __pyx_L1_error)
45251  }
45252  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_self->decompose_window, __pyx_v_ii); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2394, __pyx_L1_error)
45253  __Pyx_GOTREF(__pyx_t_6);
45254  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2394, __pyx_L1_error)
45255  __Pyx_GOTREF(__pyx_t_12);
45256  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45257  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2394, __pyx_L1_error)
45258  __Pyx_GOTREF(__pyx_t_6);
45259  __Pyx_INCREF(__pyx_v_jj);
45260  __Pyx_GIVEREF(__pyx_v_jj);
45261  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_jj);
45262  __Pyx_INCREF(__pyx_v_kk);
45263  __Pyx_GIVEREF(__pyx_v_kk);
45264  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_kk);
45265  __pyx_t_14 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2394, __pyx_L1_error)
45266  __Pyx_GOTREF(__pyx_t_14);
45267  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
45268  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45269  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_14); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)
45270  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
45271  __pyx_t_14 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2394, __pyx_L1_error)
45272  __Pyx_GOTREF(__pyx_t_14);
45273  __pyx_t_6 = PyNumber_Add(__pyx_t_14, __pyx_v_kk); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2394, __pyx_L1_error)
45274  __Pyx_GOTREF(__pyx_t_6);
45275  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
45276  __pyx_t_28 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_28 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2394, __pyx_L1_error)
45277  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45278  (__pyx_v_self->kDir_c[__pyx_t_28]) = __pyx_t_2;
45279 
45280  /* "WaveTools.py":2393
45281  * self.ai_c[ij] = self.decompose_window[ii][1][jj]
45282  * self.phi_c[ij] =self.decompose_window[ii][2][jj]
45283  * for kk in range(3): # <<<<<<<<<<<<<<
45284  * self.kDir_c[3*ij+kk] = self.decompose_window[ii][4][jj,kk]
45285  * else:
45286  */
45287  }
45288  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45289 
45290  /* "WaveTools.py":2387
45291  * for jj in range(self.N):
45292  * ij = ii*self.N + jj
45293  * if(jj <len(self.decompose_window[ii][0])): # <<<<<<<<<<<<<<
45294  * self.omega_c[ij] = self.decompose_window[ii][0][jj]
45295  * self.ki_c[ij] = self.decompose_window[ii][5][jj]
45296  */
45297  goto __pyx_L80;
45298  }
45299 
45300  /* "WaveTools.py":2396
45301  * self.kDir_c[3*ij+kk] = self.decompose_window[ii][4][jj,kk]
45302  * else:
45303  * self.omega_c[ij] =1. # <<<<<<<<<<<<<<
45304  * self.ki_c[ij] = 1.
45305  * self.tanh_c[ij] = 1.
45306  */
45307  /*else*/ {
45308  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2396, __pyx_L1_error)
45309  (__pyx_v_self->omega_c[__pyx_t_16]) = 1.;
45310 
45311  /* "WaveTools.py":2397
45312  * else:
45313  * self.omega_c[ij] =1.
45314  * self.ki_c[ij] = 1. # <<<<<<<<<<<<<<
45315  * self.tanh_c[ij] = 1.
45316  * self.ai_c[ij] = 0.
45317  */
45318  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2397, __pyx_L1_error)
45319  (__pyx_v_self->ki_c[__pyx_t_16]) = 1.;
45320 
45321  /* "WaveTools.py":2398
45322  * self.omega_c[ij] =1.
45323  * self.ki_c[ij] = 1.
45324  * self.tanh_c[ij] = 1. # <<<<<<<<<<<<<<
45325  * self.ai_c[ij] = 0.
45326  * self.phi_c[ij] =0.
45327  */
45328  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2398, __pyx_L1_error)
45329  (__pyx_v_self->tanh_c[__pyx_t_16]) = 1.;
45330 
45331  /* "WaveTools.py":2399
45332  * self.ki_c[ij] = 1.
45333  * self.tanh_c[ij] = 1.
45334  * self.ai_c[ij] = 0. # <<<<<<<<<<<<<<
45335  * self.phi_c[ij] =0.
45336  * for kk in range(3):
45337  */
45338  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2399, __pyx_L1_error)
45339  (__pyx_v_self->ai_c[__pyx_t_16]) = 0.;
45340 
45341  /* "WaveTools.py":2400
45342  * self.tanh_c[ij] = 1.
45343  * self.ai_c[ij] = 0.
45344  * self.phi_c[ij] =0. # <<<<<<<<<<<<<<
45345  * for kk in range(3):
45346  * self.kDir_c[3*ij+kk] = 1.
45347  */
45348  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L1_error)
45349  (__pyx_v_self->phi_c[__pyx_t_16]) = 0.;
45350 
45351  /* "WaveTools.py":2401
45352  * self.ai_c[ij] = 0.
45353  * self.phi_c[ij] =0.
45354  * for kk in range(3): # <<<<<<<<<<<<<<
45355  * self.kDir_c[3*ij+kk] = 1.
45356  *
45357  */
45358  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2401, __pyx_L1_error)
45359  __Pyx_GOTREF(__pyx_t_6);
45360  __pyx_t_14 = NULL;
45361  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
45362  __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_6);
45363  if (likely(__pyx_t_14)) {
45364  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
45365  __Pyx_INCREF(__pyx_t_14);
45366  __Pyx_INCREF(function);
45367  __Pyx_DECREF_SET(__pyx_t_6, function);
45368  }
45369  }
45370  __pyx_t_5 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_14, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_3);
45371  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
45372  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2401, __pyx_L1_error)
45373  __Pyx_GOTREF(__pyx_t_5);
45374  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45375  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
45376  __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_16 = 0;
45377  __pyx_t_27 = NULL;
45378  } else {
45379  __pyx_t_16 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2401, __pyx_L1_error)
45380  __Pyx_GOTREF(__pyx_t_6);
45381  __pyx_t_27 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 2401, __pyx_L1_error)
45382  }
45383  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45384  for (;;) {
45385  if (likely(!__pyx_t_27)) {
45386  if (likely(PyList_CheckExact(__pyx_t_6))) {
45387  if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_6)) break;
45388  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45389  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_5); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 2401, __pyx_L1_error)
45390  #else
45391  __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2401, __pyx_L1_error)
45392  __Pyx_GOTREF(__pyx_t_5);
45393  #endif
45394  } else {
45395  if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
45396  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45397  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_5); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 2401, __pyx_L1_error)
45398  #else
45399  __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2401, __pyx_L1_error)
45400  __Pyx_GOTREF(__pyx_t_5);
45401  #endif
45402  }
45403  } else {
45404  __pyx_t_5 = __pyx_t_27(__pyx_t_6);
45405  if (unlikely(!__pyx_t_5)) {
45406  PyObject* exc_type = PyErr_Occurred();
45407  if (exc_type) {
45408  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
45409  else __PYX_ERR(0, 2401, __pyx_L1_error)
45410  }
45411  break;
45412  }
45413  __Pyx_GOTREF(__pyx_t_5);
45414  }
45415  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_5);
45416  __pyx_t_5 = 0;
45417 
45418  /* "WaveTools.py":2402
45419  * self.phi_c[ij] =0.
45420  * for kk in range(3):
45421  * self.kDir_c[3*ij+kk] = 1. # <<<<<<<<<<<<<<
45422  *
45423  * self.kDir_ = self.kDir_c
45424  */
45425  __pyx_t_5 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2402, __pyx_L1_error)
45426  __Pyx_GOTREF(__pyx_t_5);
45427  __pyx_t_14 = PyNumber_Add(__pyx_t_5, __pyx_v_kk); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2402, __pyx_L1_error)
45428  __Pyx_GOTREF(__pyx_t_14);
45429  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
45430  __pyx_t_28 = __Pyx_PyIndex_AsSsize_t(__pyx_t_14); if (unlikely((__pyx_t_28 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2402, __pyx_L1_error)
45431  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
45432  (__pyx_v_self->kDir_c[__pyx_t_28]) = 1.;
45433 
45434  /* "WaveTools.py":2401
45435  * self.ai_c[ij] = 0.
45436  * self.phi_c[ij] =0.
45437  * for kk in range(3): # <<<<<<<<<<<<<<
45438  * self.kDir_c[3*ij+kk] = 1.
45439  *
45440  */
45441  }
45442  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45443  }
45444  __pyx_L80:;
45445 
45446  /* "WaveTools.py":2385
45447  * self.T0_ = self.T0
45448  * for ii in range(self.Nwindows):
45449  * for jj in range(self.N): # <<<<<<<<<<<<<<
45450  * ij = ii*self.N + jj
45451  * if(jj <len(self.decompose_window[ii][0])):
45452  */
45453  }
45454  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
45455 
45456  /* "WaveTools.py":2384
45457  * self.whand_ = self.whand_c
45458  * self.T0_ = self.T0
45459  * for ii in range(self.Nwindows): # <<<<<<<<<<<<<<
45460  * for jj in range(self.N):
45461  * ij = ii*self.N + jj
45462  */
45463  }
45464  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
45465 
45466  /* "WaveTools.py":2404
45467  * self.kDir_c[3*ij+kk] = 1.
45468  *
45469  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
45470  * self.omega_ = self.omega_c
45471  * self.ki_ =self.ki_c
45472  */
45473  __pyx_t_19 = __pyx_v_self->kDir_c;
45474  __pyx_v_self->kDir_ = __pyx_t_19;
45475 
45476  /* "WaveTools.py":2405
45477  *
45478  * self.kDir_ = self.kDir_c
45479  * self.omega_ = self.omega_c # <<<<<<<<<<<<<<
45480  * self.ki_ =self.ki_c
45481  * self.ai_ = self.ai_c
45482  */
45483  __pyx_t_19 = __pyx_v_self->omega_c;
45484  __pyx_v_self->omega_ = __pyx_t_19;
45485 
45486  /* "WaveTools.py":2406
45487  * self.kDir_ = self.kDir_c
45488  * self.omega_ = self.omega_c
45489  * self.ki_ =self.ki_c # <<<<<<<<<<<<<<
45490  * self.ai_ = self.ai_c
45491  * self.tanh_ = self.tanh_c
45492  */
45493  __pyx_t_19 = __pyx_v_self->ki_c;
45494  __pyx_v_self->ki_ = __pyx_t_19;
45495 
45496  /* "WaveTools.py":2407
45497  * self.omega_ = self.omega_c
45498  * self.ki_ =self.ki_c
45499  * self.ai_ = self.ai_c # <<<<<<<<<<<<<<
45500  * self.tanh_ = self.tanh_c
45501  * self.phi_ = self.phi_c
45502  */
45503  __pyx_t_19 = __pyx_v_self->ai_c;
45504  __pyx_v_self->ai_ = __pyx_t_19;
45505 
45506  /* "WaveTools.py":2408
45507  * self.ki_ =self.ki_c
45508  * self.ai_ = self.ai_c
45509  * self.tanh_ = self.tanh_c # <<<<<<<<<<<<<<
45510  * self.phi_ = self.phi_c
45511  *
45512  */
45513  __pyx_t_19 = __pyx_v_self->tanh_c;
45514  __pyx_v_self->tanh_ = __pyx_t_19;
45515 
45516  /* "WaveTools.py":2409
45517  * self.ai_ = self.ai_c
45518  * self.tanh_ = self.tanh_c
45519  * self.phi_ = self.phi_c # <<<<<<<<<<<<<<
45520  *
45521  *
45522  */
45523  __pyx_t_19 = __pyx_v_self->phi_c;
45524  __pyx_v_self->phi_ = __pyx_t_19;
45525 
45526  /* "WaveTools.py":2412
45527  *
45528  *
45529  * self.Nall = self.Nf*self.Nwindows # <<<<<<<<<<<<<<
45530  *
45531  *
45532  */
45533  __pyx_v_self->Nall = (__pyx_v_self->Nf * __pyx_v_self->Nwindows);
45534  }
45535  __pyx_L14:;
45536 
45537  /* "WaveTools.py":2416
45538  *
45539  *
45540  * for ii in range(3): # <<<<<<<<<<<<<<
45541  * self.x0_c[ii] = self.x0[ii]
45542  * self.waveDir_c[ii] = self.waveDir[ii]
45543  */
45544  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_range); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2416, __pyx_L1_error)
45545  __Pyx_GOTREF(__pyx_t_11);
45546  __pyx_t_6 = NULL;
45547  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
45548  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
45549  if (likely(__pyx_t_6)) {
45550  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
45551  __Pyx_INCREF(__pyx_t_6);
45552  __Pyx_INCREF(function);
45553  __Pyx_DECREF_SET(__pyx_t_11, function);
45554  }
45555  }
45556  __pyx_t_23 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_6, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_int_3);
45557  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
45558  if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2416, __pyx_L1_error)
45559  __Pyx_GOTREF(__pyx_t_23);
45560  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
45561  if (likely(PyList_CheckExact(__pyx_t_23)) || PyTuple_CheckExact(__pyx_t_23)) {
45562  __pyx_t_11 = __pyx_t_23; __Pyx_INCREF(__pyx_t_11); __pyx_t_8 = 0;
45563  __pyx_t_13 = NULL;
45564  } else {
45565  __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_23); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2416, __pyx_L1_error)
45566  __Pyx_GOTREF(__pyx_t_11);
45567  __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2416, __pyx_L1_error)
45568  }
45569  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
45570  for (;;) {
45571  if (likely(!__pyx_t_13)) {
45572  if (likely(PyList_CheckExact(__pyx_t_11))) {
45573  if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_11)) break;
45574  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45575  __pyx_t_23 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_23); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2416, __pyx_L1_error)
45576  #else
45577  __pyx_t_23 = PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2416, __pyx_L1_error)
45578  __Pyx_GOTREF(__pyx_t_23);
45579  #endif
45580  } else {
45581  if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
45582  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
45583  __pyx_t_23 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_23); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 2416, __pyx_L1_error)
45584  #else
45585  __pyx_t_23 = PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2416, __pyx_L1_error)
45586  __Pyx_GOTREF(__pyx_t_23);
45587  #endif
45588  }
45589  } else {
45590  __pyx_t_23 = __pyx_t_13(__pyx_t_11);
45591  if (unlikely(!__pyx_t_23)) {
45592  PyObject* exc_type = PyErr_Occurred();
45593  if (exc_type) {
45594  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
45595  else __PYX_ERR(0, 2416, __pyx_L1_error)
45596  }
45597  break;
45598  }
45599  __Pyx_GOTREF(__pyx_t_23);
45600  }
45601  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_23);
45602  __pyx_t_23 = 0;
45603 
45604  /* "WaveTools.py":2417
45605  *
45606  * for ii in range(3):
45607  * self.x0_c[ii] = self.x0[ii] # <<<<<<<<<<<<<<
45608  * self.waveDir_c[ii] = self.waveDir[ii]
45609  * self.vDir_c[ii] = self.vDir[ii]
45610  */
45611  __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->x0), __pyx_v_ii); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2417, __pyx_L1_error)
45612  __Pyx_GOTREF(__pyx_t_23);
45613  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_23); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L1_error)
45614  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
45615  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L1_error)
45616  (__pyx_v_self->x0_c[__pyx_t_18]) = __pyx_t_2;
45617 
45618  /* "WaveTools.py":2418
45619  * for ii in range(3):
45620  * self.x0_c[ii] = self.x0[ii]
45621  * self.waveDir_c[ii] = self.waveDir[ii] # <<<<<<<<<<<<<<
45622  * self.vDir_c[ii] = self.vDir[ii]
45623  * self.x0_ = self.x0_c
45624  */
45625  __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->waveDir), __pyx_v_ii); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2418, __pyx_L1_error)
45626  __Pyx_GOTREF(__pyx_t_23);
45627  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_23); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L1_error)
45628  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
45629  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2418, __pyx_L1_error)
45630  (__pyx_v_self->waveDir_c[__pyx_t_18]) = __pyx_t_2;
45631 
45632  /* "WaveTools.py":2419
45633  * self.x0_c[ii] = self.x0[ii]
45634  * self.waveDir_c[ii] = self.waveDir[ii]
45635  * self.vDir_c[ii] = self.vDir[ii] # <<<<<<<<<<<<<<
45636  * self.x0_ = self.x0_c
45637  * self.waveDir_ = self.waveDir_c
45638  */
45639  __pyx_t_23 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->vDir), __pyx_v_ii); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2419, __pyx_L1_error)
45640  __Pyx_GOTREF(__pyx_t_23);
45641  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_23); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L1_error)
45642  __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
45643  __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2419, __pyx_L1_error)
45644  (__pyx_v_self->vDir_c[__pyx_t_18]) = __pyx_t_2;
45645 
45646  /* "WaveTools.py":2416
45647  *
45648  *
45649  * for ii in range(3): # <<<<<<<<<<<<<<
45650  * self.x0_c[ii] = self.x0[ii]
45651  * self.waveDir_c[ii] = self.waveDir[ii]
45652  */
45653  }
45654  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
45655 
45656  /* "WaveTools.py":2420
45657  * self.waveDir_c[ii] = self.waveDir[ii]
45658  * self.vDir_c[ii] = self.vDir[ii]
45659  * self.x0_ = self.x0_c # <<<<<<<<<<<<<<
45660  * self.waveDir_ = self.waveDir_c
45661  * self.vDir_ = self.vDir_c
45662  */
45663  __pyx_t_19 = __pyx_v_self->x0_c;
45664  memcpy(&(__pyx_v_self->x0_[0]), __pyx_t_19, sizeof(__pyx_v_self->x0_[0]) * (3 - 0));
45665 
45666  /* "WaveTools.py":2421
45667  * self.vDir_c[ii] = self.vDir[ii]
45668  * self.x0_ = self.x0_c
45669  * self.waveDir_ = self.waveDir_c # <<<<<<<<<<<<<<
45670  * self.vDir_ = self.vDir_c
45671  * if(self.rec_direct):
45672  */
45673  __pyx_t_19 = __pyx_v_self->waveDir_c;
45674  __pyx_v_self->waveDir_ = __pyx_t_19;
45675 
45676  /* "WaveTools.py":2422
45677  * self.x0_ = self.x0_c
45678  * self.waveDir_ = self.waveDir_c
45679  * self.vDir_ = self.vDir_c # <<<<<<<<<<<<<<
45680  * if(self.rec_direct):
45681  * self.eta = self.etaDirect
45682  */
45683  __pyx_t_19 = __pyx_v_self->vDir_c;
45684  __pyx_v_self->vDir_ = __pyx_t_19;
45685 
45686  /* "WaveTools.py":2423
45687  * self.waveDir_ = self.waveDir_c
45688  * self.vDir_ = self.vDir_c
45689  * if(self.rec_direct): # <<<<<<<<<<<<<<
45690  * self.eta = self.etaDirect
45691  * self.u = self.uDirect
45692  */
45693  __pyx_t_10 = (__pyx_v_self->rec_direct != 0);
45694  if (__pyx_t_10) {
45695 
45696  /* "WaveTools.py":2424
45697  * self.vDir_ = self.vDir_c
45698  * if(self.rec_direct):
45699  * self.eta = self.etaDirect # <<<<<<<<<<<<<<
45700  * self.u = self.uDirect
45701  * self._cpp_eta = self._cpp_etaDirect
45702  */
45703  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_etaDirect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2424, __pyx_L1_error)
45704  __Pyx_GOTREF(__pyx_t_11);
45705  __Pyx_GIVEREF(__pyx_t_11);
45706  __Pyx_GOTREF(__pyx_v_self->eta);
45707  __Pyx_DECREF(__pyx_v_self->eta);
45708  __pyx_v_self->eta = __pyx_t_11;
45709  __pyx_t_11 = 0;
45710 
45711  /* "WaveTools.py":2425
45712  * if(self.rec_direct):
45713  * self.eta = self.etaDirect
45714  * self.u = self.uDirect # <<<<<<<<<<<<<<
45715  * self._cpp_eta = self._cpp_etaDirect
45716  * self._cpp_u = self._cpp_uDirect
45717  */
45718  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uDirect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2425, __pyx_L1_error)
45719  __Pyx_GOTREF(__pyx_t_11);
45720  __Pyx_GIVEREF(__pyx_t_11);
45721  __Pyx_GOTREF(__pyx_v_self->u);
45722  __Pyx_DECREF(__pyx_v_self->u);
45723  __pyx_v_self->u = __pyx_t_11;
45724  __pyx_t_11 = 0;
45725 
45726  /* "WaveTools.py":2426
45727  * self.eta = self.etaDirect
45728  * self.u = self.uDirect
45729  * self._cpp_eta = self._cpp_etaDirect # <<<<<<<<<<<<<<
45730  * self._cpp_u = self._cpp_uDirect
45731  * else:
45732  */
45733  __pyx_t_29 = ((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_etaDirect;
45734  __pyx_v_self->_cpp_eta = __pyx_t_29;
45735 
45736  /* "WaveTools.py":2427
45737  * self.u = self.uDirect
45738  * self._cpp_eta = self._cpp_etaDirect
45739  * self._cpp_u = self._cpp_uDirect # <<<<<<<<<<<<<<
45740  * else:
45741  * self.eta = self.etaWindow
45742  */
45743  __pyx_t_30 = ((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_uDirect;
45744  __pyx_v_self->_cpp_u = __pyx_t_30;
45745 
45746  /* "WaveTools.py":2423
45747  * self.waveDir_ = self.waveDir_c
45748  * self.vDir_ = self.vDir_c
45749  * if(self.rec_direct): # <<<<<<<<<<<<<<
45750  * self.eta = self.etaDirect
45751  * self.u = self.uDirect
45752  */
45753  goto __pyx_L87;
45754  }
45755 
45756  /* "WaveTools.py":2429
45757  * self._cpp_u = self._cpp_uDirect
45758  * else:
45759  * self.eta = self.etaWindow # <<<<<<<<<<<<<<
45760  * self.u = self.uWindow
45761  * self._cpp_eta = self._cpp_etaWindow
45762  */
45763  /*else*/ {
45764  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_etaWindow); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2429, __pyx_L1_error)
45765  __Pyx_GOTREF(__pyx_t_11);
45766  __Pyx_GIVEREF(__pyx_t_11);
45767  __Pyx_GOTREF(__pyx_v_self->eta);
45768  __Pyx_DECREF(__pyx_v_self->eta);
45769  __pyx_v_self->eta = __pyx_t_11;
45770  __pyx_t_11 = 0;
45771 
45772  /* "WaveTools.py":2430
45773  * else:
45774  * self.eta = self.etaWindow
45775  * self.u = self.uWindow # <<<<<<<<<<<<<<
45776  * self._cpp_eta = self._cpp_etaWindow
45777  * self._cpp_u = self._cpp_uWindow
45778  */
45779  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uWindow); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2430, __pyx_L1_error)
45780  __Pyx_GOTREF(__pyx_t_11);
45781  __Pyx_GIVEREF(__pyx_t_11);
45782  __Pyx_GOTREF(__pyx_v_self->u);
45783  __Pyx_DECREF(__pyx_v_self->u);
45784  __pyx_v_self->u = __pyx_t_11;
45785  __pyx_t_11 = 0;
45786 
45787  /* "WaveTools.py":2431
45788  * self.eta = self.etaWindow
45789  * self.u = self.uWindow
45790  * self._cpp_eta = self._cpp_etaWindow # <<<<<<<<<<<<<<
45791  * self._cpp_u = self._cpp_uWindow
45792  *
45793  */
45794  __pyx_t_31 = ((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_etaWindow;
45795  __pyx_v_self->_cpp_eta = __pyx_t_31;
45796 
45797  /* "WaveTools.py":2432
45798  * self.u = self.uWindow
45799  * self._cpp_eta = self._cpp_etaWindow
45800  * self._cpp_u = self._cpp_uWindow # <<<<<<<<<<<<<<
45801  *
45802  * def windOut(self):
45803  */
45804  __pyx_t_32 = ((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_uWindow;
45805  __pyx_v_self->_cpp_u = __pyx_t_32;
45806  }
45807  __pyx_L87:;
45808 
45809  /* "WaveTools.py":2109
45810  *
45811  * """
45812  * def __init__(self, # <<<<<<<<<<<<<<
45813  * timeSeriesFile, # e.g.= "Timeseries.txt",
45814  * skiprows,
45815  */
45816 
45817  /* function exit code */
45818  __pyx_r = 0;
45819  goto __pyx_L0;
45820  __pyx_L1_error:;
45821  __Pyx_XDECREF(__pyx_t_4);
45822  __Pyx_XDECREF(__pyx_t_5);
45823  __Pyx_XDECREF(__pyx_t_6);
45824  __Pyx_XDECREF(__pyx_t_7);
45825  __Pyx_XDECREF(__pyx_t_11);
45826  __Pyx_XDECREF(__pyx_t_12);
45827  __Pyx_XDECREF(__pyx_t_14);
45828  __Pyx_XDECREF(__pyx_t_23);
45829  __Pyx_XDECREF(__pyx_t_25);
45830  __Pyx_XDECREF(__pyx_t_26);
45831  __Pyx_AddTraceback("WaveTools.TimeSeries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
45832  __pyx_r = -1;
45833  __pyx_L0:;
45834  __Pyx_XDECREF(__pyx_v_Nwaves);
45835  __Pyx_XDECREF(__pyx_v_tdata);
45836  __Pyx_XDECREF(__pyx_v_filetype);
45837  __Pyx_XDECREF(__pyx_v_fid);
45838  __Pyx_XDECREF(__pyx_v_time_temp);
45839  __Pyx_XDECREF(__pyx_v_i);
45840  __Pyx_XDECREF(__pyx_v_dt_temp);
45841  __Pyx_XDECREF(__pyx_v_Nf);
45842  __Pyx_XDECREF(__pyx_v_decomp);
45843  __Pyx_XDECREF(__pyx_v_ipeak);
45844  __Pyx_XDECREF(__pyx_v_imax);
45845  __Pyx_XDECREF(__pyx_v_imin);
45846  __Pyx_XDECREF(__pyx_v_ii);
45847  __Pyx_XDECREF(__pyx_v_ij);
45848  __Pyx_XDECREF(__pyx_v_kk);
45849  __Pyx_XDECREF(__pyx_v_windowName);
45850  __Pyx_XDECREF(__pyx_v_validWindows);
45851  __Pyx_XDECREF(__pyx_v_wind_filt);
45852  __Pyx_XDECREF(__pyx_v_jj);
45853  __Pyx_XDECREF(__pyx_v_span);
45854  __Pyx_XDECREF(__pyx_v_tfirst);
45855  __Pyx_XDECREF(__pyx_v_tlast);
45856  __Pyx_XDECREF(__pyx_v_ispan1);
45857  __Pyx_XDECREF(__pyx_v_ispan2);
45858  __Pyx_XDECREF(__pyx_v_tstart);
45859  __Pyx_XDECREF(__pyx_v_wind);
45860  __Pyx_XDECREF(__pyx_v_Nftemp);
45861  __Pyx_XDECREF(__pyx_v_ki);
45862  __Pyx_XDECREF(__pyx_v_kDir);
45863  __Pyx_XDECREF(__pyx_v_Tlag);
45864  __Pyx_RefNannyFinishContext();
45865  return __pyx_r;
45866 }
45867 
45868 /* "WaveTools.py":2434
45869  * self._cpp_u = self._cpp_uWindow
45870  *
45871  * def windOut(self): # <<<<<<<<<<<<<<
45872  * return {"TWindow":self.Twindow,"TOverlap":self.Toverlap,"Tlag":self.Tlag, "rec_direct":self.rec_direct}
45873  *
45874  */
45875 
45876 /* Python wrapper */
45877 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_3windOut(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
45878 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_3windOut = {"windOut", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_3windOut, METH_NOARGS, 0};
45879 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_3windOut(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
45880  PyObject *__pyx_r = 0;
45881  __Pyx_RefNannyDeclarations
45882  __Pyx_RefNannySetupContext("windOut (wrapper)", 0);
45883  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_2windOut(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
45884 
45885  /* function exit code */
45886  __Pyx_RefNannyFinishContext();
45887  return __pyx_r;
45888 }
45889 
45890 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_2windOut(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
45891  PyObject *__pyx_r = NULL;
45892  __Pyx_RefNannyDeclarations
45893  PyObject *__pyx_t_1 = NULL;
45894  PyObject *__pyx_t_2 = NULL;
45895  __Pyx_RefNannySetupContext("windOut", 0);
45896 
45897  /* "WaveTools.py":2435
45898  *
45899  * def windOut(self):
45900  * return {"TWindow":self.Twindow,"TOverlap":self.Toverlap,"Tlag":self.Tlag, "rec_direct":self.rec_direct} # <<<<<<<<<<<<<<
45901  *
45902  *
45903  */
45904  __Pyx_XDECREF(__pyx_r);
45905  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
45906  __Pyx_GOTREF(__pyx_t_1);
45907  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->Twindow); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error)
45908  __Pyx_GOTREF(__pyx_t_2);
45909  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_TWindow, __pyx_t_2) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
45910  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
45911  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->Toverlap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error)
45912  __Pyx_GOTREF(__pyx_t_2);
45913  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_TOverlap, __pyx_t_2) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
45914  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
45915  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->Tlag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error)
45916  __Pyx_GOTREF(__pyx_t_2);
45917  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_Tlag, __pyx_t_2) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
45918  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
45919  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->rec_direct); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2435, __pyx_L1_error)
45920  __Pyx_GOTREF(__pyx_t_2);
45921  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_rec_direct, __pyx_t_2) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
45922  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
45923  __pyx_r = __pyx_t_1;
45924  __pyx_t_1 = 0;
45925  goto __pyx_L0;
45926 
45927  /* "WaveTools.py":2434
45928  * self._cpp_u = self._cpp_uWindow
45929  *
45930  * def windOut(self): # <<<<<<<<<<<<<<
45931  * return {"TWindow":self.Twindow,"TOverlap":self.Toverlap,"Tlag":self.Tlag, "rec_direct":self.rec_direct}
45932  *
45933  */
45934 
45935  /* function exit code */
45936  __pyx_L1_error:;
45937  __Pyx_XDECREF(__pyx_t_1);
45938  __Pyx_XDECREF(__pyx_t_2);
45939  __Pyx_AddTraceback("WaveTools.TimeSeries.windOut", __pyx_clineno, __pyx_lineno, __pyx_filename);
45940  __pyx_r = NULL;
45941  __pyx_L0:;
45942  __Pyx_XGIVEREF(__pyx_r);
45943  __Pyx_RefNannyFinishContext();
45944  return __pyx_r;
45945 }
45946 
45947 /* "WaveTools.py":2438
45948  *
45949  *
45950  * def _cpp_etaDirect(self,x,t): # <<<<<<<<<<<<<<
45951  * return __cpp_etaDirect(x,self.x0_,t,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf, self.fast)
45952  * def _cpp_uDirect(self,U,x,t):
45953  */
45954 
45955 static double __pyx_f_9WaveTools_10TimeSeries__cpp_etaDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
45956  double __pyx_r;
45957  __Pyx_RefNannyDeclarations
45958  __Pyx_RefNannySetupContext("_cpp_etaDirect", 0);
45959 
45960  /* "WaveTools.py":2439
45961  *
45962  * def _cpp_etaDirect(self,x,t):
45963  * return __cpp_etaDirect(x,self.x0_,t,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf, self.fast) # <<<<<<<<<<<<<<
45964  * def _cpp_uDirect(self,U,x,t):
45965  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
45966  */
45967  __pyx_r = proteus::__cpp_etaDirect(__pyx_v_x, __pyx_v_self->x0_, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->Nf, __pyx_v_self->fast);
45968  goto __pyx_L0;
45969 
45970  /* "WaveTools.py":2438
45971  *
45972  *
45973  * def _cpp_etaDirect(self,x,t): # <<<<<<<<<<<<<<
45974  * return __cpp_etaDirect(x,self.x0_,t,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf, self.fast)
45975  * def _cpp_uDirect(self,U,x,t):
45976  */
45977 
45978  /* function exit code */
45979  __pyx_L0:;
45980  __Pyx_RefNannyFinishContext();
45981  return __pyx_r;
45982 }
45983 
45984 /* "WaveTools.py":2440
45985  * def _cpp_etaDirect(self,x,t):
45986  * return __cpp_etaDirect(x,self.x0_,t,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf, self.fast)
45987  * def _cpp_uDirect(self,U,x,t): # <<<<<<<<<<<<<<
45988  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
45989  *
45990  */
45991 
45992 static void __pyx_f_9WaveTools_10TimeSeries__cpp_uDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
45993  __Pyx_RefNannyDeclarations
45994  __Pyx_RefNannySetupContext("_cpp_uDirect", 0);
45995 
45996  /* "WaveTools.py":2441
45997  * return __cpp_etaDirect(x,self.x0_,t,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf, self.fast)
45998  * def _cpp_uDirect(self,U,x,t):
45999  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast) # <<<<<<<<<<<<<<
46000  *
46001  * def etaDirect(self, x, t):
46002  */
46003  proteus::__cpp_uDirect(__pyx_v_U, __pyx_v_x, __pyx_v_self->x0_, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->Nf, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanh_, __pyx_v_self->gAbs, __pyx_v_self->fast);
46004 
46005  /* "WaveTools.py":2440
46006  * def _cpp_etaDirect(self,x,t):
46007  * return __cpp_etaDirect(x,self.x0_,t,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf, self.fast)
46008  * def _cpp_uDirect(self,U,x,t): # <<<<<<<<<<<<<<
46009  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46010  *
46011  */
46012 
46013  /* function exit code */
46014  __Pyx_RefNannyFinishContext();
46015 }
46016 
46017 /* "WaveTools.py":2443
46018  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46019  *
46020  * def etaDirect(self, x, t): # <<<<<<<<<<<<<<
46021  *
46022  * """Calculates free surface elevation(Timeseries class-direct method
46023  */
46024 
46025 /* Python wrapper */
46026 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_5etaDirect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46027 static char __pyx_doc_9WaveTools_10TimeSeries_4etaDirect[] = "Calculates free surface elevation(Timeseries class-direct method\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
46028 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_5etaDirect = {"etaDirect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_5etaDirect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_4etaDirect};
46029 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_5etaDirect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46030  PyObject *__pyx_v_x = 0;
46031  PyObject *__pyx_v_t = 0;
46032  PyObject *__pyx_r = 0;
46033  __Pyx_RefNannyDeclarations
46034  __Pyx_RefNannySetupContext("etaDirect (wrapper)", 0);
46035  {
46036  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
46037  PyObject* values[2] = {0,0};
46038  if (unlikely(__pyx_kwds)) {
46039  Py_ssize_t kw_args;
46040  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
46041  switch (pos_args) {
46042  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46043  CYTHON_FALLTHROUGH;
46044  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46045  CYTHON_FALLTHROUGH;
46046  case 0: break;
46047  default: goto __pyx_L5_argtuple_error;
46048  }
46049  kw_args = PyDict_Size(__pyx_kwds);
46050  switch (pos_args) {
46051  case 0:
46052  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
46053  else goto __pyx_L5_argtuple_error;
46054  CYTHON_FALLTHROUGH;
46055  case 1:
46056  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
46057  else {
46058  __Pyx_RaiseArgtupleInvalid("etaDirect", 1, 2, 2, 1); __PYX_ERR(0, 2443, __pyx_L3_error)
46059  }
46060  }
46061  if (unlikely(kw_args > 0)) {
46062  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "etaDirect") < 0)) __PYX_ERR(0, 2443, __pyx_L3_error)
46063  }
46064  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
46065  goto __pyx_L5_argtuple_error;
46066  } else {
46067  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46068  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46069  }
46070  __pyx_v_x = values[0];
46071  __pyx_v_t = values[1];
46072  }
46073  goto __pyx_L4_argument_unpacking_done;
46074  __pyx_L5_argtuple_error:;
46075  __Pyx_RaiseArgtupleInvalid("etaDirect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2443, __pyx_L3_error)
46076  __pyx_L3_error:;
46077  __Pyx_AddTraceback("WaveTools.TimeSeries.etaDirect", __pyx_clineno, __pyx_lineno, __pyx_filename);
46078  __Pyx_RefNannyFinishContext();
46079  return NULL;
46080  __pyx_L4_argument_unpacking_done:;
46081  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_4etaDirect(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
46082 
46083  /* function exit code */
46084  __Pyx_RefNannyFinishContext();
46085  return __pyx_r;
46086 }
46087 
46088 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_4etaDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
46089  double __pyx_v_xx[3];
46090  PyObject *__pyx_r = NULL;
46091  __Pyx_RefNannyDeclarations
46092  PyObject *__pyx_t_1 = NULL;
46093  double __pyx_t_2;
46094  __Pyx_RefNannySetupContext("etaDirect", 0);
46095 
46096  /* "WaveTools.py":2460
46097  * """
46098  * cython.declare(xx=cython.double[3])
46099  * xx[0] = x[0] # <<<<<<<<<<<<<<
46100  * xx[1] = x[1]
46101  * xx[2] = x[2]
46102  */
46103  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2460, __pyx_L1_error)
46104  __Pyx_GOTREF(__pyx_t_1);
46105  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2460, __pyx_L1_error)
46106  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46107  (__pyx_v_xx[0]) = __pyx_t_2;
46108 
46109  /* "WaveTools.py":2461
46110  * cython.declare(xx=cython.double[3])
46111  * xx[0] = x[0]
46112  * xx[1] = x[1] # <<<<<<<<<<<<<<
46113  * xx[2] = x[2]
46114  * return self._cpp_etaDirect(xx,t)
46115  */
46116  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2461, __pyx_L1_error)
46117  __Pyx_GOTREF(__pyx_t_1);
46118  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2461, __pyx_L1_error)
46119  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46120  (__pyx_v_xx[1]) = __pyx_t_2;
46121 
46122  /* "WaveTools.py":2462
46123  * xx[0] = x[0]
46124  * xx[1] = x[1]
46125  * xx[2] = x[2] # <<<<<<<<<<<<<<
46126  * return self._cpp_etaDirect(xx,t)
46127  *
46128  */
46129  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2462, __pyx_L1_error)
46130  __Pyx_GOTREF(__pyx_t_1);
46131  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2462, __pyx_L1_error)
46132  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46133  (__pyx_v_xx[2]) = __pyx_t_2;
46134 
46135  /* "WaveTools.py":2463
46136  * xx[1] = x[1]
46137  * xx[2] = x[2]
46138  * return self._cpp_etaDirect(xx,t) # <<<<<<<<<<<<<<
46139  *
46140  * def uDirect(self, x, t):
46141  */
46142  __Pyx_XDECREF(__pyx_r);
46143  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2463, __pyx_L1_error)
46144  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_etaDirect(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2463, __pyx_L1_error)
46145  __Pyx_GOTREF(__pyx_t_1);
46146  __pyx_r = __pyx_t_1;
46147  __pyx_t_1 = 0;
46148  goto __pyx_L0;
46149 
46150  /* "WaveTools.py":2443
46151  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46152  *
46153  * def etaDirect(self, x, t): # <<<<<<<<<<<<<<
46154  *
46155  * """Calculates free surface elevation(Timeseries class-direct method
46156  */
46157 
46158  /* function exit code */
46159  __pyx_L1_error:;
46160  __Pyx_XDECREF(__pyx_t_1);
46161  __Pyx_AddTraceback("WaveTools.TimeSeries.etaDirect", __pyx_clineno, __pyx_lineno, __pyx_filename);
46162  __pyx_r = NULL;
46163  __pyx_L0:;
46164  __Pyx_XGIVEREF(__pyx_r);
46165  __Pyx_RefNannyFinishContext();
46166  return __pyx_r;
46167 }
46168 
46169 /* "WaveTools.py":2465
46170  * return self._cpp_etaDirect(xx,t)
46171  *
46172  * def uDirect(self, x, t): # <<<<<<<<<<<<<<
46173  * """Calculates wave velocity vector (Timeseries class-direct method)
46174  * Parameters
46175  */
46176 
46177 /* Python wrapper */
46178 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_7uDirect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46179 static char __pyx_doc_9WaveTools_10TimeSeries_6uDirect[] = "Calculates wave velocity vector (Timeseries class-direct method)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
46180 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_7uDirect = {"uDirect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_7uDirect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_6uDirect};
46181 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_7uDirect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46182  PyObject *__pyx_v_x = 0;
46183  PyObject *__pyx_v_t = 0;
46184  PyObject *__pyx_r = 0;
46185  __Pyx_RefNannyDeclarations
46186  __Pyx_RefNannySetupContext("uDirect (wrapper)", 0);
46187  {
46188  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
46189  PyObject* values[2] = {0,0};
46190  if (unlikely(__pyx_kwds)) {
46191  Py_ssize_t kw_args;
46192  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
46193  switch (pos_args) {
46194  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46195  CYTHON_FALLTHROUGH;
46196  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46197  CYTHON_FALLTHROUGH;
46198  case 0: break;
46199  default: goto __pyx_L5_argtuple_error;
46200  }
46201  kw_args = PyDict_Size(__pyx_kwds);
46202  switch (pos_args) {
46203  case 0:
46204  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
46205  else goto __pyx_L5_argtuple_error;
46206  CYTHON_FALLTHROUGH;
46207  case 1:
46208  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
46209  else {
46210  __Pyx_RaiseArgtupleInvalid("uDirect", 1, 2, 2, 1); __PYX_ERR(0, 2465, __pyx_L3_error)
46211  }
46212  }
46213  if (unlikely(kw_args > 0)) {
46214  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uDirect") < 0)) __PYX_ERR(0, 2465, __pyx_L3_error)
46215  }
46216  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
46217  goto __pyx_L5_argtuple_error;
46218  } else {
46219  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46220  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46221  }
46222  __pyx_v_x = values[0];
46223  __pyx_v_t = values[1];
46224  }
46225  goto __pyx_L4_argument_unpacking_done;
46226  __pyx_L5_argtuple_error:;
46227  __Pyx_RaiseArgtupleInvalid("uDirect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2465, __pyx_L3_error)
46228  __pyx_L3_error:;
46229  __Pyx_AddTraceback("WaveTools.TimeSeries.uDirect", __pyx_clineno, __pyx_lineno, __pyx_filename);
46230  __Pyx_RefNannyFinishContext();
46231  return NULL;
46232  __pyx_L4_argument_unpacking_done:;
46233  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_6uDirect(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
46234 
46235  /* function exit code */
46236  __Pyx_RefNannyFinishContext();
46237  return __pyx_r;
46238 }
46239 
46240 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_6uDirect(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
46241  double __pyx_v_xx[3];
46242  double __pyx_v_cppU[3];
46243  PyObject *__pyx_v_ii = NULL;
46244  PyObject *__pyx_v_U = NULL;
46245  PyObject *__pyx_r = NULL;
46246  __Pyx_RefNannyDeclarations
46247  PyObject *__pyx_t_1 = NULL;
46248  PyObject *__pyx_t_2 = NULL;
46249  PyObject *__pyx_t_3 = NULL;
46250  Py_ssize_t __pyx_t_4;
46251  PyObject *(*__pyx_t_5)(PyObject *);
46252  double __pyx_t_6;
46253  Py_ssize_t __pyx_t_7;
46254  __Pyx_RefNannySetupContext("uDirect", 0);
46255 
46256  /* "WaveTools.py":2483
46257  * cython.declare(xx=cython.double[3])
46258  * cython.declare(cppU=cython.double[3])
46259  * for ii in range(3): # <<<<<<<<<<<<<<
46260  * xx[ii] = x[ii]
46261  * cppU[ii] = 0.
46262  */
46263  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2483, __pyx_L1_error)
46264  __Pyx_GOTREF(__pyx_t_2);
46265  __pyx_t_3 = NULL;
46266  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
46267  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
46268  if (likely(__pyx_t_3)) {
46269  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
46270  __Pyx_INCREF(__pyx_t_3);
46271  __Pyx_INCREF(function);
46272  __Pyx_DECREF_SET(__pyx_t_2, function);
46273  }
46274  }
46275  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
46276  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
46277  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2483, __pyx_L1_error)
46278  __Pyx_GOTREF(__pyx_t_1);
46279  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46280  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
46281  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
46282  __pyx_t_5 = NULL;
46283  } else {
46284  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2483, __pyx_L1_error)
46285  __Pyx_GOTREF(__pyx_t_2);
46286  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2483, __pyx_L1_error)
46287  }
46288  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46289  for (;;) {
46290  if (likely(!__pyx_t_5)) {
46291  if (likely(PyList_CheckExact(__pyx_t_2))) {
46292  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
46293  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46294  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2483, __pyx_L1_error)
46295  #else
46296  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2483, __pyx_L1_error)
46297  __Pyx_GOTREF(__pyx_t_1);
46298  #endif
46299  } else {
46300  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
46301  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46302  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2483, __pyx_L1_error)
46303  #else
46304  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2483, __pyx_L1_error)
46305  __Pyx_GOTREF(__pyx_t_1);
46306  #endif
46307  }
46308  } else {
46309  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
46310  if (unlikely(!__pyx_t_1)) {
46311  PyObject* exc_type = PyErr_Occurred();
46312  if (exc_type) {
46313  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
46314  else __PYX_ERR(0, 2483, __pyx_L1_error)
46315  }
46316  break;
46317  }
46318  __Pyx_GOTREF(__pyx_t_1);
46319  }
46320  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
46321  __pyx_t_1 = 0;
46322 
46323  /* "WaveTools.py":2484
46324  * cython.declare(cppU=cython.double[3])
46325  * for ii in range(3):
46326  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
46327  * cppU[ii] = 0.
46328  * U = np.zeros(3,)
46329  */
46330  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2484, __pyx_L1_error)
46331  __Pyx_GOTREF(__pyx_t_1);
46332  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2484, __pyx_L1_error)
46333  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46334  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2484, __pyx_L1_error)
46335  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
46336 
46337  /* "WaveTools.py":2485
46338  * for ii in range(3):
46339  * xx[ii] = x[ii]
46340  * cppU[ii] = 0. # <<<<<<<<<<<<<<
46341  * U = np.zeros(3,)
46342  * self._cpp_uDirect(cppU,xx,t)
46343  */
46344  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2485, __pyx_L1_error)
46345  (__pyx_v_cppU[__pyx_t_7]) = 0.;
46346 
46347  /* "WaveTools.py":2483
46348  * cython.declare(xx=cython.double[3])
46349  * cython.declare(cppU=cython.double[3])
46350  * for ii in range(3): # <<<<<<<<<<<<<<
46351  * xx[ii] = x[ii]
46352  * cppU[ii] = 0.
46353  */
46354  }
46355  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46356 
46357  /* "WaveTools.py":2486
46358  * xx[ii] = x[ii]
46359  * cppU[ii] = 0.
46360  * U = np.zeros(3,) # <<<<<<<<<<<<<<
46361  * self._cpp_uDirect(cppU,xx,t)
46362  * U[0] = cppU[0]
46363  */
46364  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error)
46365  __Pyx_GOTREF(__pyx_t_1);
46366  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2486, __pyx_L1_error)
46367  __Pyx_GOTREF(__pyx_t_3);
46368  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46369  __pyx_t_1 = NULL;
46370  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
46371  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
46372  if (likely(__pyx_t_1)) {
46373  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
46374  __Pyx_INCREF(__pyx_t_1);
46375  __Pyx_INCREF(function);
46376  __Pyx_DECREF_SET(__pyx_t_3, function);
46377  }
46378  }
46379  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
46380  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
46381  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2486, __pyx_L1_error)
46382  __Pyx_GOTREF(__pyx_t_2);
46383  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46384  __pyx_v_U = __pyx_t_2;
46385  __pyx_t_2 = 0;
46386 
46387  /* "WaveTools.py":2487
46388  * cppU[ii] = 0.
46389  * U = np.zeros(3,)
46390  * self._cpp_uDirect(cppU,xx,t) # <<<<<<<<<<<<<<
46391  * U[0] = cppU[0]
46392  * U[1] = cppU[1]
46393  */
46394  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2487, __pyx_L1_error)
46395  ((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_uDirect(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
46396 
46397  /* "WaveTools.py":2488
46398  * U = np.zeros(3,)
46399  * self._cpp_uDirect(cppU,xx,t)
46400  * U[0] = cppU[0] # <<<<<<<<<<<<<<
46401  * U[1] = cppU[1]
46402  * U[2] = cppU[2]
46403  */
46404  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2488, __pyx_L1_error)
46405  __Pyx_GOTREF(__pyx_t_2);
46406  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2488, __pyx_L1_error)
46407  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46408 
46409  /* "WaveTools.py":2489
46410  * self._cpp_uDirect(cppU,xx,t)
46411  * U[0] = cppU[0]
46412  * U[1] = cppU[1] # <<<<<<<<<<<<<<
46413  * U[2] = cppU[2]
46414  *
46415  */
46416  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2489, __pyx_L1_error)
46417  __Pyx_GOTREF(__pyx_t_2);
46418  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2489, __pyx_L1_error)
46419  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46420 
46421  /* "WaveTools.py":2490
46422  * U[0] = cppU[0]
46423  * U[1] = cppU[1]
46424  * U[2] = cppU[2] # <<<<<<<<<<<<<<
46425  *
46426  * return U
46427  */
46428  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2490, __pyx_L1_error)
46429  __Pyx_GOTREF(__pyx_t_2);
46430  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2490, __pyx_L1_error)
46431  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46432 
46433  /* "WaveTools.py":2492
46434  * U[2] = cppU[2]
46435  *
46436  * return U # <<<<<<<<<<<<<<
46437  *
46438  * def findWindow(self,t):
46439  */
46440  __Pyx_XDECREF(__pyx_r);
46441  __Pyx_INCREF(__pyx_v_U);
46442  __pyx_r = __pyx_v_U;
46443  goto __pyx_L0;
46444 
46445  /* "WaveTools.py":2465
46446  * return self._cpp_etaDirect(xx,t)
46447  *
46448  * def uDirect(self, x, t): # <<<<<<<<<<<<<<
46449  * """Calculates wave velocity vector (Timeseries class-direct method)
46450  * Parameters
46451  */
46452 
46453  /* function exit code */
46454  __pyx_L1_error:;
46455  __Pyx_XDECREF(__pyx_t_1);
46456  __Pyx_XDECREF(__pyx_t_2);
46457  __Pyx_XDECREF(__pyx_t_3);
46458  __Pyx_AddTraceback("WaveTools.TimeSeries.uDirect", __pyx_clineno, __pyx_lineno, __pyx_filename);
46459  __pyx_r = NULL;
46460  __pyx_L0:;
46461  __Pyx_XDECREF(__pyx_v_ii);
46462  __Pyx_XDECREF(__pyx_v_U);
46463  __Pyx_XGIVEREF(__pyx_r);
46464  __Pyx_RefNannyFinishContext();
46465  return __pyx_r;
46466 }
46467 
46468 /* "WaveTools.py":2494
46469  * return U
46470  *
46471  * def findWindow(self,t): # <<<<<<<<<<<<<<
46472  * """Returns the current spectral window in TimeSeries class."
46473  *
46474  */
46475 
46476 /* Python wrapper */
46477 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_9findWindow(PyObject *__pyx_v_self, PyObject *__pyx_v_t); /*proto*/
46478 static char __pyx_doc_9WaveTools_10TimeSeries_8findWindow[] = "Returns the current spectral window in TimeSeries class.\"\n\n Parameters\n ----------\n\n t : float\n Time variable\n\n Returns\n -------\n int\n Index of window as an integer\n\n ";
46479 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_9findWindow = {"findWindow", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_9findWindow, METH_O, __pyx_doc_9WaveTools_10TimeSeries_8findWindow};
46480 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_9findWindow(PyObject *__pyx_v_self, PyObject *__pyx_v_t) {
46481  PyObject *__pyx_r = 0;
46482  __Pyx_RefNannyDeclarations
46483  __Pyx_RefNannySetupContext("findWindow (wrapper)", 0);
46484  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_8findWindow(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), ((PyObject *)__pyx_v_t));
46485 
46486  /* function exit code */
46487  __Pyx_RefNannyFinishContext();
46488  return __pyx_r;
46489 }
46490 
46491 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_8findWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_t) {
46492  PyObject *__pyx_r = NULL;
46493  __Pyx_RefNannyDeclarations
46494  double __pyx_t_1;
46495  PyObject *__pyx_t_2 = NULL;
46496  __Pyx_RefNannySetupContext("findWindow", 0);
46497 
46498  /* "WaveTools.py":2509
46499  *
46500  * """
46501  * return __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw # <<<<<<<<<<<<<<
46502  *
46503  * def _cpp_etaWindow(self,x,t):
46504  */
46505  __Pyx_XDECREF(__pyx_r);
46506  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L1_error)
46507  __pyx_t_2 = __Pyx_PyInt_From_int(proteus::__cpp_findWindow(__pyx_t_1, __pyx_v_self->handover, __pyx_v_self->t0, __pyx_v_self->Twindow, __pyx_v_self->Nwindows, __pyx_v_self->whand_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2509, __pyx_L1_error)
46508  __Pyx_GOTREF(__pyx_t_2);
46509  __pyx_r = __pyx_t_2;
46510  __pyx_t_2 = 0;
46511  goto __pyx_L0;
46512 
46513  /* "WaveTools.py":2494
46514  * return U
46515  *
46516  * def findWindow(self,t): # <<<<<<<<<<<<<<
46517  * """Returns the current spectral window in TimeSeries class."
46518  *
46519  */
46520 
46521  /* function exit code */
46522  __pyx_L1_error:;
46523  __Pyx_XDECREF(__pyx_t_2);
46524  __Pyx_AddTraceback("WaveTools.TimeSeries.findWindow", __pyx_clineno, __pyx_lineno, __pyx_filename);
46525  __pyx_r = NULL;
46526  __pyx_L0:;
46527  __Pyx_XGIVEREF(__pyx_r);
46528  __Pyx_RefNannyFinishContext();
46529  return __pyx_r;
46530 }
46531 
46532 /* "WaveTools.py":2511
46533  * return __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46534  *
46535  * def _cpp_etaWindow(self,x,t): # <<<<<<<<<<<<<<
46536  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46537  *
46538  */
46539 
46540 static double __pyx_f_9WaveTools_10TimeSeries__cpp_etaWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
46541  int __pyx_v_Nw;
46542  double __pyx_r;
46543  __Pyx_RefNannyDeclarations
46544  __Pyx_RefNannySetupContext("_cpp_etaWindow", 0);
46545 
46546  /* "WaveTools.py":2512
46547  *
46548  * def _cpp_etaWindow(self,x,t):
46549  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw # <<<<<<<<<<<<<<
46550  *
46551  * return __cpp_etaWindow(x,self.x0_,t,self.T0_,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf,Nw, self.fast)
46552  */
46553  __pyx_v_Nw = proteus::__cpp_findWindow(__pyx_v_t, __pyx_v_self->handover, __pyx_v_self->t0, __pyx_v_self->Twindow, __pyx_v_self->Nwindows, __pyx_v_self->whand_);
46554 
46555  /* "WaveTools.py":2514
46556  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46557  *
46558  * return __cpp_etaWindow(x,self.x0_,t,self.T0_,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf,Nw, self.fast) # <<<<<<<<<<<<<<
46559  * def _cpp_uWindow(self,U, x,t):
46560  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46561  */
46562  __pyx_r = proteus::__cpp_etaWindow(__pyx_v_x, __pyx_v_self->x0_, __pyx_v_t, __pyx_v_self->T0_, __pyx_v_self->kDir_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->Nf, __pyx_v_Nw, __pyx_v_self->fast);
46563  goto __pyx_L0;
46564 
46565  /* "WaveTools.py":2511
46566  * return __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46567  *
46568  * def _cpp_etaWindow(self,x,t): # <<<<<<<<<<<<<<
46569  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46570  *
46571  */
46572 
46573  /* function exit code */
46574  __pyx_L0:;
46575  __Pyx_RefNannyFinishContext();
46576  return __pyx_r;
46577 }
46578 
46579 /* "WaveTools.py":2515
46580  *
46581  * return __cpp_etaWindow(x,self.x0_,t,self.T0_,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf,Nw, self.fast)
46582  * def _cpp_uWindow(self,U, x,t): # <<<<<<<<<<<<<<
46583  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46584  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46585  */
46586 
46587 static void __pyx_f_9WaveTools_10TimeSeries__cpp_uWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, double *__pyx_v_U, double *__pyx_v_x, double __pyx_v_t) {
46588  int __pyx_v_Nw;
46589  __Pyx_RefNannyDeclarations
46590  __Pyx_RefNannySetupContext("_cpp_uWindow", 0);
46591 
46592  /* "WaveTools.py":2516
46593  * return __cpp_etaWindow(x,self.x0_,t,self.T0_,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf,Nw, self.fast)
46594  * def _cpp_uWindow(self,U, x,t):
46595  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw # <<<<<<<<<<<<<<
46596  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46597  *
46598  */
46599  __pyx_v_Nw = proteus::__cpp_findWindow(__pyx_v_t, __pyx_v_self->handover, __pyx_v_self->t0, __pyx_v_self->Twindow, __pyx_v_self->Nwindows, __pyx_v_self->whand_);
46600 
46601  /* "WaveTools.py":2517
46602  * def _cpp_uWindow(self,U, x,t):
46603  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46604  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast) # <<<<<<<<<<<<<<
46605  *
46606  * def etaWindow(self, x, t):
46607  */
46608  proteus::__cpp_uWindow(__pyx_v_U, __pyx_v_x, __pyx_v_self->x0_, __pyx_v_t, __pyx_v_self->T0_, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->mwl, __pyx_v_self->depth, __pyx_v_self->Nf, __pyx_v_Nw, __pyx_v_self->waveDir_, __pyx_v_self->vDir_, __pyx_v_self->tanh_, __pyx_v_self->gAbs, __pyx_v_self->fast);
46609 
46610  /* "WaveTools.py":2515
46611  *
46612  * return __cpp_etaWindow(x,self.x0_,t,self.T0_,self.kDir_,self.omega_,self.phi_,self.ai_,self.Nf,Nw, self.fast)
46613  * def _cpp_uWindow(self,U, x,t): # <<<<<<<<<<<<<<
46614  * Nw = __cpp_findWindow(t,self.handover, self.t0,self.Twindow,self.Nwindows, self.whand_) #Nw
46615  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46616  */
46617 
46618  /* function exit code */
46619  __Pyx_RefNannyFinishContext();
46620 }
46621 
46622 /* "WaveTools.py":2519
46623  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46624  *
46625  * def etaWindow(self, x, t): # <<<<<<<<<<<<<<
46626  * """Calculates free surface elevation(Timeseries class-window method
46627  * Parameters
46628  */
46629 
46630 /* Python wrapper */
46631 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_11etaWindow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46632 static char __pyx_doc_9WaveTools_10TimeSeries_10etaWindow[] = "Calculates free surface elevation(Timeseries class-window method\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
46633 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_11etaWindow = {"etaWindow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_11etaWindow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_10etaWindow};
46634 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_11etaWindow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46635  PyObject *__pyx_v_x = 0;
46636  PyObject *__pyx_v_t = 0;
46637  PyObject *__pyx_r = 0;
46638  __Pyx_RefNannyDeclarations
46639  __Pyx_RefNannySetupContext("etaWindow (wrapper)", 0);
46640  {
46641  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
46642  PyObject* values[2] = {0,0};
46643  if (unlikely(__pyx_kwds)) {
46644  Py_ssize_t kw_args;
46645  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
46646  switch (pos_args) {
46647  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46648  CYTHON_FALLTHROUGH;
46649  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46650  CYTHON_FALLTHROUGH;
46651  case 0: break;
46652  default: goto __pyx_L5_argtuple_error;
46653  }
46654  kw_args = PyDict_Size(__pyx_kwds);
46655  switch (pos_args) {
46656  case 0:
46657  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
46658  else goto __pyx_L5_argtuple_error;
46659  CYTHON_FALLTHROUGH;
46660  case 1:
46661  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
46662  else {
46663  __Pyx_RaiseArgtupleInvalid("etaWindow", 1, 2, 2, 1); __PYX_ERR(0, 2519, __pyx_L3_error)
46664  }
46665  }
46666  if (unlikely(kw_args > 0)) {
46667  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "etaWindow") < 0)) __PYX_ERR(0, 2519, __pyx_L3_error)
46668  }
46669  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
46670  goto __pyx_L5_argtuple_error;
46671  } else {
46672  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46673  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46674  }
46675  __pyx_v_x = values[0];
46676  __pyx_v_t = values[1];
46677  }
46678  goto __pyx_L4_argument_unpacking_done;
46679  __pyx_L5_argtuple_error:;
46680  __Pyx_RaiseArgtupleInvalid("etaWindow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2519, __pyx_L3_error)
46681  __pyx_L3_error:;
46682  __Pyx_AddTraceback("WaveTools.TimeSeries.etaWindow", __pyx_clineno, __pyx_lineno, __pyx_filename);
46683  __Pyx_RefNannyFinishContext();
46684  return NULL;
46685  __pyx_L4_argument_unpacking_done:;
46686  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_10etaWindow(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
46687 
46688  /* function exit code */
46689  __Pyx_RefNannyFinishContext();
46690  return __pyx_r;
46691 }
46692 
46693 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_10etaWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
46694  double __pyx_v_xx[3];
46695  PyObject *__pyx_r = NULL;
46696  __Pyx_RefNannyDeclarations
46697  PyObject *__pyx_t_1 = NULL;
46698  double __pyx_t_2;
46699  __Pyx_RefNannySetupContext("etaWindow", 0);
46700 
46701  /* "WaveTools.py":2535
46702  * """
46703  * cython.declare(xx=cython.double[3])
46704  * xx[0] = x[0] # <<<<<<<<<<<<<<
46705  * xx[1] = x[1]
46706  * xx[2] = x[2]
46707  */
46708  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L1_error)
46709  __Pyx_GOTREF(__pyx_t_1);
46710  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2535, __pyx_L1_error)
46711  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46712  (__pyx_v_xx[0]) = __pyx_t_2;
46713 
46714  /* "WaveTools.py":2536
46715  * cython.declare(xx=cython.double[3])
46716  * xx[0] = x[0]
46717  * xx[1] = x[1] # <<<<<<<<<<<<<<
46718  * xx[2] = x[2]
46719  * return self._cpp_etaWindow(xx,t)
46720  */
46721  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2536, __pyx_L1_error)
46722  __Pyx_GOTREF(__pyx_t_1);
46723  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2536, __pyx_L1_error)
46724  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46725  (__pyx_v_xx[1]) = __pyx_t_2;
46726 
46727  /* "WaveTools.py":2537
46728  * xx[0] = x[0]
46729  * xx[1] = x[1]
46730  * xx[2] = x[2] # <<<<<<<<<<<<<<
46731  * return self._cpp_etaWindow(xx,t)
46732  *
46733  */
46734  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2537, __pyx_L1_error)
46735  __Pyx_GOTREF(__pyx_t_1);
46736  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)
46737  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46738  (__pyx_v_xx[2]) = __pyx_t_2;
46739 
46740  /* "WaveTools.py":2538
46741  * xx[1] = x[1]
46742  * xx[2] = x[2]
46743  * return self._cpp_etaWindow(xx,t) # <<<<<<<<<<<<<<
46744  *
46745  *
46746  */
46747  __Pyx_XDECREF(__pyx_r);
46748  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2538, __pyx_L1_error)
46749  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_etaWindow(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2538, __pyx_L1_error)
46750  __Pyx_GOTREF(__pyx_t_1);
46751  __pyx_r = __pyx_t_1;
46752  __pyx_t_1 = 0;
46753  goto __pyx_L0;
46754 
46755  /* "WaveTools.py":2519
46756  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
46757  *
46758  * def etaWindow(self, x, t): # <<<<<<<<<<<<<<
46759  * """Calculates free surface elevation(Timeseries class-window method
46760  * Parameters
46761  */
46762 
46763  /* function exit code */
46764  __pyx_L1_error:;
46765  __Pyx_XDECREF(__pyx_t_1);
46766  __Pyx_AddTraceback("WaveTools.TimeSeries.etaWindow", __pyx_clineno, __pyx_lineno, __pyx_filename);
46767  __pyx_r = NULL;
46768  __pyx_L0:;
46769  __Pyx_XGIVEREF(__pyx_r);
46770  __Pyx_RefNannyFinishContext();
46771  return __pyx_r;
46772 }
46773 
46774 /* "WaveTools.py":2541
46775  *
46776  *
46777  * def uWindow(self, x, t): # <<<<<<<<<<<<<<
46778  * """Calculates wave velocity vector (Timeseries class-window method)
46779  * Parameters
46780  */
46781 
46782 /* Python wrapper */
46783 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_13uWindow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46784 static char __pyx_doc_9WaveTools_10TimeSeries_12uWindow[] = "Calculates wave velocity vector (Timeseries class-window method)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
46785 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_13uWindow = {"uWindow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_13uWindow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_12uWindow};
46786 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_13uWindow(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46787  PyObject *__pyx_v_x = 0;
46788  PyObject *__pyx_v_t = 0;
46789  PyObject *__pyx_r = 0;
46790  __Pyx_RefNannyDeclarations
46791  __Pyx_RefNannySetupContext("uWindow (wrapper)", 0);
46792  {
46793  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
46794  PyObject* values[2] = {0,0};
46795  if (unlikely(__pyx_kwds)) {
46796  Py_ssize_t kw_args;
46797  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
46798  switch (pos_args) {
46799  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46800  CYTHON_FALLTHROUGH;
46801  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46802  CYTHON_FALLTHROUGH;
46803  case 0: break;
46804  default: goto __pyx_L5_argtuple_error;
46805  }
46806  kw_args = PyDict_Size(__pyx_kwds);
46807  switch (pos_args) {
46808  case 0:
46809  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
46810  else goto __pyx_L5_argtuple_error;
46811  CYTHON_FALLTHROUGH;
46812  case 1:
46813  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
46814  else {
46815  __Pyx_RaiseArgtupleInvalid("uWindow", 1, 2, 2, 1); __PYX_ERR(0, 2541, __pyx_L3_error)
46816  }
46817  }
46818  if (unlikely(kw_args > 0)) {
46819  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uWindow") < 0)) __PYX_ERR(0, 2541, __pyx_L3_error)
46820  }
46821  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
46822  goto __pyx_L5_argtuple_error;
46823  } else {
46824  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46825  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46826  }
46827  __pyx_v_x = values[0];
46828  __pyx_v_t = values[1];
46829  }
46830  goto __pyx_L4_argument_unpacking_done;
46831  __pyx_L5_argtuple_error:;
46832  __Pyx_RaiseArgtupleInvalid("uWindow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2541, __pyx_L3_error)
46833  __pyx_L3_error:;
46834  __Pyx_AddTraceback("WaveTools.TimeSeries.uWindow", __pyx_clineno, __pyx_lineno, __pyx_filename);
46835  __Pyx_RefNannyFinishContext();
46836  return NULL;
46837  __pyx_L4_argument_unpacking_done:;
46838  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_12uWindow(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
46839 
46840  /* function exit code */
46841  __Pyx_RefNannyFinishContext();
46842  return __pyx_r;
46843 }
46844 
46845 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_12uWindow(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
46846  double __pyx_v_xx[3];
46847  double __pyx_v_cppU[3];
46848  PyObject *__pyx_v_ii = NULL;
46849  PyObject *__pyx_v_U = NULL;
46850  PyObject *__pyx_r = NULL;
46851  __Pyx_RefNannyDeclarations
46852  PyObject *__pyx_t_1 = NULL;
46853  PyObject *__pyx_t_2 = NULL;
46854  PyObject *__pyx_t_3 = NULL;
46855  Py_ssize_t __pyx_t_4;
46856  PyObject *(*__pyx_t_5)(PyObject *);
46857  double __pyx_t_6;
46858  Py_ssize_t __pyx_t_7;
46859  __Pyx_RefNannySetupContext("uWindow", 0);
46860 
46861  /* "WaveTools.py":2558
46862  * cython.declare(xx=cython.double[3])
46863  * cython.declare(cppU=cython.double[3])
46864  * for ii in range(3): # <<<<<<<<<<<<<<
46865  * xx[ii] = x[ii]
46866  * cppU[ii] = 0.
46867  */
46868  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2558, __pyx_L1_error)
46869  __Pyx_GOTREF(__pyx_t_2);
46870  __pyx_t_3 = NULL;
46871  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
46872  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
46873  if (likely(__pyx_t_3)) {
46874  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
46875  __Pyx_INCREF(__pyx_t_3);
46876  __Pyx_INCREF(function);
46877  __Pyx_DECREF_SET(__pyx_t_2, function);
46878  }
46879  }
46880  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_3);
46881  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
46882  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2558, __pyx_L1_error)
46883  __Pyx_GOTREF(__pyx_t_1);
46884  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46885  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
46886  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
46887  __pyx_t_5 = NULL;
46888  } else {
46889  __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2558, __pyx_L1_error)
46890  __Pyx_GOTREF(__pyx_t_2);
46891  __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2558, __pyx_L1_error)
46892  }
46893  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46894  for (;;) {
46895  if (likely(!__pyx_t_5)) {
46896  if (likely(PyList_CheckExact(__pyx_t_2))) {
46897  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
46898  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46899  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2558, __pyx_L1_error)
46900  #else
46901  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2558, __pyx_L1_error)
46902  __Pyx_GOTREF(__pyx_t_1);
46903  #endif
46904  } else {
46905  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
46906  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
46907  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2558, __pyx_L1_error)
46908  #else
46909  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2558, __pyx_L1_error)
46910  __Pyx_GOTREF(__pyx_t_1);
46911  #endif
46912  }
46913  } else {
46914  __pyx_t_1 = __pyx_t_5(__pyx_t_2);
46915  if (unlikely(!__pyx_t_1)) {
46916  PyObject* exc_type = PyErr_Occurred();
46917  if (exc_type) {
46918  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
46919  else __PYX_ERR(0, 2558, __pyx_L1_error)
46920  }
46921  break;
46922  }
46923  __Pyx_GOTREF(__pyx_t_1);
46924  }
46925  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_1);
46926  __pyx_t_1 = 0;
46927 
46928  /* "WaveTools.py":2559
46929  * cython.declare(cppU=cython.double[3])
46930  * for ii in range(3):
46931  * xx[ii] = x[ii] # <<<<<<<<<<<<<<
46932  * cppU[ii] = 0.
46933  * U = np.zeros(3,)
46934  */
46935  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error)
46936  __Pyx_GOTREF(__pyx_t_1);
46937  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L1_error)
46938  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46939  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L1_error)
46940  (__pyx_v_xx[__pyx_t_7]) = __pyx_t_6;
46941 
46942  /* "WaveTools.py":2560
46943  * for ii in range(3):
46944  * xx[ii] = x[ii]
46945  * cppU[ii] = 0. # <<<<<<<<<<<<<<
46946  * U = np.zeros(3,)
46947  * self._cpp_uWindow(cppU,xx,t)
46948  */
46949  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ii); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2560, __pyx_L1_error)
46950  (__pyx_v_cppU[__pyx_t_7]) = 0.;
46951 
46952  /* "WaveTools.py":2558
46953  * cython.declare(xx=cython.double[3])
46954  * cython.declare(cppU=cython.double[3])
46955  * for ii in range(3): # <<<<<<<<<<<<<<
46956  * xx[ii] = x[ii]
46957  * cppU[ii] = 0.
46958  */
46959  }
46960  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46961 
46962  /* "WaveTools.py":2561
46963  * xx[ii] = x[ii]
46964  * cppU[ii] = 0.
46965  * U = np.zeros(3,) # <<<<<<<<<<<<<<
46966  * self._cpp_uWindow(cppU,xx,t)
46967  * U[0] = cppU[0]
46968  */
46969  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2561, __pyx_L1_error)
46970  __Pyx_GOTREF(__pyx_t_1);
46971  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2561, __pyx_L1_error)
46972  __Pyx_GOTREF(__pyx_t_3);
46973  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
46974  __pyx_t_1 = NULL;
46975  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
46976  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
46977  if (likely(__pyx_t_1)) {
46978  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
46979  __Pyx_INCREF(__pyx_t_1);
46980  __Pyx_INCREF(function);
46981  __Pyx_DECREF_SET(__pyx_t_3, function);
46982  }
46983  }
46984  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
46985  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
46986  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2561, __pyx_L1_error)
46987  __Pyx_GOTREF(__pyx_t_2);
46988  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46989  __pyx_v_U = __pyx_t_2;
46990  __pyx_t_2 = 0;
46991 
46992  /* "WaveTools.py":2562
46993  * cppU[ii] = 0.
46994  * U = np.zeros(3,)
46995  * self._cpp_uWindow(cppU,xx,t) # <<<<<<<<<<<<<<
46996  * U[0] = cppU[0]
46997  * U[1] = cppU[1]
46998  */
46999  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L1_error)
47000  ((struct __pyx_vtabstruct_9WaveTools_TimeSeries *)__pyx_v_self->__pyx_vtab)->_cpp_uWindow(__pyx_v_self, __pyx_v_cppU, __pyx_v_xx, __pyx_t_6);
47001 
47002  /* "WaveTools.py":2563
47003  * U = np.zeros(3,)
47004  * self._cpp_uWindow(cppU,xx,t)
47005  * U[0] = cppU[0] # <<<<<<<<<<<<<<
47006  * U[1] = cppU[1]
47007  * U[2] = cppU[2]
47008  */
47009  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2563, __pyx_L1_error)
47010  __Pyx_GOTREF(__pyx_t_2);
47011  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 0, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2563, __pyx_L1_error)
47012  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47013 
47014  /* "WaveTools.py":2564
47015  * self._cpp_uWindow(cppU,xx,t)
47016  * U[0] = cppU[0]
47017  * U[1] = cppU[1] # <<<<<<<<<<<<<<
47018  * U[2] = cppU[2]
47019  *
47020  */
47021  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2564, __pyx_L1_error)
47022  __Pyx_GOTREF(__pyx_t_2);
47023  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 1, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2564, __pyx_L1_error)
47024  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47025 
47026  /* "WaveTools.py":2565
47027  * U[0] = cppU[0]
47028  * U[1] = cppU[1]
47029  * U[2] = cppU[2] # <<<<<<<<<<<<<<
47030  *
47031  * return U
47032  */
47033  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_cppU[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2565, __pyx_L1_error)
47034  __Pyx_GOTREF(__pyx_t_2);
47035  if (unlikely(__Pyx_SetItemInt(__pyx_v_U, 2, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 2565, __pyx_L1_error)
47036  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47037 
47038  /* "WaveTools.py":2567
47039  * U[2] = cppU[2]
47040  *
47041  * return U # <<<<<<<<<<<<<<
47042  *
47043  *
47044  */
47045  __Pyx_XDECREF(__pyx_r);
47046  __Pyx_INCREF(__pyx_v_U);
47047  __pyx_r = __pyx_v_U;
47048  goto __pyx_L0;
47049 
47050  /* "WaveTools.py":2541
47051  *
47052  *
47053  * def uWindow(self, x, t): # <<<<<<<<<<<<<<
47054  * """Calculates wave velocity vector (Timeseries class-window method)
47055  * Parameters
47056  */
47057 
47058  /* function exit code */
47059  __pyx_L1_error:;
47060  __Pyx_XDECREF(__pyx_t_1);
47061  __Pyx_XDECREF(__pyx_t_2);
47062  __Pyx_XDECREF(__pyx_t_3);
47063  __Pyx_AddTraceback("WaveTools.TimeSeries.uWindow", __pyx_clineno, __pyx_lineno, __pyx_filename);
47064  __pyx_r = NULL;
47065  __pyx_L0:;
47066  __Pyx_XDECREF(__pyx_v_ii);
47067  __Pyx_XDECREF(__pyx_v_U);
47068  __Pyx_XGIVEREF(__pyx_r);
47069  __Pyx_RefNannyFinishContext();
47070  return __pyx_r;
47071 }
47072 
47073 /* "WaveTools.pxd":220
47074  * cdef double[1000000] T0
47075  * cdef public:
47076  * double wavelength,mwl # <<<<<<<<<<<<<<
47077  * object eta,u
47078  * cdef cfeta2 _cpp_eta
47079  */
47080 
47081 /* Python wrapper */
47082 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_10wavelength_1__get__(PyObject *__pyx_v_self); /*proto*/
47083 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_10wavelength_1__get__(PyObject *__pyx_v_self) {
47084  PyObject *__pyx_r = 0;
47085  __Pyx_RefNannyDeclarations
47086  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
47087  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_10wavelength___get__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47088 
47089  /* function exit code */
47090  __Pyx_RefNannyFinishContext();
47091  return __pyx_r;
47092 }
47093 
47094 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_10wavelength___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47095  PyObject *__pyx_r = NULL;
47096  __Pyx_RefNannyDeclarations
47097  PyObject *__pyx_t_1 = NULL;
47098  __Pyx_RefNannySetupContext("__get__", 0);
47099  __Pyx_XDECREF(__pyx_r);
47100  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->wavelength); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 220, __pyx_L1_error)
47101  __Pyx_GOTREF(__pyx_t_1);
47102  __pyx_r = __pyx_t_1;
47103  __pyx_t_1 = 0;
47104  goto __pyx_L0;
47105 
47106  /* function exit code */
47107  __pyx_L1_error:;
47108  __Pyx_XDECREF(__pyx_t_1);
47109  __Pyx_AddTraceback("WaveTools.TimeSeries.wavelength.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47110  __pyx_r = NULL;
47111  __pyx_L0:;
47112  __Pyx_XGIVEREF(__pyx_r);
47113  __Pyx_RefNannyFinishContext();
47114  return __pyx_r;
47115 }
47116 
47117 /* Python wrapper */
47118 static int __pyx_pw_9WaveTools_10TimeSeries_10wavelength_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
47119 static int __pyx_pw_9WaveTools_10TimeSeries_10wavelength_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
47120  int __pyx_r;
47121  __Pyx_RefNannyDeclarations
47122  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
47123  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_10wavelength_2__set__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
47124 
47125  /* function exit code */
47126  __Pyx_RefNannyFinishContext();
47127  return __pyx_r;
47128 }
47129 
47130 static int __pyx_pf_9WaveTools_10TimeSeries_10wavelength_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value) {
47131  int __pyx_r;
47132  __Pyx_RefNannyDeclarations
47133  double __pyx_t_1;
47134  __Pyx_RefNannySetupContext("__set__", 0);
47135  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 220, __pyx_L1_error)
47136  __pyx_v_self->wavelength = __pyx_t_1;
47137 
47138  /* function exit code */
47139  __pyx_r = 0;
47140  goto __pyx_L0;
47141  __pyx_L1_error:;
47142  __Pyx_AddTraceback("WaveTools.TimeSeries.wavelength.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47143  __pyx_r = -1;
47144  __pyx_L0:;
47145  __Pyx_RefNannyFinishContext();
47146  return __pyx_r;
47147 }
47148 
47149 /* Python wrapper */
47150 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_3mwl_1__get__(PyObject *__pyx_v_self); /*proto*/
47151 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_3mwl_1__get__(PyObject *__pyx_v_self) {
47152  PyObject *__pyx_r = 0;
47153  __Pyx_RefNannyDeclarations
47154  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
47155  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_3mwl___get__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47156 
47157  /* function exit code */
47158  __Pyx_RefNannyFinishContext();
47159  return __pyx_r;
47160 }
47161 
47162 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_3mwl___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47163  PyObject *__pyx_r = NULL;
47164  __Pyx_RefNannyDeclarations
47165  PyObject *__pyx_t_1 = NULL;
47166  __Pyx_RefNannySetupContext("__get__", 0);
47167  __Pyx_XDECREF(__pyx_r);
47168  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mwl); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 220, __pyx_L1_error)
47169  __Pyx_GOTREF(__pyx_t_1);
47170  __pyx_r = __pyx_t_1;
47171  __pyx_t_1 = 0;
47172  goto __pyx_L0;
47173 
47174  /* function exit code */
47175  __pyx_L1_error:;
47176  __Pyx_XDECREF(__pyx_t_1);
47177  __Pyx_AddTraceback("WaveTools.TimeSeries.mwl.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47178  __pyx_r = NULL;
47179  __pyx_L0:;
47180  __Pyx_XGIVEREF(__pyx_r);
47181  __Pyx_RefNannyFinishContext();
47182  return __pyx_r;
47183 }
47184 
47185 /* Python wrapper */
47186 static int __pyx_pw_9WaveTools_10TimeSeries_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
47187 static int __pyx_pw_9WaveTools_10TimeSeries_3mwl_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
47188  int __pyx_r;
47189  __Pyx_RefNannyDeclarations
47190  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
47191  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_3mwl_2__set__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
47192 
47193  /* function exit code */
47194  __Pyx_RefNannyFinishContext();
47195  return __pyx_r;
47196 }
47197 
47198 static int __pyx_pf_9WaveTools_10TimeSeries_3mwl_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value) {
47199  int __pyx_r;
47200  __Pyx_RefNannyDeclarations
47201  double __pyx_t_1;
47202  __Pyx_RefNannySetupContext("__set__", 0);
47203  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(2, 220, __pyx_L1_error)
47204  __pyx_v_self->mwl = __pyx_t_1;
47205 
47206  /* function exit code */
47207  __pyx_r = 0;
47208  goto __pyx_L0;
47209  __pyx_L1_error:;
47210  __Pyx_AddTraceback("WaveTools.TimeSeries.mwl.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47211  __pyx_r = -1;
47212  __pyx_L0:;
47213  __Pyx_RefNannyFinishContext();
47214  return __pyx_r;
47215 }
47216 
47217 /* "WaveTools.pxd":221
47218  * cdef public:
47219  * double wavelength,mwl
47220  * object eta,u # <<<<<<<<<<<<<<
47221  * cdef cfeta2 _cpp_eta
47222  * cdef cfvel2 _cpp_u
47223  */
47224 
47225 /* Python wrapper */
47226 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_3eta_1__get__(PyObject *__pyx_v_self); /*proto*/
47227 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_3eta_1__get__(PyObject *__pyx_v_self) {
47228  PyObject *__pyx_r = 0;
47229  __Pyx_RefNannyDeclarations
47230  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
47231  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_3eta___get__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47232 
47233  /* function exit code */
47234  __Pyx_RefNannyFinishContext();
47235  return __pyx_r;
47236 }
47237 
47238 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_3eta___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47239  PyObject *__pyx_r = NULL;
47240  __Pyx_RefNannyDeclarations
47241  __Pyx_RefNannySetupContext("__get__", 0);
47242  __Pyx_XDECREF(__pyx_r);
47243  __Pyx_INCREF(__pyx_v_self->eta);
47244  __pyx_r = __pyx_v_self->eta;
47245  goto __pyx_L0;
47246 
47247  /* function exit code */
47248  __pyx_L0:;
47249  __Pyx_XGIVEREF(__pyx_r);
47250  __Pyx_RefNannyFinishContext();
47251  return __pyx_r;
47252 }
47253 
47254 /* Python wrapper */
47255 static int __pyx_pw_9WaveTools_10TimeSeries_3eta_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
47256 static int __pyx_pw_9WaveTools_10TimeSeries_3eta_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
47257  int __pyx_r;
47258  __Pyx_RefNannyDeclarations
47259  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
47260  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_3eta_2__set__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
47261 
47262  /* function exit code */
47263  __Pyx_RefNannyFinishContext();
47264  return __pyx_r;
47265 }
47266 
47267 static int __pyx_pf_9WaveTools_10TimeSeries_3eta_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value) {
47268  int __pyx_r;
47269  __Pyx_RefNannyDeclarations
47270  __Pyx_RefNannySetupContext("__set__", 0);
47271  __Pyx_INCREF(__pyx_v_value);
47272  __Pyx_GIVEREF(__pyx_v_value);
47273  __Pyx_GOTREF(__pyx_v_self->eta);
47274  __Pyx_DECREF(__pyx_v_self->eta);
47275  __pyx_v_self->eta = __pyx_v_value;
47276 
47277  /* function exit code */
47278  __pyx_r = 0;
47279  __Pyx_RefNannyFinishContext();
47280  return __pyx_r;
47281 }
47282 
47283 /* Python wrapper */
47284 static int __pyx_pw_9WaveTools_10TimeSeries_3eta_5__del__(PyObject *__pyx_v_self); /*proto*/
47285 static int __pyx_pw_9WaveTools_10TimeSeries_3eta_5__del__(PyObject *__pyx_v_self) {
47286  int __pyx_r;
47287  __Pyx_RefNannyDeclarations
47288  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
47289  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_3eta_4__del__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47290 
47291  /* function exit code */
47292  __Pyx_RefNannyFinishContext();
47293  return __pyx_r;
47294 }
47295 
47296 static int __pyx_pf_9WaveTools_10TimeSeries_3eta_4__del__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47297  int __pyx_r;
47298  __Pyx_RefNannyDeclarations
47299  __Pyx_RefNannySetupContext("__del__", 0);
47300  __Pyx_INCREF(Py_None);
47301  __Pyx_GIVEREF(Py_None);
47302  __Pyx_GOTREF(__pyx_v_self->eta);
47303  __Pyx_DECREF(__pyx_v_self->eta);
47304  __pyx_v_self->eta = Py_None;
47305 
47306  /* function exit code */
47307  __pyx_r = 0;
47308  __Pyx_RefNannyFinishContext();
47309  return __pyx_r;
47310 }
47311 
47312 /* Python wrapper */
47313 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_1u_1__get__(PyObject *__pyx_v_self); /*proto*/
47314 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_1u_1__get__(PyObject *__pyx_v_self) {
47315  PyObject *__pyx_r = 0;
47316  __Pyx_RefNannyDeclarations
47317  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
47318  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_1u___get__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47319 
47320  /* function exit code */
47321  __Pyx_RefNannyFinishContext();
47322  return __pyx_r;
47323 }
47324 
47325 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_1u___get__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47326  PyObject *__pyx_r = NULL;
47327  __Pyx_RefNannyDeclarations
47328  __Pyx_RefNannySetupContext("__get__", 0);
47329  __Pyx_XDECREF(__pyx_r);
47330  __Pyx_INCREF(__pyx_v_self->u);
47331  __pyx_r = __pyx_v_self->u;
47332  goto __pyx_L0;
47333 
47334  /* function exit code */
47335  __pyx_L0:;
47336  __Pyx_XGIVEREF(__pyx_r);
47337  __Pyx_RefNannyFinishContext();
47338  return __pyx_r;
47339 }
47340 
47341 /* Python wrapper */
47342 static int __pyx_pw_9WaveTools_10TimeSeries_1u_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
47343 static int __pyx_pw_9WaveTools_10TimeSeries_1u_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
47344  int __pyx_r;
47345  __Pyx_RefNannyDeclarations
47346  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
47347  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_1u_2__set__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
47348 
47349  /* function exit code */
47350  __Pyx_RefNannyFinishContext();
47351  return __pyx_r;
47352 }
47353 
47354 static int __pyx_pf_9WaveTools_10TimeSeries_1u_2__set__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, PyObject *__pyx_v_value) {
47355  int __pyx_r;
47356  __Pyx_RefNannyDeclarations
47357  __Pyx_RefNannySetupContext("__set__", 0);
47358  __Pyx_INCREF(__pyx_v_value);
47359  __Pyx_GIVEREF(__pyx_v_value);
47360  __Pyx_GOTREF(__pyx_v_self->u);
47361  __Pyx_DECREF(__pyx_v_self->u);
47362  __pyx_v_self->u = __pyx_v_value;
47363 
47364  /* function exit code */
47365  __pyx_r = 0;
47366  __Pyx_RefNannyFinishContext();
47367  return __pyx_r;
47368 }
47369 
47370 /* Python wrapper */
47371 static int __pyx_pw_9WaveTools_10TimeSeries_1u_5__del__(PyObject *__pyx_v_self); /*proto*/
47372 static int __pyx_pw_9WaveTools_10TimeSeries_1u_5__del__(PyObject *__pyx_v_self) {
47373  int __pyx_r;
47374  __Pyx_RefNannyDeclarations
47375  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
47376  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_1u_4__del__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47377 
47378  /* function exit code */
47379  __Pyx_RefNannyFinishContext();
47380  return __pyx_r;
47381 }
47382 
47383 static int __pyx_pf_9WaveTools_10TimeSeries_1u_4__del__(struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47384  int __pyx_r;
47385  __Pyx_RefNannyDeclarations
47386  __Pyx_RefNannySetupContext("__del__", 0);
47387  __Pyx_INCREF(Py_None);
47388  __Pyx_GIVEREF(Py_None);
47389  __Pyx_GOTREF(__pyx_v_self->u);
47390  __Pyx_DECREF(__pyx_v_self->u);
47391  __pyx_v_self->u = Py_None;
47392 
47393  /* function exit code */
47394  __pyx_r = 0;
47395  __Pyx_RefNannyFinishContext();
47396  return __pyx_r;
47397 }
47398 
47399 /* "(tree fragment)":1
47400  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
47401  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47402  * def __setstate_cython__(self, __pyx_state):
47403  */
47404 
47405 /* Python wrapper */
47406 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
47407 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_15__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_15__reduce_cython__, METH_NOARGS, 0};
47408 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
47409  PyObject *__pyx_r = 0;
47410  __Pyx_RefNannyDeclarations
47411  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
47412  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_14__reduce_cython__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self));
47413 
47414  /* function exit code */
47415  __Pyx_RefNannyFinishContext();
47416  return __pyx_r;
47417 }
47418 
47419 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self) {
47420  PyObject *__pyx_r = NULL;
47421  __Pyx_RefNannyDeclarations
47422  PyObject *__pyx_t_1 = NULL;
47423  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
47424 
47425  /* "(tree fragment)":2
47426  * def __reduce_cython__(self):
47427  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
47428  * def __setstate_cython__(self, __pyx_state):
47429  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47430  */
47431  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
47432  __Pyx_GOTREF(__pyx_t_1);
47433  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
47434  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47435  __PYX_ERR(1, 2, __pyx_L1_error)
47436 
47437  /* "(tree fragment)":1
47438  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
47439  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47440  * def __setstate_cython__(self, __pyx_state):
47441  */
47442 
47443  /* function exit code */
47444  __pyx_L1_error:;
47445  __Pyx_XDECREF(__pyx_t_1);
47446  __Pyx_AddTraceback("WaveTools.TimeSeries.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47447  __pyx_r = NULL;
47448  __Pyx_XGIVEREF(__pyx_r);
47449  __Pyx_RefNannyFinishContext();
47450  return __pyx_r;
47451 }
47452 
47453 /* "(tree fragment)":3
47454  * def __reduce_cython__(self):
47455  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47456  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
47457  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47458  */
47459 
47460 /* Python wrapper */
47461 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
47462 static PyMethodDef __pyx_mdef_9WaveTools_10TimeSeries_17__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_17__setstate_cython__, METH_O, 0};
47463 static PyObject *__pyx_pw_9WaveTools_10TimeSeries_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
47464  PyObject *__pyx_r = 0;
47465  __Pyx_RefNannyDeclarations
47466  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
47467  __pyx_r = __pyx_pf_9WaveTools_10TimeSeries_16__setstate_cython__(((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
47468 
47469  /* function exit code */
47470  __Pyx_RefNannyFinishContext();
47471  return __pyx_r;
47472 }
47473 
47474 static PyObject *__pyx_pf_9WaveTools_10TimeSeries_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
47475  PyObject *__pyx_r = NULL;
47476  __Pyx_RefNannyDeclarations
47477  PyObject *__pyx_t_1 = NULL;
47478  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
47479 
47480  /* "(tree fragment)":4
47481  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47482  * def __setstate_cython__(self, __pyx_state):
47483  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
47484  */
47485  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
47486  __Pyx_GOTREF(__pyx_t_1);
47487  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
47488  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47489  __PYX_ERR(1, 4, __pyx_L1_error)
47490 
47491  /* "(tree fragment)":3
47492  * def __reduce_cython__(self):
47493  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47494  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
47495  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
47496  */
47497 
47498  /* function exit code */
47499  __pyx_L1_error:;
47500  __Pyx_XDECREF(__pyx_t_1);
47501  __Pyx_AddTraceback("WaveTools.TimeSeries.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47502  __pyx_r = NULL;
47503  __Pyx_XGIVEREF(__pyx_r);
47504  __Pyx_RefNannyFinishContext();
47505  return __pyx_r;
47506 }
47507 
47508 /* "WaveTools.py":2622
47509  * """
47510  *
47511  * def __init__(self, # <<<<<<<<<<<<<<
47512  * Tstart,
47513  * Tend,
47514  */
47515 
47516 /* Python wrapper */
47517 static PyObject *__pyx_pw_9WaveTools_15RandomWavesFast_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
47518 static PyMethodDef __pyx_mdef_9WaveTools_15RandomWavesFast_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_15RandomWavesFast_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
47519 static PyObject *__pyx_pw_9WaveTools_15RandomWavesFast_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
47520  PyObject *__pyx_v_self = 0;
47521  PyObject *__pyx_v_Tstart = 0;
47522  PyObject *__pyx_v_Tend = 0;
47523  PyObject *__pyx_v_x0 = 0;
47524  PyObject *__pyx_v_Tp = 0;
47525  PyObject *__pyx_v_Hs = 0;
47526  PyObject *__pyx_v_mwl = 0;
47527  PyObject *__pyx_v_depth = 0;
47528  PyObject *__pyx_v_waveDir = 0;
47529  PyObject *__pyx_v_g = 0;
47530  PyObject *__pyx_v_N = 0;
47531  PyObject *__pyx_v_bandFactor = 0;
47532  PyObject *__pyx_v_spectName = 0;
47533  PyObject *__pyx_v_spectral_params = 0;
47534  PyObject *__pyx_v_phi = 0;
47535  PyObject *__pyx_v_Lgen = 0;
47536  PyObject *__pyx_v_Nwaves = 0;
47537  PyObject *__pyx_v_Nfreq = 0;
47538  PyObject *__pyx_v_checkAcc = 0;
47539  PyObject *__pyx_v_fast = 0;
47540  PyObject *__pyx_r = 0;
47541  __Pyx_RefNannyDeclarations
47542  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
47543  {
47544  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_Tstart,&__pyx_n_s_Tend,&__pyx_n_s_x0,&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spectral_params,&__pyx_n_s_phi,&__pyx_n_s_Lgen,&__pyx_n_s_Nwaves,&__pyx_n_s_Nfreq,&__pyx_n_s_checkAcc,&__pyx_n_s_fast,0};
47545  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
47546 
47547  /* "WaveTools.py":2635
47548  * bandFactor, #accelerationof gravity
47549  * spectName ,# random words will result in error and return the available spectra
47550  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth} # <<<<<<<<<<<<<<
47551  * phi=None,
47552  * Lgen =None,
47553  */
47554  values[13] = ((PyObject *)((PyObject *)Py_None));
47555 
47556  /* "WaveTools.py":2636
47557  * spectName ,# random words will result in error and return the available spectra
47558  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
47559  * phi=None, # <<<<<<<<<<<<<<
47560  * Lgen =None,
47561  * Nwaves = 15,
47562  */
47563  values[14] = ((PyObject *)((PyObject *)Py_None));
47564 
47565  /* "WaveTools.py":2637
47566  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
47567  * phi=None,
47568  * Lgen =None, # <<<<<<<<<<<<<<
47569  * Nwaves = 15,
47570  * Nfreq = 32,
47571  */
47572  values[15] = ((PyObject *)((PyObject *)Py_None));
47573  values[16] = ((PyObject *)((PyObject *)__pyx_int_15));
47574  values[17] = ((PyObject *)((PyObject *)__pyx_int_32));
47575 
47576  /* "WaveTools.py":2640
47577  * Nwaves = 15,
47578  * Nfreq = 32,
47579  * checkAcc = True, # <<<<<<<<<<<<<<
47580  * fast= True):
47581  * RW = RandomWaves(
47582  */
47583  values[18] = ((PyObject *)((PyObject *)Py_True));
47584 
47585  /* "WaveTools.py":2641
47586  * Nfreq = 32,
47587  * checkAcc = True,
47588  * fast= True): # <<<<<<<<<<<<<<
47589  * RW = RandomWaves(
47590  * Tp, # np array with
47591  */
47592  values[19] = ((PyObject *)((PyObject *)Py_True));
47593  if (unlikely(__pyx_kwds)) {
47594  Py_ssize_t kw_args;
47595  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
47596  switch (pos_args) {
47597  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
47598  CYTHON_FALLTHROUGH;
47599  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
47600  CYTHON_FALLTHROUGH;
47601  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
47602  CYTHON_FALLTHROUGH;
47603  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
47604  CYTHON_FALLTHROUGH;
47605  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
47606  CYTHON_FALLTHROUGH;
47607  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
47608  CYTHON_FALLTHROUGH;
47609  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
47610  CYTHON_FALLTHROUGH;
47611  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
47612  CYTHON_FALLTHROUGH;
47613  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
47614  CYTHON_FALLTHROUGH;
47615  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
47616  CYTHON_FALLTHROUGH;
47617  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
47618  CYTHON_FALLTHROUGH;
47619  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
47620  CYTHON_FALLTHROUGH;
47621  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
47622  CYTHON_FALLTHROUGH;
47623  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
47624  CYTHON_FALLTHROUGH;
47625  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
47626  CYTHON_FALLTHROUGH;
47627  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
47628  CYTHON_FALLTHROUGH;
47629  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
47630  CYTHON_FALLTHROUGH;
47631  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
47632  CYTHON_FALLTHROUGH;
47633  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
47634  CYTHON_FALLTHROUGH;
47635  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47636  CYTHON_FALLTHROUGH;
47637  case 0: break;
47638  default: goto __pyx_L5_argtuple_error;
47639  }
47640  kw_args = PyDict_Size(__pyx_kwds);
47641  switch (pos_args) {
47642  case 0:
47643  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
47644  else goto __pyx_L5_argtuple_error;
47645  CYTHON_FALLTHROUGH;
47646  case 1:
47647  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tstart)) != 0)) kw_args--;
47648  else {
47649  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 1); __PYX_ERR(0, 2622, __pyx_L3_error)
47650  }
47651  CYTHON_FALLTHROUGH;
47652  case 2:
47653  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tend)) != 0)) kw_args--;
47654  else {
47655  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 2); __PYX_ERR(0, 2622, __pyx_L3_error)
47656  }
47657  CYTHON_FALLTHROUGH;
47658  case 3:
47659  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
47660  else {
47661  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 3); __PYX_ERR(0, 2622, __pyx_L3_error)
47662  }
47663  CYTHON_FALLTHROUGH;
47664  case 4:
47665  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
47666  else {
47667  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 4); __PYX_ERR(0, 2622, __pyx_L3_error)
47668  }
47669  CYTHON_FALLTHROUGH;
47670  case 5:
47671  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
47672  else {
47673  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 5); __PYX_ERR(0, 2622, __pyx_L3_error)
47674  }
47675  CYTHON_FALLTHROUGH;
47676  case 6:
47677  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
47678  else {
47679  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 6); __PYX_ERR(0, 2622, __pyx_L3_error)
47680  }
47681  CYTHON_FALLTHROUGH;
47682  case 7:
47683  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
47684  else {
47685  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 7); __PYX_ERR(0, 2622, __pyx_L3_error)
47686  }
47687  CYTHON_FALLTHROUGH;
47688  case 8:
47689  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
47690  else {
47691  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 8); __PYX_ERR(0, 2622, __pyx_L3_error)
47692  }
47693  CYTHON_FALLTHROUGH;
47694  case 9:
47695  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
47696  else {
47697  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 9); __PYX_ERR(0, 2622, __pyx_L3_error)
47698  }
47699  CYTHON_FALLTHROUGH;
47700  case 10:
47701  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
47702  else {
47703  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 10); __PYX_ERR(0, 2622, __pyx_L3_error)
47704  }
47705  CYTHON_FALLTHROUGH;
47706  case 11:
47707  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
47708  else {
47709  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 11); __PYX_ERR(0, 2622, __pyx_L3_error)
47710  }
47711  CYTHON_FALLTHROUGH;
47712  case 12:
47713  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
47714  else {
47715  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 12); __PYX_ERR(0, 2622, __pyx_L3_error)
47716  }
47717  CYTHON_FALLTHROUGH;
47718  case 13:
47719  if (kw_args > 0) {
47720  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params);
47721  if (value) { values[13] = value; kw_args--; }
47722  }
47723  CYTHON_FALLTHROUGH;
47724  case 14:
47725  if (kw_args > 0) {
47726  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi);
47727  if (value) { values[14] = value; kw_args--; }
47728  }
47729  CYTHON_FALLTHROUGH;
47730  case 15:
47731  if (kw_args > 0) {
47732  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Lgen);
47733  if (value) { values[15] = value; kw_args--; }
47734  }
47735  CYTHON_FALLTHROUGH;
47736  case 16:
47737  if (kw_args > 0) {
47738  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nwaves);
47739  if (value) { values[16] = value; kw_args--; }
47740  }
47741  CYTHON_FALLTHROUGH;
47742  case 17:
47743  if (kw_args > 0) {
47744  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nfreq);
47745  if (value) { values[17] = value; kw_args--; }
47746  }
47747  CYTHON_FALLTHROUGH;
47748  case 18:
47749  if (kw_args > 0) {
47750  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_checkAcc);
47751  if (value) { values[18] = value; kw_args--; }
47752  }
47753  CYTHON_FALLTHROUGH;
47754  case 19:
47755  if (kw_args > 0) {
47756  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
47757  if (value) { values[19] = value; kw_args--; }
47758  }
47759  }
47760  if (unlikely(kw_args > 0)) {
47761  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2622, __pyx_L3_error)
47762  }
47763  } else {
47764  switch (PyTuple_GET_SIZE(__pyx_args)) {
47765  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
47766  CYTHON_FALLTHROUGH;
47767  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
47768  CYTHON_FALLTHROUGH;
47769  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
47770  CYTHON_FALLTHROUGH;
47771  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
47772  CYTHON_FALLTHROUGH;
47773  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
47774  CYTHON_FALLTHROUGH;
47775  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
47776  CYTHON_FALLTHROUGH;
47777  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
47778  CYTHON_FALLTHROUGH;
47779  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
47780  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
47781  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
47782  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
47783  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
47784  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
47785  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
47786  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
47787  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
47788  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
47789  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
47790  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
47791  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47792  break;
47793  default: goto __pyx_L5_argtuple_error;
47794  }
47795  }
47796  __pyx_v_self = values[0];
47797  __pyx_v_Tstart = values[1];
47798  __pyx_v_Tend = values[2];
47799  __pyx_v_x0 = values[3];
47800  __pyx_v_Tp = values[4];
47801  __pyx_v_Hs = values[5];
47802  __pyx_v_mwl = values[6];
47803  __pyx_v_depth = values[7];
47804  __pyx_v_waveDir = values[8];
47805  __pyx_v_g = values[9];
47806  __pyx_v_N = values[10];
47807  __pyx_v_bandFactor = values[11];
47808  __pyx_v_spectName = values[12];
47809  __pyx_v_spectral_params = values[13];
47810  __pyx_v_phi = values[14];
47811  __pyx_v_Lgen = values[15];
47812  __pyx_v_Nwaves = values[16];
47813  __pyx_v_Nfreq = values[17];
47814  __pyx_v_checkAcc = values[18];
47815  __pyx_v_fast = values[19];
47816  }
47817  goto __pyx_L4_argument_unpacking_done;
47818  __pyx_L5_argtuple_error:;
47819  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2622, __pyx_L3_error)
47820  __pyx_L3_error:;
47821  __Pyx_AddTraceback("WaveTools.RandomWavesFast.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
47822  __Pyx_RefNannyFinishContext();
47823  return NULL;
47824  __pyx_L4_argument_unpacking_done:;
47825  __pyx_r = __pyx_pf_9WaveTools_15RandomWavesFast___init__(__pyx_self, __pyx_v_self, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_x0, __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spectral_params, __pyx_v_phi, __pyx_v_Lgen, __pyx_v_Nwaves, __pyx_v_Nfreq, __pyx_v_checkAcc, __pyx_v_fast);
47826 
47827  /* "WaveTools.py":2622
47828  * """
47829  *
47830  * def __init__(self, # <<<<<<<<<<<<<<
47831  * Tstart,
47832  * Tend,
47833  */
47834 
47835  /* function exit code */
47836  __Pyx_RefNannyFinishContext();
47837  return __pyx_r;
47838 }
47839 
47840 static PyObject *__pyx_pf_9WaveTools_15RandomWavesFast___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_Lgen, PyObject *__pyx_v_Nwaves, PyObject *__pyx_v_Nfreq, PyObject *__pyx_v_checkAcc, PyObject *__pyx_v_fast) {
47841  struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_RW = NULL;
47842  double __pyx_v_cutoff_win;
47843  double __pyx_v_overl;
47844  PyObject *__pyx_v_fname = NULL;
47845  PyObject *__pyx_v_duration = NULL;
47846  PyObject *__pyx_v_Tm = NULL;
47847  PyObject *__pyx_v_Nwaves_tot = NULL;
47848  struct __pyx_obj_9WaveTools_TimeSeries *__pyx_v_TS = NULL;
47849  PyObject *__pyx_v_cut = NULL;
47850  PyObject *__pyx_v_ts = NULL;
47851  PyObject *__pyx_v_te = NULL;
47852  PyObject *__pyx_v_i1 = NULL;
47853  PyObject *__pyx_v_i2 = NULL;
47854  PyObject *__pyx_v_errors = NULL;
47855  PyObject *__pyx_v_ii = NULL;
47856  PyObject *__pyx_r = NULL;
47857  __Pyx_RefNannyDeclarations
47858  PyObject *__pyx_t_1 = NULL;
47859  PyObject *__pyx_t_2 = NULL;
47860  int __pyx_t_3;
47861  int __pyx_t_4;
47862  PyObject *__pyx_t_5 = NULL;
47863  PyObject *__pyx_t_6 = NULL;
47864  PyObject *__pyx_t_7 = NULL;
47865  int __pyx_t_8;
47866  Py_ssize_t __pyx_t_9;
47867  PyObject *(*__pyx_t_10)(PyObject *);
47868  PyObject *__pyx_t_11 = NULL;
47869  PyObject *__pyx_t_12 = NULL;
47870  __Pyx_RefNannySetupContext("__init__", 0);
47871  __Pyx_INCREF(__pyx_v_Nwaves);
47872 
47873  /* "WaveTools.py":2642
47874  * checkAcc = True,
47875  * fast= True):
47876  * RW = RandomWaves( # <<<<<<<<<<<<<<
47877  * Tp, # np array with
47878  * Hs,
47879  */
47880  __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error)
47881  __Pyx_GOTREF(__pyx_t_1);
47882  __Pyx_INCREF(__pyx_v_Tp);
47883  __Pyx_GIVEREF(__pyx_v_Tp);
47884  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_Tp);
47885  __Pyx_INCREF(__pyx_v_Hs);
47886  __Pyx_GIVEREF(__pyx_v_Hs);
47887  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_Hs);
47888  __Pyx_INCREF(__pyx_v_mwl);
47889  __Pyx_GIVEREF(__pyx_v_mwl);
47890  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_mwl);
47891  __Pyx_INCREF(__pyx_v_depth);
47892  __Pyx_GIVEREF(__pyx_v_depth);
47893  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_depth);
47894  __Pyx_INCREF(__pyx_v_waveDir);
47895  __Pyx_GIVEREF(__pyx_v_waveDir);
47896  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_waveDir);
47897  __Pyx_INCREF(__pyx_v_g);
47898  __Pyx_GIVEREF(__pyx_v_g);
47899  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_g);
47900  __Pyx_INCREF(__pyx_v_N);
47901  __Pyx_GIVEREF(__pyx_v_N);
47902  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_N);
47903  __Pyx_INCREF(__pyx_v_bandFactor);
47904  __Pyx_GIVEREF(__pyx_v_bandFactor);
47905  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_bandFactor);
47906  __Pyx_INCREF(__pyx_v_spectName);
47907  __Pyx_GIVEREF(__pyx_v_spectName);
47908  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_v_spectName);
47909  __Pyx_INCREF(__pyx_v_spectral_params);
47910  __Pyx_GIVEREF(__pyx_v_spectral_params);
47911  PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_v_spectral_params);
47912  __Pyx_INCREF(__pyx_v_phi);
47913  __Pyx_GIVEREF(__pyx_v_phi);
47914  PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_v_phi);
47915  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_RandomWaves), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2642, __pyx_L1_error)
47916  __Pyx_GOTREF(__pyx_t_2);
47917  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47918  __pyx_v_RW = ((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_t_2);
47919  __pyx_t_2 = 0;
47920 
47921  /* "WaveTools.py":2655
47922  * phi
47923  * )
47924  * self.Hs = Hs # <<<<<<<<<<<<<<
47925  * self.Tp = Tp
47926  * self.depth = depth
47927  */
47928  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Hs, __pyx_v_Hs) < 0) __PYX_ERR(0, 2655, __pyx_L1_error)
47929 
47930  /* "WaveTools.py":2656
47931  * )
47932  * self.Hs = Hs
47933  * self.Tp = Tp # <<<<<<<<<<<<<<
47934  * self.depth = depth
47935  * self.mwl = mwl
47936  */
47937  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Tp, __pyx_v_Tp) < 0) __PYX_ERR(0, 2656, __pyx_L1_error)
47938 
47939  /* "WaveTools.py":2657
47940  * self.Hs = Hs
47941  * self.Tp = Tp
47942  * self.depth = depth # <<<<<<<<<<<<<<
47943  * self.mwl = mwl
47944  * self.wavelength = RW.wavelength
47945  */
47946  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_depth, __pyx_v_depth) < 0) __PYX_ERR(0, 2657, __pyx_L1_error)
47947 
47948  /* "WaveTools.py":2658
47949  * self.Tp = Tp
47950  * self.depth = depth
47951  * self.mwl = mwl # <<<<<<<<<<<<<<
47952  * self.wavelength = RW.wavelength
47953  * if Lgen is None:
47954  */
47955  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mwl, __pyx_v_mwl) < 0) __PYX_ERR(0, 2658, __pyx_L1_error)
47956 
47957  /* "WaveTools.py":2659
47958  * self.depth = depth
47959  * self.mwl = mwl
47960  * self.wavelength = RW.wavelength # <<<<<<<<<<<<<<
47961  * if Lgen is None:
47962  * self.Lgen = self.wavelength*waveDir
47963  */
47964  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_RW->wavelength); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2659, __pyx_L1_error)
47965  __Pyx_GOTREF(__pyx_t_2);
47966  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_wavelength, __pyx_t_2) < 0) __PYX_ERR(0, 2659, __pyx_L1_error)
47967  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47968 
47969  /* "WaveTools.py":2660
47970  * self.mwl = mwl
47971  * self.wavelength = RW.wavelength
47972  * if Lgen is None: # <<<<<<<<<<<<<<
47973  * self.Lgen = self.wavelength*waveDir
47974  * else:
47975  */
47976  __pyx_t_3 = (__pyx_v_Lgen == Py_None);
47977  __pyx_t_4 = (__pyx_t_3 != 0);
47978  if (__pyx_t_4) {
47979 
47980  /* "WaveTools.py":2661
47981  * self.wavelength = RW.wavelength
47982  * if Lgen is None:
47983  * self.Lgen = self.wavelength*waveDir # <<<<<<<<<<<<<<
47984  * else:
47985  * self.Lgen = Lgen
47986  */
47987  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_wavelength); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2661, __pyx_L1_error)
47988  __Pyx_GOTREF(__pyx_t_2);
47989  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_waveDir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2661, __pyx_L1_error)
47990  __Pyx_GOTREF(__pyx_t_1);
47991  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
47992  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Lgen, __pyx_t_1) < 0) __PYX_ERR(0, 2661, __pyx_L1_error)
47993  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47994 
47995  /* "WaveTools.py":2660
47996  * self.mwl = mwl
47997  * self.wavelength = RW.wavelength
47998  * if Lgen is None: # <<<<<<<<<<<<<<
47999  * self.Lgen = self.wavelength*waveDir
48000  * else:
48001  */
48002  goto __pyx_L3;
48003  }
48004 
48005  /* "WaveTools.py":2663
48006  * self.Lgen = self.wavelength*waveDir
48007  * else:
48008  * self.Lgen = Lgen # <<<<<<<<<<<<<<
48009  * cutoff_win = 0.1
48010  * overl = 0.7
48011  */
48012  /*else*/ {
48013  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Lgen, __pyx_v_Lgen) < 0) __PYX_ERR(0, 2663, __pyx_L1_error)
48014  }
48015  __pyx_L3:;
48016 
48017  /* "WaveTools.py":2664
48018  * else:
48019  * self.Lgen = Lgen
48020  * cutoff_win = 0.1 # <<<<<<<<<<<<<<
48021  * overl = 0.7
48022  * fname = "RandomSeries"+"_Hs_"+str(self.Hs)+"_Tp_"+str(self.Tp)+"_depth_"+str(self.depth)
48023  */
48024  __pyx_v_cutoff_win = 0.1;
48025 
48026  /* "WaveTools.py":2665
48027  * self.Lgen = Lgen
48028  * cutoff_win = 0.1
48029  * overl = 0.7 # <<<<<<<<<<<<<<
48030  * fname = "RandomSeries"+"_Hs_"+str(self.Hs)+"_Tp_"+str(self.Tp)+"_depth_"+str(self.depth)
48031  * self.series = RW.writeEtaSeries(Tstart,Tend,x0,fname,4.*self.Lgen)
48032  */
48033  __pyx_v_overl = 0.7;
48034 
48035  /* "WaveTools.py":2666
48036  * cutoff_win = 0.1
48037  * overl = 0.7
48038  * fname = "RandomSeries"+"_Hs_"+str(self.Hs)+"_Tp_"+str(self.Tp)+"_depth_"+str(self.depth) # <<<<<<<<<<<<<<
48039  * self.series = RW.writeEtaSeries(Tstart,Tend,x0,fname,4.*self.Lgen)
48040  * self.cutoff = max(0.2*self.Tp , cutoff_win*Nwaves*Tp)
48041  */
48042  __pyx_t_1 = PyNumber_Add(__pyx_n_s_RandomSeries, __pyx_n_s_Hs_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
48043  __Pyx_GOTREF(__pyx_t_1);
48044  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2666, __pyx_L1_error)
48045  __Pyx_GOTREF(__pyx_t_5);
48046  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Hs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2666, __pyx_L1_error)
48047  __Pyx_GOTREF(__pyx_t_6);
48048  __pyx_t_7 = NULL;
48049  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
48050  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
48051  if (likely(__pyx_t_7)) {
48052  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
48053  __Pyx_INCREF(__pyx_t_7);
48054  __Pyx_INCREF(function);
48055  __Pyx_DECREF_SET(__pyx_t_5, function);
48056  }
48057  }
48058  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
48059  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
48060  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48061  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
48062  __Pyx_GOTREF(__pyx_t_2);
48063  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48064  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2666, __pyx_L1_error)
48065  __Pyx_GOTREF(__pyx_t_5);
48066  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48067  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48068  __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_n_s_Tp_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
48069  __Pyx_GOTREF(__pyx_t_2);
48070  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48071  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
48072  __Pyx_GOTREF(__pyx_t_1);
48073  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Tp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2666, __pyx_L1_error)
48074  __Pyx_GOTREF(__pyx_t_6);
48075  __pyx_t_7 = NULL;
48076  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
48077  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
48078  if (likely(__pyx_t_7)) {
48079  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
48080  __Pyx_INCREF(__pyx_t_7);
48081  __Pyx_INCREF(function);
48082  __Pyx_DECREF_SET(__pyx_t_1, function);
48083  }
48084  }
48085  __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6);
48086  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
48087  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48088  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2666, __pyx_L1_error)
48089  __Pyx_GOTREF(__pyx_t_5);
48090  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48091  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
48092  __Pyx_GOTREF(__pyx_t_1);
48093  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48094  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48095  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_n_s_depth_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2666, __pyx_L1_error)
48096  __Pyx_GOTREF(__pyx_t_5);
48097  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48098  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
48099  __Pyx_GOTREF(__pyx_t_2);
48100  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_depth); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2666, __pyx_L1_error)
48101  __Pyx_GOTREF(__pyx_t_6);
48102  __pyx_t_7 = NULL;
48103  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
48104  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
48105  if (likely(__pyx_t_7)) {
48106  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
48107  __Pyx_INCREF(__pyx_t_7);
48108  __Pyx_INCREF(function);
48109  __Pyx_DECREF_SET(__pyx_t_2, function);
48110  }
48111  }
48112  __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6);
48113  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
48114  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48115  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2666, __pyx_L1_error)
48116  __Pyx_GOTREF(__pyx_t_1);
48117  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48118  __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2666, __pyx_L1_error)
48119  __Pyx_GOTREF(__pyx_t_2);
48120  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48121  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48122  __pyx_v_fname = __pyx_t_2;
48123  __pyx_t_2 = 0;
48124 
48125  /* "WaveTools.py":2667
48126  * overl = 0.7
48127  * fname = "RandomSeries"+"_Hs_"+str(self.Hs)+"_Tp_"+str(self.Tp)+"_depth_"+str(self.depth)
48128  * self.series = RW.writeEtaSeries(Tstart,Tend,x0,fname,4.*self.Lgen) # <<<<<<<<<<<<<<
48129  * self.cutoff = max(0.2*self.Tp , cutoff_win*Nwaves*Tp)
48130  * duration = (self.series[-1,0]-self.series[0,0])
48131  */
48132  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_RW), __pyx_n_s_writeEtaSeries); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error)
48133  __Pyx_GOTREF(__pyx_t_1);
48134  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Lgen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2667, __pyx_L1_error)
48135  __Pyx_GOTREF(__pyx_t_5);
48136  __pyx_t_6 = PyNumber_Multiply(__pyx_float_4_, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2667, __pyx_L1_error)
48137  __Pyx_GOTREF(__pyx_t_6);
48138  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48139  __pyx_t_5 = NULL;
48140  __pyx_t_8 = 0;
48141  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
48142  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
48143  if (likely(__pyx_t_5)) {
48144  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
48145  __Pyx_INCREF(__pyx_t_5);
48146  __Pyx_INCREF(function);
48147  __Pyx_DECREF_SET(__pyx_t_1, function);
48148  __pyx_t_8 = 1;
48149  }
48150  }
48151  #if CYTHON_FAST_PYCALL
48152  if (PyFunction_Check(__pyx_t_1)) {
48153  PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_x0, __pyx_v_fname, __pyx_t_6};
48154  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 5+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error)
48155  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
48156  __Pyx_GOTREF(__pyx_t_2);
48157  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48158  } else
48159  #endif
48160  #if CYTHON_FAST_PYCCALL
48161  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
48162  PyObject *__pyx_temp[6] = {__pyx_t_5, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_x0, __pyx_v_fname, __pyx_t_6};
48163  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 5+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error)
48164  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
48165  __Pyx_GOTREF(__pyx_t_2);
48166  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48167  } else
48168  #endif
48169  {
48170  __pyx_t_7 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2667, __pyx_L1_error)
48171  __Pyx_GOTREF(__pyx_t_7);
48172  if (__pyx_t_5) {
48173  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
48174  }
48175  __Pyx_INCREF(__pyx_v_Tstart);
48176  __Pyx_GIVEREF(__pyx_v_Tstart);
48177  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_Tstart);
48178  __Pyx_INCREF(__pyx_v_Tend);
48179  __Pyx_GIVEREF(__pyx_v_Tend);
48180  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_Tend);
48181  __Pyx_INCREF(__pyx_v_x0);
48182  __Pyx_GIVEREF(__pyx_v_x0);
48183  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_x0);
48184  __Pyx_INCREF(__pyx_v_fname);
48185  __Pyx_GIVEREF(__pyx_v_fname);
48186  PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_fname);
48187  __Pyx_GIVEREF(__pyx_t_6);
48188  PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_t_6);
48189  __pyx_t_6 = 0;
48190  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error)
48191  __Pyx_GOTREF(__pyx_t_2);
48192  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48193  }
48194  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48195  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_series, __pyx_t_2) < 0) __PYX_ERR(0, 2667, __pyx_L1_error)
48196  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48197 
48198  /* "WaveTools.py":2668
48199  * fname = "RandomSeries"+"_Hs_"+str(self.Hs)+"_Tp_"+str(self.Tp)+"_depth_"+str(self.depth)
48200  * self.series = RW.writeEtaSeries(Tstart,Tend,x0,fname,4.*self.Lgen)
48201  * self.cutoff = max(0.2*self.Tp , cutoff_win*Nwaves*Tp) # <<<<<<<<<<<<<<
48202  * duration = (self.series[-1,0]-self.series[0,0])
48203  * self.cutoff = old_div(self.cutoff, duration)
48204  */
48205  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff_win); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error)
48206  __Pyx_GOTREF(__pyx_t_2);
48207  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_Nwaves); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error)
48208  __Pyx_GOTREF(__pyx_t_1);
48209  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48210  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_Tp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error)
48211  __Pyx_GOTREF(__pyx_t_2);
48212  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48213  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Tp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error)
48214  __Pyx_GOTREF(__pyx_t_1);
48215  __pyx_t_7 = PyNumber_Multiply(__pyx_float_0_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2668, __pyx_L1_error)
48216  __Pyx_GOTREF(__pyx_t_7);
48217  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48218  __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2668, __pyx_L1_error)
48219  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2668, __pyx_L1_error)
48220  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48221  if (__pyx_t_4) {
48222  __Pyx_INCREF(__pyx_t_2);
48223  __pyx_t_1 = __pyx_t_2;
48224  } else {
48225  __Pyx_INCREF(__pyx_t_7);
48226  __pyx_t_1 = __pyx_t_7;
48227  }
48228  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48229  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48230  __pyx_t_2 = __pyx_t_1;
48231  __Pyx_INCREF(__pyx_t_2);
48232  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48233  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cutoff, __pyx_t_2) < 0) __PYX_ERR(0, 2668, __pyx_L1_error)
48234  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48235 
48236  /* "WaveTools.py":2669
48237  * self.series = RW.writeEtaSeries(Tstart,Tend,x0,fname,4.*self.Lgen)
48238  * self.cutoff = max(0.2*self.Tp , cutoff_win*Nwaves*Tp)
48239  * duration = (self.series[-1,0]-self.series[0,0]) # <<<<<<<<<<<<<<
48240  * self.cutoff = old_div(self.cutoff, duration)
48241  * Tm = old_div(self.Tp,1.1)
48242  */
48243  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error)
48244  __Pyx_GOTREF(__pyx_t_2);
48245  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_tuple__49); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2669, __pyx_L1_error)
48246  __Pyx_GOTREF(__pyx_t_1);
48247  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48248  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error)
48249  __Pyx_GOTREF(__pyx_t_2);
48250  __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_tuple__46); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2669, __pyx_L1_error)
48251  __Pyx_GOTREF(__pyx_t_7);
48252  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48253  __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error)
48254  __Pyx_GOTREF(__pyx_t_2);
48255  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48256  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48257  __pyx_v_duration = __pyx_t_2;
48258  __pyx_t_2 = 0;
48259 
48260  /* "WaveTools.py":2670
48261  * self.cutoff = max(0.2*self.Tp , cutoff_win*Nwaves*Tp)
48262  * duration = (self.series[-1,0]-self.series[0,0])
48263  * self.cutoff = old_div(self.cutoff, duration) # <<<<<<<<<<<<<<
48264  * Tm = old_div(self.Tp,1.1)
48265  *
48266  */
48267  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_old_div); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2670, __pyx_L1_error)
48268  __Pyx_GOTREF(__pyx_t_7);
48269  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2670, __pyx_L1_error)
48270  __Pyx_GOTREF(__pyx_t_1);
48271  __pyx_t_6 = NULL;
48272  __pyx_t_8 = 0;
48273  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
48274  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
48275  if (likely(__pyx_t_6)) {
48276  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
48277  __Pyx_INCREF(__pyx_t_6);
48278  __Pyx_INCREF(function);
48279  __Pyx_DECREF_SET(__pyx_t_7, function);
48280  __pyx_t_8 = 1;
48281  }
48282  }
48283  #if CYTHON_FAST_PYCALL
48284  if (PyFunction_Check(__pyx_t_7)) {
48285  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_duration};
48286  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2670, __pyx_L1_error)
48287  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
48288  __Pyx_GOTREF(__pyx_t_2);
48289  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48290  } else
48291  #endif
48292  #if CYTHON_FAST_PYCCALL
48293  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
48294  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_duration};
48295  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2670, __pyx_L1_error)
48296  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
48297  __Pyx_GOTREF(__pyx_t_2);
48298  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48299  } else
48300  #endif
48301  {
48302  __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2670, __pyx_L1_error)
48303  __Pyx_GOTREF(__pyx_t_5);
48304  if (__pyx_t_6) {
48305  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
48306  }
48307  __Pyx_GIVEREF(__pyx_t_1);
48308  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_1);
48309  __Pyx_INCREF(__pyx_v_duration);
48310  __Pyx_GIVEREF(__pyx_v_duration);
48311  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_duration);
48312  __pyx_t_1 = 0;
48313  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2670, __pyx_L1_error)
48314  __Pyx_GOTREF(__pyx_t_2);
48315  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48316  }
48317  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48318  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cutoff, __pyx_t_2) < 0) __PYX_ERR(0, 2670, __pyx_L1_error)
48319  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48320 
48321  /* "WaveTools.py":2671
48322  * duration = (self.series[-1,0]-self.series[0,0])
48323  * self.cutoff = old_div(self.cutoff, duration)
48324  * Tm = old_div(self.Tp,1.1) # <<<<<<<<<<<<<<
48325  *
48326  * #Checking if there are enough windows
48327  */
48328  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_old_div); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2671, __pyx_L1_error)
48329  __Pyx_GOTREF(__pyx_t_7);
48330  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Tp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2671, __pyx_L1_error)
48331  __Pyx_GOTREF(__pyx_t_5);
48332  __pyx_t_1 = NULL;
48333  __pyx_t_8 = 0;
48334  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
48335  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
48336  if (likely(__pyx_t_1)) {
48337  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
48338  __Pyx_INCREF(__pyx_t_1);
48339  __Pyx_INCREF(function);
48340  __Pyx_DECREF_SET(__pyx_t_7, function);
48341  __pyx_t_8 = 1;
48342  }
48343  }
48344  #if CYTHON_FAST_PYCALL
48345  if (PyFunction_Check(__pyx_t_7)) {
48346  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_float_1_1};
48347  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error)
48348  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
48349  __Pyx_GOTREF(__pyx_t_2);
48350  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48351  } else
48352  #endif
48353  #if CYTHON_FAST_PYCCALL
48354  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
48355  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_float_1_1};
48356  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error)
48357  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
48358  __Pyx_GOTREF(__pyx_t_2);
48359  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48360  } else
48361  #endif
48362  {
48363  __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2671, __pyx_L1_error)
48364  __Pyx_GOTREF(__pyx_t_6);
48365  if (__pyx_t_1) {
48366  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
48367  }
48368  __Pyx_GIVEREF(__pyx_t_5);
48369  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_t_5);
48370  __Pyx_INCREF(__pyx_float_1_1);
48371  __Pyx_GIVEREF(__pyx_float_1_1);
48372  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_float_1_1);
48373  __pyx_t_5 = 0;
48374  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error)
48375  __Pyx_GOTREF(__pyx_t_2);
48376  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48377  }
48378  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48379  __pyx_v_Tm = __pyx_t_2;
48380  __pyx_t_2 = 0;
48381 
48382  /* "WaveTools.py":2674
48383  *
48384  * #Checking if there are enough windows
48385  * Nwaves_tot = round(old_div((self.series[-1,0]-self.series[0,0]),Tm)) # <<<<<<<<<<<<<<
48386  * Nwaves = min(Nwaves,Nwaves_tot)
48387  * self.Nwind = int(old_div(Nwaves_tot,Nwaves))
48388  */
48389  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_old_div); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2674, __pyx_L1_error)
48390  __Pyx_GOTREF(__pyx_t_7);
48391  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2674, __pyx_L1_error)
48392  __Pyx_GOTREF(__pyx_t_6);
48393  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_tuple__49); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2674, __pyx_L1_error)
48394  __Pyx_GOTREF(__pyx_t_5);
48395  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48396  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2674, __pyx_L1_error)
48397  __Pyx_GOTREF(__pyx_t_6);
48398  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_tuple__46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2674, __pyx_L1_error)
48399  __Pyx_GOTREF(__pyx_t_1);
48400  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48401  __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2674, __pyx_L1_error)
48402  __Pyx_GOTREF(__pyx_t_6);
48403  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48404  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48405  __pyx_t_1 = NULL;
48406  __pyx_t_8 = 0;
48407  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
48408  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
48409  if (likely(__pyx_t_1)) {
48410  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
48411  __Pyx_INCREF(__pyx_t_1);
48412  __Pyx_INCREF(function);
48413  __Pyx_DECREF_SET(__pyx_t_7, function);
48414  __pyx_t_8 = 1;
48415  }
48416  }
48417  #if CYTHON_FAST_PYCALL
48418  if (PyFunction_Check(__pyx_t_7)) {
48419  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_6, __pyx_v_Tm};
48420  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
48421  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
48422  __Pyx_GOTREF(__pyx_t_2);
48423  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48424  } else
48425  #endif
48426  #if CYTHON_FAST_PYCCALL
48427  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
48428  PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_6, __pyx_v_Tm};
48429  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
48430  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
48431  __Pyx_GOTREF(__pyx_t_2);
48432  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48433  } else
48434  #endif
48435  {
48436  __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2674, __pyx_L1_error)
48437  __Pyx_GOTREF(__pyx_t_5);
48438  if (__pyx_t_1) {
48439  __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
48440  }
48441  __Pyx_GIVEREF(__pyx_t_6);
48442  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_6);
48443  __Pyx_INCREF(__pyx_v_Tm);
48444  __Pyx_GIVEREF(__pyx_v_Tm);
48445  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_Tm);
48446  __pyx_t_6 = 0;
48447  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2674, __pyx_L1_error)
48448  __Pyx_GOTREF(__pyx_t_2);
48449  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48450  }
48451  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48452  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_round, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2674, __pyx_L1_error)
48453  __Pyx_GOTREF(__pyx_t_7);
48454  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48455  __pyx_v_Nwaves_tot = __pyx_t_7;
48456  __pyx_t_7 = 0;
48457 
48458  /* "WaveTools.py":2675
48459  * #Checking if there are enough windows
48460  * Nwaves_tot = round(old_div((self.series[-1,0]-self.series[0,0]),Tm))
48461  * Nwaves = min(Nwaves,Nwaves_tot) # <<<<<<<<<<<<<<
48462  * self.Nwind = int(old_div(Nwaves_tot,Nwaves))
48463  * self.rec_d = False
48464  */
48465  __Pyx_INCREF(__pyx_v_Nwaves_tot);
48466  __pyx_t_7 = __pyx_v_Nwaves_tot;
48467  __Pyx_INCREF(__pyx_v_Nwaves);
48468  __pyx_t_2 = __pyx_v_Nwaves;
48469  __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2675, __pyx_L1_error)
48470  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2675, __pyx_L1_error)
48471  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48472  if (__pyx_t_4) {
48473  __Pyx_INCREF(__pyx_t_7);
48474  __pyx_t_5 = __pyx_t_7;
48475  } else {
48476  __Pyx_INCREF(__pyx_t_2);
48477  __pyx_t_5 = __pyx_t_2;
48478  }
48479  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48480  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48481  __pyx_t_7 = __pyx_t_5;
48482  __Pyx_INCREF(__pyx_t_7);
48483  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48484  __Pyx_DECREF_SET(__pyx_v_Nwaves, __pyx_t_7);
48485  __pyx_t_7 = 0;
48486 
48487  /* "WaveTools.py":2676
48488  * Nwaves_tot = round(old_div((self.series[-1,0]-self.series[0,0]),Tm))
48489  * Nwaves = min(Nwaves,Nwaves_tot)
48490  * self.Nwind = int(old_div(Nwaves_tot,Nwaves)) # <<<<<<<<<<<<<<
48491  * self.rec_d = False
48492  * if self.Nwind < 3:
48493  */
48494  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_old_div); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2676, __pyx_L1_error)
48495  __Pyx_GOTREF(__pyx_t_5);
48496  __pyx_t_2 = NULL;
48497  __pyx_t_8 = 0;
48498  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
48499  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
48500  if (likely(__pyx_t_2)) {
48501  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
48502  __Pyx_INCREF(__pyx_t_2);
48503  __Pyx_INCREF(function);
48504  __Pyx_DECREF_SET(__pyx_t_5, function);
48505  __pyx_t_8 = 1;
48506  }
48507  }
48508  #if CYTHON_FAST_PYCALL
48509  if (PyFunction_Check(__pyx_t_5)) {
48510  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_Nwaves_tot, __pyx_v_Nwaves};
48511  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2676, __pyx_L1_error)
48512  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
48513  __Pyx_GOTREF(__pyx_t_7);
48514  } else
48515  #endif
48516  #if CYTHON_FAST_PYCCALL
48517  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
48518  PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_Nwaves_tot, __pyx_v_Nwaves};
48519  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2676, __pyx_L1_error)
48520  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
48521  __Pyx_GOTREF(__pyx_t_7);
48522  } else
48523  #endif
48524  {
48525  __pyx_t_6 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2676, __pyx_L1_error)
48526  __Pyx_GOTREF(__pyx_t_6);
48527  if (__pyx_t_2) {
48528  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
48529  }
48530  __Pyx_INCREF(__pyx_v_Nwaves_tot);
48531  __Pyx_GIVEREF(__pyx_v_Nwaves_tot);
48532  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_v_Nwaves_tot);
48533  __Pyx_INCREF(__pyx_v_Nwaves);
48534  __Pyx_GIVEREF(__pyx_v_Nwaves);
48535  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_Nwaves);
48536  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2676, __pyx_L1_error)
48537  __Pyx_GOTREF(__pyx_t_7);
48538  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48539  }
48540  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48541  __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2676, __pyx_L1_error)
48542  __Pyx_GOTREF(__pyx_t_5);
48543  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48544  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Nwind, __pyx_t_5) < 0) __PYX_ERR(0, 2676, __pyx_L1_error)
48545  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48546 
48547  /* "WaveTools.py":2677
48548  * Nwaves = min(Nwaves,Nwaves_tot)
48549  * self.Nwind = int(old_div(Nwaves_tot,Nwaves))
48550  * self.rec_d = False # <<<<<<<<<<<<<<
48551  * if self.Nwind < 3:
48552  * logEvent("ERROR!: WaveTools.py: Found too few windows in RandomWavesFast. Consider increasing Tend (this is independent from the duration of the simulation)")
48553  */
48554  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rec_d, Py_False) < 0) __PYX_ERR(0, 2677, __pyx_L1_error)
48555 
48556  /* "WaveTools.py":2678
48557  * self.Nwind = int(old_div(Nwaves_tot,Nwaves))
48558  * self.rec_d = False
48559  * if self.Nwind < 3: # <<<<<<<<<<<<<<
48560  * logEvent("ERROR!: WaveTools.py: Found too few windows in RandomWavesFast. Consider increasing Tend (this is independent from the duration of the simulation)")
48561  * sys.exit(1)
48562  */
48563  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Nwind); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2678, __pyx_L1_error)
48564  __Pyx_GOTREF(__pyx_t_5);
48565  __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2678, __pyx_L1_error)
48566  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48567  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2678, __pyx_L1_error)
48568  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48569  if (__pyx_t_4) {
48570 
48571  /* "WaveTools.py":2679
48572  * self.rec_d = False
48573  * if self.Nwind < 3:
48574  * logEvent("ERROR!: WaveTools.py: Found too few windows in RandomWavesFast. Consider increasing Tend (this is independent from the duration of the simulation)") # <<<<<<<<<<<<<<
48575  * sys.exit(1)
48576  *
48577  */
48578  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2679, __pyx_L1_error)
48579  __Pyx_GOTREF(__pyx_t_5);
48580  __pyx_t_6 = NULL;
48581  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
48582  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
48583  if (likely(__pyx_t_6)) {
48584  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
48585  __Pyx_INCREF(__pyx_t_6);
48586  __Pyx_INCREF(function);
48587  __Pyx_DECREF_SET(__pyx_t_5, function);
48588  }
48589  }
48590  __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_kp_s_ERROR_WaveTools_py_Found_too_few) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_ERROR_WaveTools_py_Found_too_few);
48591  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
48592  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2679, __pyx_L1_error)
48593  __Pyx_GOTREF(__pyx_t_7);
48594  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48595  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48596 
48597  /* "WaveTools.py":2680
48598  * if self.Nwind < 3:
48599  * logEvent("ERROR!: WaveTools.py: Found too few windows in RandomWavesFast. Consider increasing Tend (this is independent from the duration of the simulation)")
48600  * sys.exit(1) # <<<<<<<<<<<<<<
48601  *
48602  *
48603  */
48604  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2680, __pyx_L1_error)
48605  __Pyx_GOTREF(__pyx_t_5);
48606  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2680, __pyx_L1_error)
48607  __Pyx_GOTREF(__pyx_t_6);
48608  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48609  __pyx_t_5 = NULL;
48610  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
48611  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
48612  if (likely(__pyx_t_5)) {
48613  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
48614  __Pyx_INCREF(__pyx_t_5);
48615  __Pyx_INCREF(function);
48616  __Pyx_DECREF_SET(__pyx_t_6, function);
48617  }
48618  }
48619  __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_int_1);
48620  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
48621  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2680, __pyx_L1_error)
48622  __Pyx_GOTREF(__pyx_t_7);
48623  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48624  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48625 
48626  /* "WaveTools.py":2678
48627  * self.Nwind = int(old_div(Nwaves_tot,Nwaves))
48628  * self.rec_d = False
48629  * if self.Nwind < 3: # <<<<<<<<<<<<<<
48630  * logEvent("ERROR!: WaveTools.py: Found too few windows in RandomWavesFast. Consider increasing Tend (this is independent from the duration of the simulation)")
48631  * sys.exit(1)
48632  */
48633  }
48634 
48635  /* "WaveTools.py":2686
48636  *
48637  *
48638  * self.fast = fast # <<<<<<<<<<<<<<
48639  * TS = TimeSeries(
48640  * fname, # e.g.= "Timeseries.txt",
48641  */
48642  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fast, __pyx_v_fast) < 0) __PYX_ERR(0, 2686, __pyx_L1_error)
48643 
48644  /* "WaveTools.py":2691
48645  * 0,
48646  * x0,
48647  * self.depth , # <<<<<<<<<<<<<<
48648  * Nfreq , #number of frequency bins
48649  * self.mwl , #mean water level
48650  */
48651  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_depth); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2691, __pyx_L1_error)
48652  __Pyx_GOTREF(__pyx_t_7);
48653 
48654  /* "WaveTools.py":2693
48655  * self.depth ,
48656  * Nfreq , #number of frequency bins
48657  * self.mwl , #mean water level # <<<<<<<<<<<<<<
48658  * waveDir,
48659  * g,
48660  */
48661  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mwl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2693, __pyx_L1_error)
48662  __Pyx_GOTREF(__pyx_t_6);
48663 
48664  /* "WaveTools.py":2687
48665  *
48666  * self.fast = fast
48667  * TS = TimeSeries( # <<<<<<<<<<<<<<
48668  * fname, # e.g.= "Timeseries.txt",
48669  * 0,
48670  */
48671  __pyx_t_5 = PyTuple_New(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2687, __pyx_L1_error)
48672  __Pyx_GOTREF(__pyx_t_5);
48673  __Pyx_INCREF(__pyx_v_fname);
48674  __Pyx_GIVEREF(__pyx_v_fname);
48675  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fname);
48676  __Pyx_INCREF(__pyx_int_0);
48677  __Pyx_GIVEREF(__pyx_int_0);
48678  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
48679  __Pyx_INCREF(__pyx_v_x0);
48680  __Pyx_GIVEREF(__pyx_v_x0);
48681  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_x0);
48682  __Pyx_GIVEREF(__pyx_t_7);
48683  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_7);
48684  __Pyx_INCREF(__pyx_v_Nfreq);
48685  __Pyx_GIVEREF(__pyx_v_Nfreq);
48686  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_Nfreq);
48687  __Pyx_GIVEREF(__pyx_t_6);
48688  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_6);
48689  __Pyx_INCREF(__pyx_v_waveDir);
48690  __Pyx_GIVEREF(__pyx_v_waveDir);
48691  PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_waveDir);
48692  __Pyx_INCREF(__pyx_v_g);
48693  __Pyx_GIVEREF(__pyx_v_g);
48694  PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_v_g);
48695  __pyx_t_7 = 0;
48696  __pyx_t_6 = 0;
48697 
48698  /* "WaveTools.py":2696
48699  * waveDir,
48700  * g,
48701  * cutoffTotal = self.cutoff, # <<<<<<<<<<<<<<
48702  * rec_direct = self.rec_d,
48703  * window_params = {"Nwaves":Nwaves ,"Tm":Tm,"Window":"costap","Overlap":overl,"Cutoff":cutoff_win},
48704  */
48705  __pyx_t_6 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2696, __pyx_L1_error)
48706  __Pyx_GOTREF(__pyx_t_6);
48707  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2696, __pyx_L1_error)
48708  __Pyx_GOTREF(__pyx_t_7);
48709  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_cutoffTotal, __pyx_t_7) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48710  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48711 
48712  /* "WaveTools.py":2697
48713  * g,
48714  * cutoffTotal = self.cutoff,
48715  * rec_direct = self.rec_d, # <<<<<<<<<<<<<<
48716  * window_params = {"Nwaves":Nwaves ,"Tm":Tm,"Window":"costap","Overlap":overl,"Cutoff":cutoff_win},
48717  * arrayData = True,
48718  */
48719  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rec_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2697, __pyx_L1_error)
48720  __Pyx_GOTREF(__pyx_t_7);
48721  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_rec_direct, __pyx_t_7) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48722  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48723 
48724  /* "WaveTools.py":2698
48725  * cutoffTotal = self.cutoff,
48726  * rec_direct = self.rec_d,
48727  * window_params = {"Nwaves":Nwaves ,"Tm":Tm,"Window":"costap","Overlap":overl,"Cutoff":cutoff_win}, # <<<<<<<<<<<<<<
48728  * arrayData = True,
48729  * seriesArray = self.series,
48730  */
48731  __pyx_t_7 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2698, __pyx_L1_error)
48732  __Pyx_GOTREF(__pyx_t_7);
48733  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_Nwaves, __pyx_v_Nwaves) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
48734  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_Tm, __pyx_v_Tm) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
48735  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_Window, __pyx_n_s_costap) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
48736  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_overl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2698, __pyx_L1_error)
48737  __Pyx_GOTREF(__pyx_t_2);
48738  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_Overlap, __pyx_t_2) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
48739  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48740  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cutoff_win); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2698, __pyx_L1_error)
48741  __Pyx_GOTREF(__pyx_t_2);
48742  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_Cutoff, __pyx_t_2) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)
48743  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48744  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_window_params, __pyx_t_7) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48745  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48746 
48747  /* "WaveTools.py":2699
48748  * rec_direct = self.rec_d,
48749  * window_params = {"Nwaves":Nwaves ,"Tm":Tm,"Window":"costap","Overlap":overl,"Cutoff":cutoff_win},
48750  * arrayData = True, # <<<<<<<<<<<<<<
48751  * seriesArray = self.series,
48752  * Lgen = self.Lgen,
48753  */
48754  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_arrayData, Py_True) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48755 
48756  /* "WaveTools.py":2700
48757  * window_params = {"Nwaves":Nwaves ,"Tm":Tm,"Window":"costap","Overlap":overl,"Cutoff":cutoff_win},
48758  * arrayData = True,
48759  * seriesArray = self.series, # <<<<<<<<<<<<<<
48760  * Lgen = self.Lgen,
48761  * fast=self.fast
48762  */
48763  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2700, __pyx_L1_error)
48764  __Pyx_GOTREF(__pyx_t_7);
48765  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_seriesArray, __pyx_t_7) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48766  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48767 
48768  /* "WaveTools.py":2701
48769  * arrayData = True,
48770  * seriesArray = self.series,
48771  * Lgen = self.Lgen, # <<<<<<<<<<<<<<
48772  * fast=self.fast
48773  * )
48774  */
48775  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Lgen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2701, __pyx_L1_error)
48776  __Pyx_GOTREF(__pyx_t_7);
48777  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_Lgen, __pyx_t_7) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48778  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48779 
48780  /* "WaveTools.py":2702
48781  * seriesArray = self.series,
48782  * Lgen = self.Lgen,
48783  * fast=self.fast # <<<<<<<<<<<<<<
48784  * )
48785  *
48786  */
48787  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fast); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2702, __pyx_L1_error)
48788  __Pyx_GOTREF(__pyx_t_7);
48789  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fast, __pyx_t_7) < 0) __PYX_ERR(0, 2696, __pyx_L1_error)
48790  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48791 
48792  /* "WaveTools.py":2687
48793  *
48794  * self.fast = fast
48795  * TS = TimeSeries( # <<<<<<<<<<<<<<
48796  * fname, # e.g.= "Timeseries.txt",
48797  * 0,
48798  */
48799  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_TimeSeries), __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2687, __pyx_L1_error)
48800  __Pyx_GOTREF(__pyx_t_7);
48801  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48802  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48803  __pyx_v_TS = ((struct __pyx_obj_9WaveTools_TimeSeries *)__pyx_t_7);
48804  __pyx_t_7 = 0;
48805 
48806  /* "WaveTools.py":2705
48807  * )
48808  *
48809  * self.windows = TS.windows_rec # <<<<<<<<<<<<<<
48810  * self.ho = TS.windows_handover
48811  * #Checking accuracy of the approximation
48812  */
48813  __pyx_t_7 = __pyx_v_TS->windows_rec;
48814  __Pyx_INCREF(__pyx_t_7);
48815  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_windows, __pyx_t_7) < 0) __PYX_ERR(0, 2705, __pyx_L1_error)
48816  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48817 
48818  /* "WaveTools.py":2706
48819  *
48820  * self.windows = TS.windows_rec
48821  * self.ho = TS.windows_handover # <<<<<<<<<<<<<<
48822  * #Checking accuracy of the approximation
48823  * cut = 2.* self.cutoff * duration
48824  */
48825  __pyx_t_7 = __pyx_v_TS->windows_handover;
48826  __Pyx_INCREF(__pyx_t_7);
48827  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ho, __pyx_t_7) < 0) __PYX_ERR(0, 2706, __pyx_L1_error)
48828  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48829 
48830  /* "WaveTools.py":2708
48831  * self.ho = TS.windows_handover
48832  * #Checking accuracy of the approximation
48833  * cut = 2.* self.cutoff * duration # <<<<<<<<<<<<<<
48834  * ts = self.series[0,0]+cut
48835  * te = self.series[-1,0]-cut
48836  */
48837  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cutoff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2708, __pyx_L1_error)
48838  __Pyx_GOTREF(__pyx_t_7);
48839  __pyx_t_6 = PyNumber_Multiply(__pyx_float_2_, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2708, __pyx_L1_error)
48840  __Pyx_GOTREF(__pyx_t_6);
48841  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48842  __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_v_duration); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2708, __pyx_L1_error)
48843  __Pyx_GOTREF(__pyx_t_7);
48844  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48845  __pyx_v_cut = __pyx_t_7;
48846  __pyx_t_7 = 0;
48847 
48848  /* "WaveTools.py":2709
48849  * #Checking accuracy of the approximation
48850  * cut = 2.* self.cutoff * duration
48851  * ts = self.series[0,0]+cut # <<<<<<<<<<<<<<
48852  * te = self.series[-1,0]-cut
48853  * i1 = np.where(self.series[:,0]>ts)[0][0]
48854  */
48855  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2709, __pyx_L1_error)
48856  __Pyx_GOTREF(__pyx_t_7);
48857  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_tuple__46); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2709, __pyx_L1_error)
48858  __Pyx_GOTREF(__pyx_t_6);
48859  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48860  __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_cut); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2709, __pyx_L1_error)
48861  __Pyx_GOTREF(__pyx_t_7);
48862  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48863  __pyx_v_ts = __pyx_t_7;
48864  __pyx_t_7 = 0;
48865 
48866  /* "WaveTools.py":2710
48867  * cut = 2.* self.cutoff * duration
48868  * ts = self.series[0,0]+cut
48869  * te = self.series[-1,0]-cut # <<<<<<<<<<<<<<
48870  * i1 = np.where(self.series[:,0]>ts)[0][0]
48871  * i2 = np.where(self.series[:,0]<te)[0][-1]
48872  */
48873  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2710, __pyx_L1_error)
48874  __Pyx_GOTREF(__pyx_t_7);
48875  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_tuple__49); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2710, __pyx_L1_error)
48876  __Pyx_GOTREF(__pyx_t_6);
48877  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48878  __pyx_t_7 = PyNumber_Subtract(__pyx_t_6, __pyx_v_cut); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2710, __pyx_L1_error)
48879  __Pyx_GOTREF(__pyx_t_7);
48880  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48881  __pyx_v_te = __pyx_t_7;
48882  __pyx_t_7 = 0;
48883 
48884  /* "WaveTools.py":2711
48885  * ts = self.series[0,0]+cut
48886  * te = self.series[-1,0]-cut
48887  * i1 = np.where(self.series[:,0]>ts)[0][0] # <<<<<<<<<<<<<<
48888  * i2 = np.where(self.series[:,0]<te)[0][-1]
48889  * errors = np.zeros(len(self.series),)
48890  */
48891  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2711, __pyx_L1_error)
48892  __Pyx_GOTREF(__pyx_t_6);
48893  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_where); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2711, __pyx_L1_error)
48894  __Pyx_GOTREF(__pyx_t_5);
48895  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48896  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2711, __pyx_L1_error)
48897  __Pyx_GOTREF(__pyx_t_6);
48898  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_tuple__25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2711, __pyx_L1_error)
48899  __Pyx_GOTREF(__pyx_t_2);
48900  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48901  __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_ts, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2711, __pyx_L1_error)
48902  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48903  __pyx_t_2 = NULL;
48904  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
48905  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
48906  if (likely(__pyx_t_2)) {
48907  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
48908  __Pyx_INCREF(__pyx_t_2);
48909  __Pyx_INCREF(function);
48910  __Pyx_DECREF_SET(__pyx_t_5, function);
48911  }
48912  }
48913  __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
48914  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
48915  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48916  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2711, __pyx_L1_error)
48917  __Pyx_GOTREF(__pyx_t_7);
48918  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48919  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2711, __pyx_L1_error)
48920  __Pyx_GOTREF(__pyx_t_5);
48921  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48922  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2711, __pyx_L1_error)
48923  __Pyx_GOTREF(__pyx_t_7);
48924  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48925  __pyx_v_i1 = __pyx_t_7;
48926  __pyx_t_7 = 0;
48927 
48928  /* "WaveTools.py":2712
48929  * te = self.series[-1,0]-cut
48930  * i1 = np.where(self.series[:,0]>ts)[0][0]
48931  * i2 = np.where(self.series[:,0]<te)[0][-1] # <<<<<<<<<<<<<<
48932  * errors = np.zeros(len(self.series),)
48933  * for ii in range(i1,i2):
48934  */
48935  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2712, __pyx_L1_error)
48936  __Pyx_GOTREF(__pyx_t_5);
48937  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_where); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2712, __pyx_L1_error)
48938  __Pyx_GOTREF(__pyx_t_6);
48939  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48940  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2712, __pyx_L1_error)
48941  __Pyx_GOTREF(__pyx_t_5);
48942  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_tuple__25); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2712, __pyx_L1_error)
48943  __Pyx_GOTREF(__pyx_t_2);
48944  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48945  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_v_te, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2712, __pyx_L1_error)
48946  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48947  __pyx_t_2 = NULL;
48948  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
48949  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
48950  if (likely(__pyx_t_2)) {
48951  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
48952  __Pyx_INCREF(__pyx_t_2);
48953  __Pyx_INCREF(function);
48954  __Pyx_DECREF_SET(__pyx_t_6, function);
48955  }
48956  }
48957  __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5);
48958  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
48959  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48960  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2712, __pyx_L1_error)
48961  __Pyx_GOTREF(__pyx_t_7);
48962  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48963  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2712, __pyx_L1_error)
48964  __Pyx_GOTREF(__pyx_t_6);
48965  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
48966  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2712, __pyx_L1_error)
48967  __Pyx_GOTREF(__pyx_t_7);
48968  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48969  __pyx_v_i2 = __pyx_t_7;
48970  __pyx_t_7 = 0;
48971 
48972  /* "WaveTools.py":2713
48973  * i1 = np.where(self.series[:,0]>ts)[0][0]
48974  * i2 = np.where(self.series[:,0]<te)[0][-1]
48975  * errors = np.zeros(len(self.series),) # <<<<<<<<<<<<<<
48976  * for ii in range(i1,i2):
48977  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) )
48978  */
48979  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2713, __pyx_L1_error)
48980  __Pyx_GOTREF(__pyx_t_6);
48981  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2713, __pyx_L1_error)
48982  __Pyx_GOTREF(__pyx_t_5);
48983  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48984  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2713, __pyx_L1_error)
48985  __Pyx_GOTREF(__pyx_t_6);
48986  __pyx_t_9 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2713, __pyx_L1_error)
48987  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
48988  __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2713, __pyx_L1_error)
48989  __Pyx_GOTREF(__pyx_t_6);
48990  __pyx_t_2 = NULL;
48991  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
48992  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
48993  if (likely(__pyx_t_2)) {
48994  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
48995  __Pyx_INCREF(__pyx_t_2);
48996  __Pyx_INCREF(function);
48997  __Pyx_DECREF_SET(__pyx_t_5, function);
48998  }
48999  }
49000  __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
49001  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
49002  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49003  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2713, __pyx_L1_error)
49004  __Pyx_GOTREF(__pyx_t_7);
49005  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49006  __pyx_v_errors = __pyx_t_7;
49007  __pyx_t_7 = 0;
49008 
49009  /* "WaveTools.py":2714
49010  * i2 = np.where(self.series[:,0]<te)[0][-1]
49011  * errors = np.zeros(len(self.series),)
49012  * for ii in range(i1,i2): # <<<<<<<<<<<<<<
49013  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) )
49014  * self.er1 = old_div(max(errors[:]),self.Hs)
49015  */
49016  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_range); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2714, __pyx_L1_error)
49017  __Pyx_GOTREF(__pyx_t_5);
49018  __pyx_t_6 = NULL;
49019  __pyx_t_8 = 0;
49020  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
49021  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
49022  if (likely(__pyx_t_6)) {
49023  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
49024  __Pyx_INCREF(__pyx_t_6);
49025  __Pyx_INCREF(function);
49026  __Pyx_DECREF_SET(__pyx_t_5, function);
49027  __pyx_t_8 = 1;
49028  }
49029  }
49030  #if CYTHON_FAST_PYCALL
49031  if (PyFunction_Check(__pyx_t_5)) {
49032  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_i1, __pyx_v_i2};
49033  __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2714, __pyx_L1_error)
49034  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
49035  __Pyx_GOTREF(__pyx_t_7);
49036  } else
49037  #endif
49038  #if CYTHON_FAST_PYCCALL
49039  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
49040  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_i1, __pyx_v_i2};
49041  __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2714, __pyx_L1_error)
49042  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
49043  __Pyx_GOTREF(__pyx_t_7);
49044  } else
49045  #endif
49046  {
49047  __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __pyx_L1_error)
49048  __Pyx_GOTREF(__pyx_t_2);
49049  if (__pyx_t_6) {
49050  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL;
49051  }
49052  __Pyx_INCREF(__pyx_v_i1);
49053  __Pyx_GIVEREF(__pyx_v_i1);
49054  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_v_i1);
49055  __Pyx_INCREF(__pyx_v_i2);
49056  __Pyx_GIVEREF(__pyx_v_i2);
49057  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_v_i2);
49058  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2714, __pyx_L1_error)
49059  __Pyx_GOTREF(__pyx_t_7);
49060  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49061  }
49062  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49063  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
49064  __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); __pyx_t_9 = 0;
49065  __pyx_t_10 = NULL;
49066  } else {
49067  __pyx_t_9 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2714, __pyx_L1_error)
49068  __Pyx_GOTREF(__pyx_t_5);
49069  __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2714, __pyx_L1_error)
49070  }
49071  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
49072  for (;;) {
49073  if (likely(!__pyx_t_10)) {
49074  if (likely(PyList_CheckExact(__pyx_t_5))) {
49075  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_5)) break;
49076  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
49077  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2714, __pyx_L1_error)
49078  #else
49079  __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2714, __pyx_L1_error)
49080  __Pyx_GOTREF(__pyx_t_7);
49081  #endif
49082  } else {
49083  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
49084  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
49085  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2714, __pyx_L1_error)
49086  #else
49087  __pyx_t_7 = PySequence_ITEM(__pyx_t_5, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2714, __pyx_L1_error)
49088  __Pyx_GOTREF(__pyx_t_7);
49089  #endif
49090  }
49091  } else {
49092  __pyx_t_7 = __pyx_t_10(__pyx_t_5);
49093  if (unlikely(!__pyx_t_7)) {
49094  PyObject* exc_type = PyErr_Occurred();
49095  if (exc_type) {
49096  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
49097  else __PYX_ERR(0, 2714, __pyx_L1_error)
49098  }
49099  break;
49100  }
49101  __Pyx_GOTREF(__pyx_t_7);
49102  }
49103  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_7);
49104  __pyx_t_7 = 0;
49105 
49106  /* "WaveTools.py":2715
49107  * errors = np.zeros(len(self.series),)
49108  * for ii in range(i1,i2):
49109  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) ) # <<<<<<<<<<<<<<
49110  * self.er1 = old_div(max(errors[:]),self.Hs)
49111  * if self.er1 > 0.01 and checkAcc:
49112  */
49113  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2715, __pyx_L1_error)
49114  __Pyx_GOTREF(__pyx_t_7);
49115  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error)
49116  __Pyx_GOTREF(__pyx_t_2);
49117  __Pyx_INCREF(__pyx_v_ii);
49118  __Pyx_GIVEREF(__pyx_v_ii);
49119  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ii);
49120  __Pyx_INCREF(__pyx_int_1);
49121  __Pyx_GIVEREF(__pyx_int_1);
49122  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
49123  __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2715, __pyx_L1_error)
49124  __Pyx_GOTREF(__pyx_t_6);
49125  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
49126  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49127  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2715, __pyx_L1_error)
49128  __Pyx_GOTREF(__pyx_t_7);
49129  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2715, __pyx_L1_error)
49130  __Pyx_GOTREF(__pyx_t_1);
49131  __Pyx_INCREF(__pyx_v_ii);
49132  __Pyx_GIVEREF(__pyx_v_ii);
49133  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ii);
49134  __Pyx_INCREF(__pyx_int_0);
49135  __Pyx_GIVEREF(__pyx_int_0);
49136  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
49137  __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2715, __pyx_L1_error)
49138  __Pyx_GOTREF(__pyx_t_11);
49139  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
49140  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49141  __Pyx_INCREF(__pyx_v_TS->eta);
49142  __pyx_t_1 = __pyx_v_TS->eta; __pyx_t_7 = NULL;
49143  __pyx_t_8 = 0;
49144  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
49145  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
49146  if (likely(__pyx_t_7)) {
49147  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
49148  __Pyx_INCREF(__pyx_t_7);
49149  __Pyx_INCREF(function);
49150  __Pyx_DECREF_SET(__pyx_t_1, function);
49151  __pyx_t_8 = 1;
49152  }
49153  }
49154  #if CYTHON_FAST_PYCALL
49155  if (PyFunction_Check(__pyx_t_1)) {
49156  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_x0, __pyx_t_11};
49157  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error)
49158  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
49159  __Pyx_GOTREF(__pyx_t_2);
49160  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49161  } else
49162  #endif
49163  #if CYTHON_FAST_PYCCALL
49164  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
49165  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_x0, __pyx_t_11};
49166  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error)
49167  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
49168  __Pyx_GOTREF(__pyx_t_2);
49169  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49170  } else
49171  #endif
49172  {
49173  __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2715, __pyx_L1_error)
49174  __Pyx_GOTREF(__pyx_t_12);
49175  if (__pyx_t_7) {
49176  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
49177  }
49178  __Pyx_INCREF(__pyx_v_x0);
49179  __Pyx_GIVEREF(__pyx_v_x0);
49180  PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_x0);
49181  __Pyx_GIVEREF(__pyx_t_11);
49182  PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_t_11);
49183  __pyx_t_11 = 0;
49184  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error)
49185  __Pyx_GOTREF(__pyx_t_2);
49186  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
49187  }
49188  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49189  __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2715, __pyx_L1_error)
49190  __Pyx_GOTREF(__pyx_t_1);
49191  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49192  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49193  __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2715, __pyx_L1_error)
49194  __Pyx_GOTREF(__pyx_t_2);
49195  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49196  if (unlikely(PyObject_SetItem(__pyx_v_errors, __pyx_v_ii, __pyx_t_2) < 0)) __PYX_ERR(0, 2715, __pyx_L1_error)
49197  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49198 
49199  /* "WaveTools.py":2714
49200  * i2 = np.where(self.series[:,0]<te)[0][-1]
49201  * errors = np.zeros(len(self.series),)
49202  * for ii in range(i1,i2): # <<<<<<<<<<<<<<
49203  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) )
49204  * self.er1 = old_div(max(errors[:]),self.Hs)
49205  */
49206  }
49207  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49208 
49209  /* "WaveTools.py":2716
49210  * for ii in range(i1,i2):
49211  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) )
49212  * self.er1 = old_div(max(errors[:]),self.Hs) # <<<<<<<<<<<<<<
49213  * if self.er1 > 0.01 and checkAcc:
49214  * logEvent('ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors',level=0)
49215  */
49216  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error)
49217  __Pyx_GOTREF(__pyx_t_2);
49218  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_errors, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error)
49219  __Pyx_GOTREF(__pyx_t_1);
49220  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2716, __pyx_L1_error)
49221  __Pyx_GOTREF(__pyx_t_6);
49222  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49223  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Hs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error)
49224  __Pyx_GOTREF(__pyx_t_1);
49225  __pyx_t_12 = NULL;
49226  __pyx_t_8 = 0;
49227  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
49228  __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
49229  if (likely(__pyx_t_12)) {
49230  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
49231  __Pyx_INCREF(__pyx_t_12);
49232  __Pyx_INCREF(function);
49233  __Pyx_DECREF_SET(__pyx_t_2, function);
49234  __pyx_t_8 = 1;
49235  }
49236  }
49237  #if CYTHON_FAST_PYCALL
49238  if (PyFunction_Check(__pyx_t_2)) {
49239  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_6, __pyx_t_1};
49240  __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2716, __pyx_L1_error)
49241  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
49242  __Pyx_GOTREF(__pyx_t_5);
49243  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49244  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49245  } else
49246  #endif
49247  #if CYTHON_FAST_PYCCALL
49248  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
49249  PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_6, __pyx_t_1};
49250  __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2716, __pyx_L1_error)
49251  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
49252  __Pyx_GOTREF(__pyx_t_5);
49253  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
49254  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49255  } else
49256  #endif
49257  {
49258  __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2716, __pyx_L1_error)
49259  __Pyx_GOTREF(__pyx_t_11);
49260  if (__pyx_t_12) {
49261  __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); __pyx_t_12 = NULL;
49262  }
49263  __Pyx_GIVEREF(__pyx_t_6);
49264  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_6);
49265  __Pyx_GIVEREF(__pyx_t_1);
49266  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_1);
49267  __pyx_t_6 = 0;
49268  __pyx_t_1 = 0;
49269  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2716, __pyx_L1_error)
49270  __Pyx_GOTREF(__pyx_t_5);
49271  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49272  }
49273  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49274  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_er1, __pyx_t_5) < 0) __PYX_ERR(0, 2716, __pyx_L1_error)
49275  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49276 
49277  /* "WaveTools.py":2717
49278  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) )
49279  * self.er1 = old_div(max(errors[:]),self.Hs)
49280  * if self.er1 > 0.01 and checkAcc: # <<<<<<<<<<<<<<
49281  * logEvent('ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors',level=0)
49282  * sys.exit(1)
49283  */
49284  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_er1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2717, __pyx_L1_error)
49285  __Pyx_GOTREF(__pyx_t_5);
49286  __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_float_0_01, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error)
49287  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49288  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2717, __pyx_L1_error)
49289  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49290  if (__pyx_t_3) {
49291  } else {
49292  __pyx_t_4 = __pyx_t_3;
49293  goto __pyx_L8_bool_binop_done;
49294  }
49295  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_checkAcc); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2717, __pyx_L1_error)
49296  __pyx_t_4 = __pyx_t_3;
49297  __pyx_L8_bool_binop_done:;
49298  if (__pyx_t_4) {
49299 
49300  /* "WaveTools.py":2718
49301  * self.er1 = old_div(max(errors[:]),self.Hs)
49302  * if self.er1 > 0.01 and checkAcc:
49303  * logEvent('ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors',level=0) # <<<<<<<<<<<<<<
49304  * sys.exit(1)
49305  *
49306  */
49307  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2718, __pyx_L1_error)
49308  __Pyx_GOTREF(__pyx_t_2);
49309  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2718, __pyx_L1_error)
49310  __Pyx_GOTREF(__pyx_t_5);
49311  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_level, __pyx_int_0) < 0) __PYX_ERR(0, 2718, __pyx_L1_error)
49312  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__50, __pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2718, __pyx_L1_error)
49313  __Pyx_GOTREF(__pyx_t_11);
49314  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49315  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49316  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49317 
49318  /* "WaveTools.py":2719
49319  * if self.er1 > 0.01 and checkAcc:
49320  * logEvent('ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors',level=0)
49321  * sys.exit(1) # <<<<<<<<<<<<<<
49322  *
49323  * self.eta = TS.eta
49324  */
49325  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2719, __pyx_L1_error)
49326  __Pyx_GOTREF(__pyx_t_5);
49327  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2719, __pyx_L1_error)
49328  __Pyx_GOTREF(__pyx_t_2);
49329  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
49330  __pyx_t_5 = NULL;
49331  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
49332  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
49333  if (likely(__pyx_t_5)) {
49334  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
49335  __Pyx_INCREF(__pyx_t_5);
49336  __Pyx_INCREF(function);
49337  __Pyx_DECREF_SET(__pyx_t_2, function);
49338  }
49339  }
49340  __pyx_t_11 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_1);
49341  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
49342  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2719, __pyx_L1_error)
49343  __Pyx_GOTREF(__pyx_t_11);
49344  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49345  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49346 
49347  /* "WaveTools.py":2717
49348  * errors[ii] = abs(self.series[ii,1]-TS.eta(x0,self.series[ii,0]) )
49349  * self.er1 = old_div(max(errors[:]),self.Hs)
49350  * if self.er1 > 0.01 and checkAcc: # <<<<<<<<<<<<<<
49351  * logEvent('ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors',level=0)
49352  * sys.exit(1)
49353  */
49354  }
49355 
49356  /* "WaveTools.py":2721
49357  * sys.exit(1)
49358  *
49359  * self.eta = TS.eta # <<<<<<<<<<<<<<
49360  * self.u = TS.u
49361  * self.windOut = TS.windOut
49362  */
49363  __pyx_t_11 = __pyx_v_TS->eta;
49364  __Pyx_INCREF(__pyx_t_11);
49365  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_eta, __pyx_t_11) < 0) __PYX_ERR(0, 2721, __pyx_L1_error)
49366  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49367 
49368  /* "WaveTools.py":2722
49369  *
49370  * self.eta = TS.eta
49371  * self.u = TS.u # <<<<<<<<<<<<<<
49372  * self.windOut = TS.windOut
49373  *
49374  */
49375  __pyx_t_11 = __pyx_v_TS->u;
49376  __Pyx_INCREF(__pyx_t_11);
49377  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_u, __pyx_t_11) < 0) __PYX_ERR(0, 2722, __pyx_L1_error)
49378  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49379 
49380  /* "WaveTools.py":2723
49381  * self.eta = TS.eta
49382  * self.u = TS.u
49383  * self.windOut = TS.windOut # <<<<<<<<<<<<<<
49384  *
49385  * def printOut(self):
49386  */
49387  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_TS), __pyx_n_s_windOut); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2723, __pyx_L1_error)
49388  __Pyx_GOTREF(__pyx_t_11);
49389  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_windOut, __pyx_t_11) < 0) __PYX_ERR(0, 2723, __pyx_L1_error)
49390  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
49391 
49392  /* "WaveTools.py":2622
49393  * """
49394  *
49395  * def __init__(self, # <<<<<<<<<<<<<<
49396  * Tstart,
49397  * Tend,
49398  */
49399 
49400  /* function exit code */
49401  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49402  goto __pyx_L0;
49403  __pyx_L1_error:;
49404  __Pyx_XDECREF(__pyx_t_1);
49405  __Pyx_XDECREF(__pyx_t_2);
49406  __Pyx_XDECREF(__pyx_t_5);
49407  __Pyx_XDECREF(__pyx_t_6);
49408  __Pyx_XDECREF(__pyx_t_7);
49409  __Pyx_XDECREF(__pyx_t_11);
49410  __Pyx_XDECREF(__pyx_t_12);
49411  __Pyx_AddTraceback("WaveTools.RandomWavesFast.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
49412  __pyx_r = NULL;
49413  __pyx_L0:;
49414  __Pyx_XDECREF((PyObject *)__pyx_v_RW);
49415  __Pyx_XDECREF(__pyx_v_fname);
49416  __Pyx_XDECREF(__pyx_v_duration);
49417  __Pyx_XDECREF(__pyx_v_Tm);
49418  __Pyx_XDECREF(__pyx_v_Nwaves_tot);
49419  __Pyx_XDECREF((PyObject *)__pyx_v_TS);
49420  __Pyx_XDECREF(__pyx_v_cut);
49421  __Pyx_XDECREF(__pyx_v_ts);
49422  __Pyx_XDECREF(__pyx_v_te);
49423  __Pyx_XDECREF(__pyx_v_i1);
49424  __Pyx_XDECREF(__pyx_v_i2);
49425  __Pyx_XDECREF(__pyx_v_errors);
49426  __Pyx_XDECREF(__pyx_v_ii);
49427  __Pyx_XDECREF(__pyx_v_Nwaves);
49428  __Pyx_XGIVEREF(__pyx_r);
49429  __Pyx_RefNannyFinishContext();
49430  return __pyx_r;
49431 }
49432 
49433 /* "WaveTools.py":2725
49434  * self.windOut = TS.windOut
49435  *
49436  * def printOut(self): # <<<<<<<<<<<<<<
49437  * """Prints some properties of the time series - ONLY FOR TESTING
49438  *
49439  */
49440 
49441 /* Python wrapper */
49442 static PyObject *__pyx_pw_9WaveTools_15RandomWavesFast_3printOut(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
49443 static char __pyx_doc_9WaveTools_15RandomWavesFast_2printOut[] = "Prints some properties of the time series - ONLY FOR TESTING\n\n\n ";
49444 static PyMethodDef __pyx_mdef_9WaveTools_15RandomWavesFast_3printOut = {"printOut", (PyCFunction)__pyx_pw_9WaveTools_15RandomWavesFast_3printOut, METH_O, __pyx_doc_9WaveTools_15RandomWavesFast_2printOut};
49445 static PyObject *__pyx_pw_9WaveTools_15RandomWavesFast_3printOut(PyObject *__pyx_self, PyObject *__pyx_v_self) {
49446  PyObject *__pyx_r = 0;
49447  __Pyx_RefNannyDeclarations
49448  __Pyx_RefNannySetupContext("printOut (wrapper)", 0);
49449  __pyx_r = __pyx_pf_9WaveTools_15RandomWavesFast_2printOut(__pyx_self, ((PyObject *)__pyx_v_self));
49450 
49451  /* function exit code */
49452  __Pyx_RefNannyFinishContext();
49453  return __pyx_r;
49454 }
49455 
49456 static PyObject *__pyx_pf_9WaveTools_15RandomWavesFast_2printOut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
49457  PyObject *__pyx_r = NULL;
49458  __Pyx_RefNannyDeclarations
49459  PyObject *__pyx_t_1 = NULL;
49460  PyObject *__pyx_t_2 = NULL;
49461  __Pyx_RefNannySetupContext("printOut", 0);
49462 
49463  /* "WaveTools.py":2730
49464  *
49465  * """
49466  * print("Number of windows=",self.Nwind) # <<<<<<<<<<<<<<
49467  * print("Direct reconstruction? ",self.rec_d)
49468  * print("Start Time =", self.series[0,0])
49469  */
49470  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Nwind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error)
49471  __Pyx_GOTREF(__pyx_t_1);
49472  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error)
49473  __Pyx_GOTREF(__pyx_t_2);
49474  __Pyx_INCREF(__pyx_kp_s_Number_of_windows);
49475  __Pyx_GIVEREF(__pyx_kp_s_Number_of_windows);
49476  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Number_of_windows);
49477  __Pyx_GIVEREF(__pyx_t_1);
49478  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
49479  __pyx_t_1 = 0;
49480  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error)
49481  __Pyx_GOTREF(__pyx_t_1);
49482  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49483  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49484 
49485  /* "WaveTools.py":2731
49486  * """
49487  * print("Number of windows=",self.Nwind)
49488  * print("Direct reconstruction? ",self.rec_d) # <<<<<<<<<<<<<<
49489  * print("Start Time =", self.series[0,0])
49490  * print("End time= ",self.series[-1,0])
49491  */
49492  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rec_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
49493  __Pyx_GOTREF(__pyx_t_1);
49494  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error)
49495  __Pyx_GOTREF(__pyx_t_2);
49496  __Pyx_INCREF(__pyx_kp_s_Direct_reconstruction);
49497  __Pyx_GIVEREF(__pyx_kp_s_Direct_reconstruction);
49498  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Direct_reconstruction);
49499  __Pyx_GIVEREF(__pyx_t_1);
49500  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
49501  __pyx_t_1 = 0;
49502  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error)
49503  __Pyx_GOTREF(__pyx_t_1);
49504  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49505  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49506 
49507  /* "WaveTools.py":2732
49508  * print("Number of windows=",self.Nwind)
49509  * print("Direct reconstruction? ",self.rec_d)
49510  * print("Start Time =", self.series[0,0]) # <<<<<<<<<<<<<<
49511  * print("End time= ",self.series[-1,0])
49512  * print("Cutoff=", self.cutoff)
49513  */
49514  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2732, __pyx_L1_error)
49515  __Pyx_GOTREF(__pyx_t_1);
49516  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_tuple__46); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2732, __pyx_L1_error)
49517  __Pyx_GOTREF(__pyx_t_2);
49518  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49519  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2732, __pyx_L1_error)
49520  __Pyx_GOTREF(__pyx_t_1);
49521  __Pyx_INCREF(__pyx_kp_s_Start_Time);
49522  __Pyx_GIVEREF(__pyx_kp_s_Start_Time);
49523  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Start_Time);
49524  __Pyx_GIVEREF(__pyx_t_2);
49525  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
49526  __pyx_t_2 = 0;
49527  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2732, __pyx_L1_error)
49528  __Pyx_GOTREF(__pyx_t_2);
49529  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49530  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49531 
49532  /* "WaveTools.py":2733
49533  * print("Direct reconstruction? ",self.rec_d)
49534  * print("Start Time =", self.series[0,0])
49535  * print("End time= ",self.series[-1,0]) # <<<<<<<<<<<<<<
49536  * print("Cutoff=", self.cutoff)
49537  * print("Er1 =", self.er1)
49538  */
49539  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
49540  __Pyx_GOTREF(__pyx_t_2);
49541  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_tuple__49); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2733, __pyx_L1_error)
49542  __Pyx_GOTREF(__pyx_t_1);
49543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49544  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
49545  __Pyx_GOTREF(__pyx_t_2);
49546  __Pyx_INCREF(__pyx_kp_s_End_time);
49547  __Pyx_GIVEREF(__pyx_kp_s_End_time);
49548  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_End_time);
49549  __Pyx_GIVEREF(__pyx_t_1);
49550  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
49551  __pyx_t_1 = 0;
49552  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2733, __pyx_L1_error)
49553  __Pyx_GOTREF(__pyx_t_1);
49554  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49555  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49556 
49557  /* "WaveTools.py":2734
49558  * print("Start Time =", self.series[0,0])
49559  * print("End time= ",self.series[-1,0])
49560  * print("Cutoff=", self.cutoff) # <<<<<<<<<<<<<<
49561  * print("Er1 =", self.er1)
49562  *
49563  */
49564  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cutoff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error)
49565  __Pyx_GOTREF(__pyx_t_1);
49566  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error)
49567  __Pyx_GOTREF(__pyx_t_2);
49568  __Pyx_INCREF(__pyx_kp_s_Cutoff_2);
49569  __Pyx_GIVEREF(__pyx_kp_s_Cutoff_2);
49570  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Cutoff_2);
49571  __Pyx_GIVEREF(__pyx_t_1);
49572  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
49573  __pyx_t_1 = 0;
49574  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error)
49575  __Pyx_GOTREF(__pyx_t_1);
49576  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49577  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49578 
49579  /* "WaveTools.py":2735
49580  * print("End time= ",self.series[-1,0])
49581  * print("Cutoff=", self.cutoff)
49582  * print("Er1 =", self.er1) # <<<<<<<<<<<<<<
49583  *
49584  *
49585  */
49586  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_er1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __pyx_L1_error)
49587  __Pyx_GOTREF(__pyx_t_1);
49588  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
49589  __Pyx_GOTREF(__pyx_t_2);
49590  __Pyx_INCREF(__pyx_kp_s_Er1);
49591  __Pyx_GIVEREF(__pyx_kp_s_Er1);
49592  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_Er1);
49593  __Pyx_GIVEREF(__pyx_t_1);
49594  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
49595  __pyx_t_1 = 0;
49596  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __pyx_L1_error)
49597  __Pyx_GOTREF(__pyx_t_1);
49598  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49599  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
49600 
49601  /* "WaveTools.py":2725
49602  * self.windOut = TS.windOut
49603  *
49604  * def printOut(self): # <<<<<<<<<<<<<<
49605  * """Prints some properties of the time series - ONLY FOR TESTING
49606  *
49607  */
49608 
49609  /* function exit code */
49610  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49611  goto __pyx_L0;
49612  __pyx_L1_error:;
49613  __Pyx_XDECREF(__pyx_t_1);
49614  __Pyx_XDECREF(__pyx_t_2);
49615  __Pyx_AddTraceback("WaveTools.RandomWavesFast.printOut", __pyx_clineno, __pyx_lineno, __pyx_filename);
49616  __pyx_r = NULL;
49617  __pyx_L0:;
49618  __Pyx_XGIVEREF(__pyx_r);
49619  __Pyx_RefNannyFinishContext();
49620  return __pyx_r;
49621 }
49622 
49623 /* "WaveTools.py":2776
49624  * Switch for enabling optimised functions
49625  * """
49626  * def __init__(self, # <<<<<<<<<<<<<<
49627  * Tstart,
49628  * Tend,
49629  */
49630 
49631 /* Python wrapper */
49632 static int __pyx_pw_9WaveTools_13RandomNLWaves_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
49633 static int __pyx_pw_9WaveTools_13RandomNLWaves_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
49634  CYTHON_UNUSED PyObject *__pyx_v_Tstart = 0;
49635  CYTHON_UNUSED PyObject *__pyx_v_Tend = 0;
49636  PyObject *__pyx_v_Tp = 0;
49637  PyObject *__pyx_v_Hs = 0;
49638  PyObject *__pyx_v_mwl = 0;
49639  PyObject *__pyx_v_depth = 0;
49640  PyObject *__pyx_v_waveDir = 0;
49641  PyObject *__pyx_v_g = 0;
49642  PyObject *__pyx_v_N = 0;
49643  PyObject *__pyx_v_bandFactor = 0;
49644  PyObject *__pyx_v_spectName = 0;
49645  PyObject *__pyx_v_spectral_params = 0;
49646  PyObject *__pyx_v_phi = 0;
49647  PyObject *__pyx_v_fast = 0;
49648  int __pyx_r;
49649  __Pyx_RefNannyDeclarations
49650  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
49651  {
49652  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Tstart,&__pyx_n_s_Tend,&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spectral_params,&__pyx_n_s_phi,&__pyx_n_s_fast,0};
49653  PyObject* values[14] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0};
49654 
49655  /* "WaveTools.py":2788
49656  * bandFactor, #width factor for band around peak frequency fp
49657  * spectName, #random words will result in error and return the available spectra
49658  * spectral_params=None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth} # <<<<<<<<<<<<<<
49659  * phi=None, #array of component phases
49660  * fast = True ):
49661  */
49662  values[11] = ((PyObject *)Py_None);
49663 
49664  /* "WaveTools.py":2789
49665  * spectName, #random words will result in error and return the available spectra
49666  * spectral_params=None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
49667  * phi=None, #array of component phases # <<<<<<<<<<<<<<
49668  * fast = True ):
49669  * self.fast= fast
49670  */
49671  values[12] = ((PyObject *)Py_None);
49672 
49673  /* "WaveTools.py":2790
49674  * spectral_params=None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
49675  * phi=None, #array of component phases
49676  * fast = True ): # <<<<<<<<<<<<<<
49677  * self.fast= fast
49678  * RW = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast )
49679  */
49680  values[13] = ((PyObject *)Py_True);
49681  if (unlikely(__pyx_kwds)) {
49682  Py_ssize_t kw_args;
49683  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
49684  switch (pos_args) {
49685  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
49686  CYTHON_FALLTHROUGH;
49687  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
49688  CYTHON_FALLTHROUGH;
49689  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
49690  CYTHON_FALLTHROUGH;
49691  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
49692  CYTHON_FALLTHROUGH;
49693  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
49694  CYTHON_FALLTHROUGH;
49695  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
49696  CYTHON_FALLTHROUGH;
49697  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
49698  CYTHON_FALLTHROUGH;
49699  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
49700  CYTHON_FALLTHROUGH;
49701  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
49702  CYTHON_FALLTHROUGH;
49703  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
49704  CYTHON_FALLTHROUGH;
49705  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
49706  CYTHON_FALLTHROUGH;
49707  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
49708  CYTHON_FALLTHROUGH;
49709  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
49710  CYTHON_FALLTHROUGH;
49711  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
49712  CYTHON_FALLTHROUGH;
49713  case 0: break;
49714  default: goto __pyx_L5_argtuple_error;
49715  }
49716  kw_args = PyDict_Size(__pyx_kwds);
49717  switch (pos_args) {
49718  case 0:
49719  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tstart)) != 0)) kw_args--;
49720  else goto __pyx_L5_argtuple_error;
49721  CYTHON_FALLTHROUGH;
49722  case 1:
49723  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tend)) != 0)) kw_args--;
49724  else {
49725  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 1); __PYX_ERR(0, 2776, __pyx_L3_error)
49726  }
49727  CYTHON_FALLTHROUGH;
49728  case 2:
49729  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
49730  else {
49731  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 2); __PYX_ERR(0, 2776, __pyx_L3_error)
49732  }
49733  CYTHON_FALLTHROUGH;
49734  case 3:
49735  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
49736  else {
49737  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 3); __PYX_ERR(0, 2776, __pyx_L3_error)
49738  }
49739  CYTHON_FALLTHROUGH;
49740  case 4:
49741  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
49742  else {
49743  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 4); __PYX_ERR(0, 2776, __pyx_L3_error)
49744  }
49745  CYTHON_FALLTHROUGH;
49746  case 5:
49747  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
49748  else {
49749  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 5); __PYX_ERR(0, 2776, __pyx_L3_error)
49750  }
49751  CYTHON_FALLTHROUGH;
49752  case 6:
49753  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
49754  else {
49755  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 6); __PYX_ERR(0, 2776, __pyx_L3_error)
49756  }
49757  CYTHON_FALLTHROUGH;
49758  case 7:
49759  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
49760  else {
49761  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 7); __PYX_ERR(0, 2776, __pyx_L3_error)
49762  }
49763  CYTHON_FALLTHROUGH;
49764  case 8:
49765  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
49766  else {
49767  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 8); __PYX_ERR(0, 2776, __pyx_L3_error)
49768  }
49769  CYTHON_FALLTHROUGH;
49770  case 9:
49771  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
49772  else {
49773  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 9); __PYX_ERR(0, 2776, __pyx_L3_error)
49774  }
49775  CYTHON_FALLTHROUGH;
49776  case 10:
49777  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
49778  else {
49779  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, 10); __PYX_ERR(0, 2776, __pyx_L3_error)
49780  }
49781  CYTHON_FALLTHROUGH;
49782  case 11:
49783  if (kw_args > 0) {
49784  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params);
49785  if (value) { values[11] = value; kw_args--; }
49786  }
49787  CYTHON_FALLTHROUGH;
49788  case 12:
49789  if (kw_args > 0) {
49790  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi);
49791  if (value) { values[12] = value; kw_args--; }
49792  }
49793  CYTHON_FALLTHROUGH;
49794  case 13:
49795  if (kw_args > 0) {
49796  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
49797  if (value) { values[13] = value; kw_args--; }
49798  }
49799  }
49800  if (unlikely(kw_args > 0)) {
49801  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2776, __pyx_L3_error)
49802  }
49803  } else {
49804  switch (PyTuple_GET_SIZE(__pyx_args)) {
49805  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
49806  CYTHON_FALLTHROUGH;
49807  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
49808  CYTHON_FALLTHROUGH;
49809  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
49810  CYTHON_FALLTHROUGH;
49811  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
49812  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
49813  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
49814  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
49815  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
49816  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
49817  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
49818  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
49819  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
49820  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
49821  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
49822  break;
49823  default: goto __pyx_L5_argtuple_error;
49824  }
49825  }
49826  __pyx_v_Tstart = values[0];
49827  __pyx_v_Tend = values[1];
49828  __pyx_v_Tp = values[2];
49829  __pyx_v_Hs = values[3];
49830  __pyx_v_mwl = values[4];
49831  __pyx_v_depth = values[5];
49832  __pyx_v_waveDir = values[6];
49833  __pyx_v_g = values[7];
49834  __pyx_v_N = values[8];
49835  __pyx_v_bandFactor = values[9];
49836  __pyx_v_spectName = values[10];
49837  __pyx_v_spectral_params = values[11];
49838  __pyx_v_phi = values[12];
49839  __pyx_v_fast = values[13];
49840  }
49841  goto __pyx_L4_argument_unpacking_done;
49842  __pyx_L5_argtuple_error:;
49843  __Pyx_RaiseArgtupleInvalid("__init__", 0, 11, 14, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2776, __pyx_L3_error)
49844  __pyx_L3_error:;
49845  __Pyx_AddTraceback("WaveTools.RandomNLWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
49846  __Pyx_RefNannyFinishContext();
49847  return -1;
49848  __pyx_L4_argument_unpacking_done:;
49849  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves___init__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spectral_params, __pyx_v_phi, __pyx_v_fast);
49850 
49851  /* "WaveTools.py":2776
49852  * Switch for enabling optimised functions
49853  * """
49854  * def __init__(self, # <<<<<<<<<<<<<<
49855  * Tstart,
49856  * Tend,
49857  */
49858 
49859  /* function exit code */
49860  __Pyx_RefNannyFinishContext();
49861  return __pyx_r;
49862 }
49863 
49864 static int __pyx_pf_9WaveTools_13RandomNLWaves___init__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_Tstart, CYTHON_UNUSED PyObject *__pyx_v_Tend, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_fast) {
49865  struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_RW = NULL;
49866  PyObject *__pyx_v_ii = NULL;
49867  PyObject *__pyx_v_ij = NULL;
49868  PyObject *__pyx_v_kk = NULL;
49869  int __pyx_r;
49870  __Pyx_RefNannyDeclarations
49871  bool __pyx_t_1;
49872  PyObject *__pyx_t_2 = NULL;
49873  PyObject *__pyx_t_3 = NULL;
49874  PyObject *__pyx_t_4 = NULL;
49875  double __pyx_t_5;
49876  int __pyx_t_6;
49877  PyObject *__pyx_t_7 = NULL;
49878  PyObject *__pyx_t_8 = NULL;
49879  Py_ssize_t __pyx_t_9;
49880  PyObject *(*__pyx_t_10)(PyObject *);
49881  PyObject *__pyx_t_11 = NULL;
49882  Py_ssize_t __pyx_t_12;
49883  PyObject *(*__pyx_t_13)(PyObject *);
49884  Py_ssize_t __pyx_t_14;
49885  double *__pyx_t_15;
49886  __Pyx_RefNannySetupContext("__init__", 0);
49887 
49888  /* "WaveTools.py":2791
49889  * phi=None, #array of component phases
49890  * fast = True ):
49891  * self.fast= fast # <<<<<<<<<<<<<<
49892  * RW = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast )
49893  *
49894  */
49895  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_fast); if (unlikely((__pyx_t_1 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2791, __pyx_L1_error)
49896  __pyx_v_self->fast = __pyx_t_1;
49897 
49898  /* "WaveTools.py":2792
49899  * fast = True ):
49900  * self.fast= fast
49901  * RW = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast ) # <<<<<<<<<<<<<<
49902  *
49903  * self.gAbs = RW.gAbs
49904  */
49905  __pyx_t_2 = PyTuple_New(11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2792, __pyx_L1_error)
49906  __Pyx_GOTREF(__pyx_t_2);
49907  __Pyx_INCREF(__pyx_v_Tp);
49908  __Pyx_GIVEREF(__pyx_v_Tp);
49909  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_Tp);
49910  __Pyx_INCREF(__pyx_v_Hs);
49911  __Pyx_GIVEREF(__pyx_v_Hs);
49912  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_Hs);
49913  __Pyx_INCREF(__pyx_v_mwl);
49914  __Pyx_GIVEREF(__pyx_v_mwl);
49915  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_mwl);
49916  __Pyx_INCREF(__pyx_v_depth);
49917  __Pyx_GIVEREF(__pyx_v_depth);
49918  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_depth);
49919  __Pyx_INCREF(__pyx_v_waveDir);
49920  __Pyx_GIVEREF(__pyx_v_waveDir);
49921  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_waveDir);
49922  __Pyx_INCREF(__pyx_v_g);
49923  __Pyx_GIVEREF(__pyx_v_g);
49924  PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_g);
49925  __Pyx_INCREF(__pyx_v_N);
49926  __Pyx_GIVEREF(__pyx_v_N);
49927  PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_N);
49928  __Pyx_INCREF(__pyx_v_bandFactor);
49929  __Pyx_GIVEREF(__pyx_v_bandFactor);
49930  PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_bandFactor);
49931  __Pyx_INCREF(__pyx_v_spectName);
49932  __Pyx_GIVEREF(__pyx_v_spectName);
49933  PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_v_spectName);
49934  __Pyx_INCREF(__pyx_v_spectral_params);
49935  __Pyx_GIVEREF(__pyx_v_spectral_params);
49936  PyTuple_SET_ITEM(__pyx_t_2, 9, __pyx_v_spectral_params);
49937  __Pyx_INCREF(__pyx_v_phi);
49938  __Pyx_GIVEREF(__pyx_v_phi);
49939  PyTuple_SET_ITEM(__pyx_t_2, 10, __pyx_v_phi);
49940  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2792, __pyx_L1_error)
49941  __Pyx_GOTREF(__pyx_t_3);
49942  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->fast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2792, __pyx_L1_error)
49943  __Pyx_GOTREF(__pyx_t_4);
49944  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_fast, __pyx_t_4) < 0) __PYX_ERR(0, 2792, __pyx_L1_error)
49945  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49946  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_RandomWaves), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2792, __pyx_L1_error)
49947  __Pyx_GOTREF(__pyx_t_4);
49948  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49949  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49950  __pyx_v_RW = ((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_t_4);
49951  __pyx_t_4 = 0;
49952 
49953  /* "WaveTools.py":2794
49954  * RW = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast )
49955  *
49956  * self.gAbs = RW.gAbs # <<<<<<<<<<<<<<
49957  * self.eta_linear = RW.eta
49958  * self.eta = self.wtError
49959  */
49960  __pyx_t_5 = __pyx_v_RW->gAbs;
49961  __pyx_v_self->gAbs = __pyx_t_5;
49962 
49963  /* "WaveTools.py":2795
49964  *
49965  * self.gAbs = RW.gAbs
49966  * self.eta_linear = RW.eta # <<<<<<<<<<<<<<
49967  * self.eta = self.wtError
49968  * self.u = self.wtError
49969  */
49970  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_RW), __pyx_n_s_eta); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2795, __pyx_L1_error)
49971  __Pyx_GOTREF(__pyx_t_4);
49972  __Pyx_GIVEREF(__pyx_t_4);
49973  __Pyx_GOTREF(__pyx_v_self->eta_linear);
49974  __Pyx_DECREF(__pyx_v_self->eta_linear);
49975  __pyx_v_self->eta_linear = __pyx_t_4;
49976  __pyx_t_4 = 0;
49977 
49978  /* "WaveTools.py":2796
49979  * self.gAbs = RW.gAbs
49980  * self.eta_linear = RW.eta
49981  * self.eta = self.wtError # <<<<<<<<<<<<<<
49982  * self.u = self.wtError
49983  * self.omega = RW.omega
49984  */
49985  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wtError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2796, __pyx_L1_error)
49986  __Pyx_GOTREF(__pyx_t_4);
49987  __Pyx_GIVEREF(__pyx_t_4);
49988  __Pyx_GOTREF(__pyx_v_self->eta);
49989  __Pyx_DECREF(__pyx_v_self->eta);
49990  __pyx_v_self->eta = __pyx_t_4;
49991  __pyx_t_4 = 0;
49992 
49993  /* "WaveTools.py":2797
49994  * self.eta_linear = RW.eta
49995  * self.eta = self.wtError
49996  * self.u = self.wtError # <<<<<<<<<<<<<<
49997  * self.omega = RW.omega
49998  * self.ai = RW.ai
49999  */
50000  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_wtError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2797, __pyx_L1_error)
50001  __Pyx_GOTREF(__pyx_t_4);
50002  __Pyx_GIVEREF(__pyx_t_4);
50003  __Pyx_GOTREF(__pyx_v_self->u);
50004  __Pyx_DECREF(__pyx_v_self->u);
50005  __pyx_v_self->u = __pyx_t_4;
50006  __pyx_t_4 = 0;
50007 
50008  /* "WaveTools.py":2798
50009  * self.eta = self.wtError
50010  * self.u = self.wtError
50011  * self.omega = RW.omega # <<<<<<<<<<<<<<
50012  * self.ai = RW.ai
50013  * self.ki = RW.ki
50014  */
50015  __pyx_t_4 = ((PyObject *)__pyx_v_RW->omega);
50016  __Pyx_INCREF(__pyx_t_4);
50017  __Pyx_GIVEREF(__pyx_t_4);
50018  __Pyx_GOTREF(__pyx_v_self->omega);
50019  __Pyx_DECREF(((PyObject *)__pyx_v_self->omega));
50020  __pyx_v_self->omega = ((PyArrayObject *)__pyx_t_4);
50021  __pyx_t_4 = 0;
50022 
50023  /* "WaveTools.py":2799
50024  * self.u = self.wtError
50025  * self.omega = RW.omega
50026  * self.ai = RW.ai # <<<<<<<<<<<<<<
50027  * self.ki = RW.ki
50028  * self.kDir = RW.kDir
50029  */
50030  __pyx_t_4 = ((PyObject *)__pyx_v_RW->ai);
50031  __Pyx_INCREF(__pyx_t_4);
50032  __Pyx_GIVEREF(__pyx_t_4);
50033  __Pyx_GOTREF(__pyx_v_self->ai);
50034  __Pyx_DECREF(((PyObject *)__pyx_v_self->ai));
50035  __pyx_v_self->ai = ((PyArrayObject *)__pyx_t_4);
50036  __pyx_t_4 = 0;
50037 
50038  /* "WaveTools.py":2800
50039  * self.omega = RW.omega
50040  * self.ai = RW.ai
50041  * self.ki = RW.ki # <<<<<<<<<<<<<<
50042  * self.kDir = RW.kDir
50043  * self.phi = RW.phi
50044  */
50045  __pyx_t_4 = ((PyObject *)__pyx_v_RW->ki);
50046  __Pyx_INCREF(__pyx_t_4);
50047  __Pyx_GIVEREF(__pyx_t_4);
50048  __Pyx_GOTREF(__pyx_v_self->ki);
50049  __Pyx_DECREF(((PyObject *)__pyx_v_self->ki));
50050  __pyx_v_self->ki = ((PyArrayObject *)__pyx_t_4);
50051  __pyx_t_4 = 0;
50052 
50053  /* "WaveTools.py":2801
50054  * self.ai = RW.ai
50055  * self.ki = RW.ki
50056  * self.kDir = RW.kDir # <<<<<<<<<<<<<<
50057  * self.phi = RW.phi
50058  * self.N = N
50059  */
50060  __pyx_t_4 = ((PyObject *)__pyx_v_RW->kDir);
50061  __Pyx_INCREF(__pyx_t_4);
50062  __Pyx_GIVEREF(__pyx_t_4);
50063  __Pyx_GOTREF(__pyx_v_self->kDir);
50064  __Pyx_DECREF(((PyObject *)__pyx_v_self->kDir));
50065  __pyx_v_self->kDir = ((PyArrayObject *)__pyx_t_4);
50066  __pyx_t_4 = 0;
50067 
50068  /* "WaveTools.py":2802
50069  * self.ki = RW.ki
50070  * self.kDir = RW.kDir
50071  * self.phi = RW.phi # <<<<<<<<<<<<<<
50072  * self.N = N
50073  * self.depth = depth
50074  */
50075  if (!(likely(((__pyx_v_RW->phi) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_RW->phi, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2802, __pyx_L1_error)
50076  __pyx_t_4 = __pyx_v_RW->phi;
50077  __Pyx_INCREF(__pyx_t_4);
50078  __Pyx_GIVEREF(__pyx_t_4);
50079  __Pyx_GOTREF(__pyx_v_self->phi);
50080  __Pyx_DECREF(((PyObject *)__pyx_v_self->phi));
50081  __pyx_v_self->phi = ((PyArrayObject *)__pyx_t_4);
50082  __pyx_t_4 = 0;
50083 
50084  /* "WaveTools.py":2803
50085  * self.kDir = RW.kDir
50086  * self.phi = RW.phi
50087  * self.N = N # <<<<<<<<<<<<<<
50088  * self.depth = depth
50089  * self.tanhKd = np.zeros(self.N,"d")
50090  */
50091  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_N); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L1_error)
50092  __pyx_v_self->N = __pyx_t_6;
50093 
50094  /* "WaveTools.py":2804
50095  * self.phi = RW.phi
50096  * self.N = N
50097  * self.depth = depth # <<<<<<<<<<<<<<
50098  * self.tanhKd = np.zeros(self.N,"d")
50099  * self.sinhKd = np.zeros(self.N,"d")
50100  */
50101  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_depth); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2804, __pyx_L1_error)
50102  __pyx_v_self->depth = __pyx_t_5;
50103 
50104  /* "WaveTools.py":2805
50105  * self.N = N
50106  * self.depth = depth
50107  * self.tanhKd = np.zeros(self.N,"d") # <<<<<<<<<<<<<<
50108  * self.sinhKd = np.zeros(self.N,"d")
50109  * for ii in range(self.N):
50110  */
50111  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2805, __pyx_L1_error)
50112  __Pyx_GOTREF(__pyx_t_3);
50113  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2805, __pyx_L1_error)
50114  __Pyx_GOTREF(__pyx_t_2);
50115  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50116  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2805, __pyx_L1_error)
50117  __Pyx_GOTREF(__pyx_t_3);
50118  __pyx_t_7 = NULL;
50119  __pyx_t_6 = 0;
50120  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
50121  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
50122  if (likely(__pyx_t_7)) {
50123  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
50124  __Pyx_INCREF(__pyx_t_7);
50125  __Pyx_INCREF(function);
50126  __Pyx_DECREF_SET(__pyx_t_2, function);
50127  __pyx_t_6 = 1;
50128  }
50129  }
50130  #if CYTHON_FAST_PYCALL
50131  if (PyFunction_Check(__pyx_t_2)) {
50132  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_n_s_d};
50133  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2805, __pyx_L1_error)
50134  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
50135  __Pyx_GOTREF(__pyx_t_4);
50136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50137  } else
50138  #endif
50139  #if CYTHON_FAST_PYCCALL
50140  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
50141  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_3, __pyx_n_s_d};
50142  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2805, __pyx_L1_error)
50143  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
50144  __Pyx_GOTREF(__pyx_t_4);
50145  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50146  } else
50147  #endif
50148  {
50149  __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2805, __pyx_L1_error)
50150  __Pyx_GOTREF(__pyx_t_8);
50151  if (__pyx_t_7) {
50152  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
50153  }
50154  __Pyx_GIVEREF(__pyx_t_3);
50155  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_t_3);
50156  __Pyx_INCREF(__pyx_n_s_d);
50157  __Pyx_GIVEREF(__pyx_n_s_d);
50158  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_n_s_d);
50159  __pyx_t_3 = 0;
50160  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2805, __pyx_L1_error)
50161  __Pyx_GOTREF(__pyx_t_4);
50162  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50163  }
50164  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50165  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2805, __pyx_L1_error)
50166  __Pyx_GIVEREF(__pyx_t_4);
50167  __Pyx_GOTREF(__pyx_v_self->tanhKd);
50168  __Pyx_DECREF(((PyObject *)__pyx_v_self->tanhKd));
50169  __pyx_v_self->tanhKd = ((PyArrayObject *)__pyx_t_4);
50170  __pyx_t_4 = 0;
50171 
50172  /* "WaveTools.py":2806
50173  * self.depth = depth
50174  * self.tanhKd = np.zeros(self.N,"d")
50175  * self.sinhKd = np.zeros(self.N,"d") # <<<<<<<<<<<<<<
50176  * for ii in range(self.N):
50177  * self.tanhKd[ii] = np.tanh(self.ki[ii]*self.depth)
50178  */
50179  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error)
50180  __Pyx_GOTREF(__pyx_t_2);
50181  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2806, __pyx_L1_error)
50182  __Pyx_GOTREF(__pyx_t_8);
50183  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50184  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error)
50185  __Pyx_GOTREF(__pyx_t_2);
50186  __pyx_t_3 = NULL;
50187  __pyx_t_6 = 0;
50188  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
50189  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
50190  if (likely(__pyx_t_3)) {
50191  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
50192  __Pyx_INCREF(__pyx_t_3);
50193  __Pyx_INCREF(function);
50194  __Pyx_DECREF_SET(__pyx_t_8, function);
50195  __pyx_t_6 = 1;
50196  }
50197  }
50198  #if CYTHON_FAST_PYCALL
50199  if (PyFunction_Check(__pyx_t_8)) {
50200  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_n_s_d};
50201  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2806, __pyx_L1_error)
50202  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
50203  __Pyx_GOTREF(__pyx_t_4);
50204  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50205  } else
50206  #endif
50207  #if CYTHON_FAST_PYCCALL
50208  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
50209  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_2, __pyx_n_s_d};
50210  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2806, __pyx_L1_error)
50211  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
50212  __Pyx_GOTREF(__pyx_t_4);
50213  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50214  } else
50215  #endif
50216  {
50217  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2806, __pyx_L1_error)
50218  __Pyx_GOTREF(__pyx_t_7);
50219  if (__pyx_t_3) {
50220  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
50221  }
50222  __Pyx_GIVEREF(__pyx_t_2);
50223  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_2);
50224  __Pyx_INCREF(__pyx_n_s_d);
50225  __Pyx_GIVEREF(__pyx_n_s_d);
50226  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_d);
50227  __pyx_t_2 = 0;
50228  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2806, __pyx_L1_error)
50229  __Pyx_GOTREF(__pyx_t_4);
50230  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50231  }
50232  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50233  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 2806, __pyx_L1_error)
50234  __Pyx_GIVEREF(__pyx_t_4);
50235  __Pyx_GOTREF(__pyx_v_self->sinhKd);
50236  __Pyx_DECREF(((PyObject *)__pyx_v_self->sinhKd));
50237  __pyx_v_self->sinhKd = ((PyArrayObject *)__pyx_t_4);
50238  __pyx_t_4 = 0;
50239 
50240  /* "WaveTools.py":2807
50241  * self.tanhKd = np.zeros(self.N,"d")
50242  * self.sinhKd = np.zeros(self.N,"d")
50243  * for ii in range(self.N): # <<<<<<<<<<<<<<
50244  * self.tanhKd[ii] = np.tanh(self.ki[ii]*self.depth)
50245  * self.sinhKd[ii] = np.sinh(self.ki[ii]*self.depth)
50246  */
50247  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_range); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2807, __pyx_L1_error)
50248  __Pyx_GOTREF(__pyx_t_8);
50249  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2807, __pyx_L1_error)
50250  __Pyx_GOTREF(__pyx_t_7);
50251  __pyx_t_2 = NULL;
50252  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
50253  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
50254  if (likely(__pyx_t_2)) {
50255  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
50256  __Pyx_INCREF(__pyx_t_2);
50257  __Pyx_INCREF(function);
50258  __Pyx_DECREF_SET(__pyx_t_8, function);
50259  }
50260  }
50261  __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
50262  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
50263  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50264  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2807, __pyx_L1_error)
50265  __Pyx_GOTREF(__pyx_t_4);
50266  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50267  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
50268  __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
50269  __pyx_t_10 = NULL;
50270  } else {
50271  __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2807, __pyx_L1_error)
50272  __Pyx_GOTREF(__pyx_t_8);
50273  __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2807, __pyx_L1_error)
50274  }
50275  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50276  for (;;) {
50277  if (likely(!__pyx_t_10)) {
50278  if (likely(PyList_CheckExact(__pyx_t_8))) {
50279  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
50280  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50281  __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2807, __pyx_L1_error)
50282  #else
50283  __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2807, __pyx_L1_error)
50284  __Pyx_GOTREF(__pyx_t_4);
50285  #endif
50286  } else {
50287  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
50288  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50289  __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2807, __pyx_L1_error)
50290  #else
50291  __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2807, __pyx_L1_error)
50292  __Pyx_GOTREF(__pyx_t_4);
50293  #endif
50294  }
50295  } else {
50296  __pyx_t_4 = __pyx_t_10(__pyx_t_8);
50297  if (unlikely(!__pyx_t_4)) {
50298  PyObject* exc_type = PyErr_Occurred();
50299  if (exc_type) {
50300  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
50301  else __PYX_ERR(0, 2807, __pyx_L1_error)
50302  }
50303  break;
50304  }
50305  __Pyx_GOTREF(__pyx_t_4);
50306  }
50307  __Pyx_XDECREF_SET(__pyx_v_ii, __pyx_t_4);
50308  __pyx_t_4 = 0;
50309 
50310  /* "WaveTools.py":2808
50311  * self.sinhKd = np.zeros(self.N,"d")
50312  * for ii in range(self.N):
50313  * self.tanhKd[ii] = np.tanh(self.ki[ii]*self.depth) # <<<<<<<<<<<<<<
50314  * self.sinhKd[ii] = np.sinh(self.ki[ii]*self.depth)
50315  * self.waveDir = RW.waveDir
50316  */
50317  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2808, __pyx_L1_error)
50318  __Pyx_GOTREF(__pyx_t_7);
50319  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_tanh); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2808, __pyx_L1_error)
50320  __Pyx_GOTREF(__pyx_t_2);
50321  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50322  __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ii); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2808, __pyx_L1_error)
50323  __Pyx_GOTREF(__pyx_t_7);
50324  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2808, __pyx_L1_error)
50325  __Pyx_GOTREF(__pyx_t_3);
50326  __pyx_t_11 = PyNumber_Multiply(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2808, __pyx_L1_error)
50327  __Pyx_GOTREF(__pyx_t_11);
50328  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50329  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50330  __pyx_t_3 = NULL;
50331  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
50332  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
50333  if (likely(__pyx_t_3)) {
50334  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
50335  __Pyx_INCREF(__pyx_t_3);
50336  __Pyx_INCREF(function);
50337  __Pyx_DECREF_SET(__pyx_t_2, function);
50338  }
50339  }
50340  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_11);
50341  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
50342  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50343  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2808, __pyx_L1_error)
50344  __Pyx_GOTREF(__pyx_t_4);
50345  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50346  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->tanhKd), __pyx_v_ii, __pyx_t_4) < 0)) __PYX_ERR(0, 2808, __pyx_L1_error)
50347  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50348 
50349  /* "WaveTools.py":2809
50350  * for ii in range(self.N):
50351  * self.tanhKd[ii] = np.tanh(self.ki[ii]*self.depth)
50352  * self.sinhKd[ii] = np.sinh(self.ki[ii]*self.depth) # <<<<<<<<<<<<<<
50353  * self.waveDir = RW.waveDir
50354  *
50355  */
50356  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2809, __pyx_L1_error)
50357  __Pyx_GOTREF(__pyx_t_2);
50358  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sinh); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2809, __pyx_L1_error)
50359  __Pyx_GOTREF(__pyx_t_11);
50360  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50361  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2809, __pyx_L1_error)
50362  __Pyx_GOTREF(__pyx_t_2);
50363  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2809, __pyx_L1_error)
50364  __Pyx_GOTREF(__pyx_t_3);
50365  __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2809, __pyx_L1_error)
50366  __Pyx_GOTREF(__pyx_t_7);
50367  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50368  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
50369  __pyx_t_3 = NULL;
50370  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
50371  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
50372  if (likely(__pyx_t_3)) {
50373  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
50374  __Pyx_INCREF(__pyx_t_3);
50375  __Pyx_INCREF(function);
50376  __Pyx_DECREF_SET(__pyx_t_11, function);
50377  }
50378  }
50379  __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_7);
50380  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
50381  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50382  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2809, __pyx_L1_error)
50383  __Pyx_GOTREF(__pyx_t_4);
50384  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50385  if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_self->sinhKd), __pyx_v_ii, __pyx_t_4) < 0)) __PYX_ERR(0, 2809, __pyx_L1_error)
50386  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50387 
50388  /* "WaveTools.py":2807
50389  * self.tanhKd = np.zeros(self.N,"d")
50390  * self.sinhKd = np.zeros(self.N,"d")
50391  * for ii in range(self.N): # <<<<<<<<<<<<<<
50392  * self.tanhKd[ii] = np.tanh(self.ki[ii]*self.depth)
50393  * self.sinhKd[ii] = np.sinh(self.ki[ii]*self.depth)
50394  */
50395  }
50396  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50397 
50398  /* "WaveTools.py":2810
50399  * self.tanhKd[ii] = np.tanh(self.ki[ii]*self.depth)
50400  * self.sinhKd[ii] = np.sinh(self.ki[ii]*self.depth)
50401  * self.waveDir = RW.waveDir # <<<<<<<<<<<<<<
50402  *
50403  * for ij in range(self.N):
50404  */
50405  __pyx_t_8 = ((PyObject *)__pyx_v_RW->waveDir);
50406  __Pyx_INCREF(__pyx_t_8);
50407  __Pyx_GIVEREF(__pyx_t_8);
50408  __Pyx_GOTREF(__pyx_v_self->waveDir);
50409  __Pyx_DECREF(((PyObject *)__pyx_v_self->waveDir));
50410  __pyx_v_self->waveDir = ((PyArrayObject *)__pyx_t_8);
50411  __pyx_t_8 = 0;
50412 
50413  /* "WaveTools.py":2812
50414  * self.waveDir = RW.waveDir
50415  *
50416  * for ij in range(self.N): # <<<<<<<<<<<<<<
50417  * for kk in range(3):
50418  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
50419  */
50420  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2812, __pyx_L1_error)
50421  __Pyx_GOTREF(__pyx_t_4);
50422  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2812, __pyx_L1_error)
50423  __Pyx_GOTREF(__pyx_t_11);
50424  __pyx_t_7 = NULL;
50425  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
50426  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
50427  if (likely(__pyx_t_7)) {
50428  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
50429  __Pyx_INCREF(__pyx_t_7);
50430  __Pyx_INCREF(function);
50431  __Pyx_DECREF_SET(__pyx_t_4, function);
50432  }
50433  }
50434  __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_11);
50435  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
50436  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50437  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2812, __pyx_L1_error)
50438  __Pyx_GOTREF(__pyx_t_8);
50439  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50440  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
50441  __pyx_t_4 = __pyx_t_8; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
50442  __pyx_t_10 = NULL;
50443  } else {
50444  __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2812, __pyx_L1_error)
50445  __Pyx_GOTREF(__pyx_t_4);
50446  __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2812, __pyx_L1_error)
50447  }
50448  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50449  for (;;) {
50450  if (likely(!__pyx_t_10)) {
50451  if (likely(PyList_CheckExact(__pyx_t_4))) {
50452  if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
50453  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50454  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2812, __pyx_L1_error)
50455  #else
50456  __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2812, __pyx_L1_error)
50457  __Pyx_GOTREF(__pyx_t_8);
50458  #endif
50459  } else {
50460  if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
50461  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50462  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 2812, __pyx_L1_error)
50463  #else
50464  __pyx_t_8 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2812, __pyx_L1_error)
50465  __Pyx_GOTREF(__pyx_t_8);
50466  #endif
50467  }
50468  } else {
50469  __pyx_t_8 = __pyx_t_10(__pyx_t_4);
50470  if (unlikely(!__pyx_t_8)) {
50471  PyObject* exc_type = PyErr_Occurred();
50472  if (exc_type) {
50473  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
50474  else __PYX_ERR(0, 2812, __pyx_L1_error)
50475  }
50476  break;
50477  }
50478  __Pyx_GOTREF(__pyx_t_8);
50479  }
50480  __Pyx_XDECREF_SET(__pyx_v_ij, __pyx_t_8);
50481  __pyx_t_8 = 0;
50482 
50483  /* "WaveTools.py":2813
50484  *
50485  * for ij in range(self.N):
50486  * for kk in range(3): # <<<<<<<<<<<<<<
50487  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
50488  * self.omega_c[ij] = self.omega[ij]
50489  */
50490  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_range); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2813, __pyx_L1_error)
50491  __Pyx_GOTREF(__pyx_t_11);
50492  __pyx_t_7 = NULL;
50493  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
50494  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_11);
50495  if (likely(__pyx_t_7)) {
50496  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
50497  __Pyx_INCREF(__pyx_t_7);
50498  __Pyx_INCREF(function);
50499  __Pyx_DECREF_SET(__pyx_t_11, function);
50500  }
50501  }
50502  __pyx_t_8 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_7, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_int_3);
50503  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
50504  if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2813, __pyx_L1_error)
50505  __Pyx_GOTREF(__pyx_t_8);
50506  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50507  if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
50508  __pyx_t_11 = __pyx_t_8; __Pyx_INCREF(__pyx_t_11); __pyx_t_12 = 0;
50509  __pyx_t_13 = NULL;
50510  } else {
50511  __pyx_t_12 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2813, __pyx_L1_error)
50512  __Pyx_GOTREF(__pyx_t_11);
50513  __pyx_t_13 = Py_TYPE(__pyx_t_11)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2813, __pyx_L1_error)
50514  }
50515  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50516  for (;;) {
50517  if (likely(!__pyx_t_13)) {
50518  if (likely(PyList_CheckExact(__pyx_t_11))) {
50519  if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_11)) break;
50520  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50521  __pyx_t_8 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2813, __pyx_L1_error)
50522  #else
50523  __pyx_t_8 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2813, __pyx_L1_error)
50524  __Pyx_GOTREF(__pyx_t_8);
50525  #endif
50526  } else {
50527  if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_11)) break;
50528  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
50529  __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 2813, __pyx_L1_error)
50530  #else
50531  __pyx_t_8 = PySequence_ITEM(__pyx_t_11, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2813, __pyx_L1_error)
50532  __Pyx_GOTREF(__pyx_t_8);
50533  #endif
50534  }
50535  } else {
50536  __pyx_t_8 = __pyx_t_13(__pyx_t_11);
50537  if (unlikely(!__pyx_t_8)) {
50538  PyObject* exc_type = PyErr_Occurred();
50539  if (exc_type) {
50540  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
50541  else __PYX_ERR(0, 2813, __pyx_L1_error)
50542  }
50543  break;
50544  }
50545  __Pyx_GOTREF(__pyx_t_8);
50546  }
50547  __Pyx_XDECREF_SET(__pyx_v_kk, __pyx_t_8);
50548  __pyx_t_8 = 0;
50549 
50550  /* "WaveTools.py":2814
50551  * for ij in range(self.N):
50552  * for kk in range(3):
50553  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk] # <<<<<<<<<<<<<<
50554  * self.omega_c[ij] = self.omega[ij]
50555  * self.ki_c[ij] =self.ki[ij]
50556  */
50557  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2814, __pyx_L1_error)
50558  __Pyx_GOTREF(__pyx_t_8);
50559  __Pyx_INCREF(__pyx_v_ij);
50560  __Pyx_GIVEREF(__pyx_v_ij);
50561  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ij);
50562  __Pyx_INCREF(__pyx_v_kk);
50563  __Pyx_GIVEREF(__pyx_v_kk);
50564  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_kk);
50565  __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2814, __pyx_L1_error)
50566  __Pyx_GOTREF(__pyx_t_7);
50567  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50568  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2814, __pyx_L1_error)
50569  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50570  __pyx_t_7 = PyNumber_Multiply(__pyx_int_3, __pyx_v_ij); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2814, __pyx_L1_error)
50571  __Pyx_GOTREF(__pyx_t_7);
50572  __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_kk); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2814, __pyx_L1_error)
50573  __Pyx_GOTREF(__pyx_t_8);
50574  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
50575  __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2814, __pyx_L1_error)
50576  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
50577  (__pyx_v_self->kDir_c[__pyx_t_14]) = __pyx_t_5;
50578 
50579  /* "WaveTools.py":2813
50580  *
50581  * for ij in range(self.N):
50582  * for kk in range(3): # <<<<<<<<<<<<<<
50583  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
50584  * self.omega_c[ij] = self.omega[ij]
50585  */
50586  }
50587  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50588 
50589  /* "WaveTools.py":2815
50590  * for kk in range(3):
50591  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
50592  * self.omega_c[ij] = self.omega[ij] # <<<<<<<<<<<<<<
50593  * self.ki_c[ij] =self.ki[ij]
50594  * self.tanh_c[ij] = self.tanhKd[ij]
50595  */
50596  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omega), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2815, __pyx_L1_error)
50597  __Pyx_GOTREF(__pyx_t_11);
50598  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L1_error)
50599  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50600  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L1_error)
50601  (__pyx_v_self->omega_c[__pyx_t_12]) = __pyx_t_5;
50602 
50603  /* "WaveTools.py":2816
50604  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
50605  * self.omega_c[ij] = self.omega[ij]
50606  * self.ki_c[ij] =self.ki[ij] # <<<<<<<<<<<<<<
50607  * self.tanh_c[ij] = self.tanhKd[ij]
50608  * self.sinh_c[ij] = self.sinhKd[ij]
50609  */
50610  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2816, __pyx_L1_error)
50611  __Pyx_GOTREF(__pyx_t_11);
50612  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2816, __pyx_L1_error)
50613  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50614  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2816, __pyx_L1_error)
50615  (__pyx_v_self->ki_c[__pyx_t_12]) = __pyx_t_5;
50616 
50617  /* "WaveTools.py":2817
50618  * self.omega_c[ij] = self.omega[ij]
50619  * self.ki_c[ij] =self.ki[ij]
50620  * self.tanh_c[ij] = self.tanhKd[ij] # <<<<<<<<<<<<<<
50621  * self.sinh_c[ij] = self.sinhKd[ij]
50622  * self.ai_c[ij] = self.ai[ij]
50623  */
50624  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->tanhKd), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2817, __pyx_L1_error)
50625  __Pyx_GOTREF(__pyx_t_11);
50626  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2817, __pyx_L1_error)
50627  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50628  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2817, __pyx_L1_error)
50629  (__pyx_v_self->tanh_c[__pyx_t_12]) = __pyx_t_5;
50630 
50631  /* "WaveTools.py":2818
50632  * self.ki_c[ij] =self.ki[ij]
50633  * self.tanh_c[ij] = self.tanhKd[ij]
50634  * self.sinh_c[ij] = self.sinhKd[ij] # <<<<<<<<<<<<<<
50635  * self.ai_c[ij] = self.ai[ij]
50636  * self.phi_c[ij] = self.phi[ij]
50637  */
50638  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->sinhKd), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2818, __pyx_L1_error)
50639  __Pyx_GOTREF(__pyx_t_11);
50640  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2818, __pyx_L1_error)
50641  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50642  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2818, __pyx_L1_error)
50643  (__pyx_v_self->sinh_c[__pyx_t_12]) = __pyx_t_5;
50644 
50645  /* "WaveTools.py":2819
50646  * self.tanh_c[ij] = self.tanhKd[ij]
50647  * self.sinh_c[ij] = self.sinhKd[ij]
50648  * self.ai_c[ij] = self.ai[ij] # <<<<<<<<<<<<<<
50649  * self.phi_c[ij] = self.phi[ij]
50650  *
50651  */
50652  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ai), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2819, __pyx_L1_error)
50653  __Pyx_GOTREF(__pyx_t_11);
50654  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2819, __pyx_L1_error)
50655  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50656  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2819, __pyx_L1_error)
50657  (__pyx_v_self->ai_c[__pyx_t_12]) = __pyx_t_5;
50658 
50659  /* "WaveTools.py":2820
50660  * self.sinh_c[ij] = self.sinhKd[ij]
50661  * self.ai_c[ij] = self.ai[ij]
50662  * self.phi_c[ij] = self.phi[ij] # <<<<<<<<<<<<<<
50663  *
50664  * self.kDir_ = self.kDir_c
50665  */
50666  __pyx_t_11 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->phi), __pyx_v_ij); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2820, __pyx_L1_error)
50667  __Pyx_GOTREF(__pyx_t_11);
50668  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2820, __pyx_L1_error)
50669  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
50670  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ij); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2820, __pyx_L1_error)
50671  (__pyx_v_self->phi_c[__pyx_t_12]) = __pyx_t_5;
50672 
50673  /* "WaveTools.py":2812
50674  * self.waveDir = RW.waveDir
50675  *
50676  * for ij in range(self.N): # <<<<<<<<<<<<<<
50677  * for kk in range(3):
50678  * self.kDir_c[3*ij+kk] = self.kDir[ij,kk]
50679  */
50680  }
50681  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50682 
50683  /* "WaveTools.py":2822
50684  * self.phi_c[ij] = self.phi[ij]
50685  *
50686  * self.kDir_ = self.kDir_c # <<<<<<<<<<<<<<
50687  * self.omega_ = self.omega_c
50688  * self.ki_ =self.ki_c
50689  */
50690  __pyx_t_15 = __pyx_v_self->kDir_c;
50691  __pyx_v_self->kDir_ = __pyx_t_15;
50692 
50693  /* "WaveTools.py":2823
50694  *
50695  * self.kDir_ = self.kDir_c
50696  * self.omega_ = self.omega_c # <<<<<<<<<<<<<<
50697  * self.ki_ =self.ki_c
50698  * self.ai_ = self.ai_c
50699  */
50700  __pyx_t_15 = __pyx_v_self->omega_c;
50701  __pyx_v_self->omega_ = __pyx_t_15;
50702 
50703  /* "WaveTools.py":2824
50704  * self.kDir_ = self.kDir_c
50705  * self.omega_ = self.omega_c
50706  * self.ki_ =self.ki_c # <<<<<<<<<<<<<<
50707  * self.ai_ = self.ai_c
50708  * self.tanhKd_ = self.tanh_c
50709  */
50710  __pyx_t_15 = __pyx_v_self->ki_c;
50711  __pyx_v_self->ki_ = __pyx_t_15;
50712 
50713  /* "WaveTools.py":2825
50714  * self.omega_ = self.omega_c
50715  * self.ki_ =self.ki_c
50716  * self.ai_ = self.ai_c # <<<<<<<<<<<<<<
50717  * self.tanhKd_ = self.tanh_c
50718  * self.sinhKd_ = self.sinh_c
50719  */
50720  __pyx_t_15 = __pyx_v_self->ai_c;
50721  __pyx_v_self->ai_ = __pyx_t_15;
50722 
50723  /* "WaveTools.py":2826
50724  * self.ki_ =self.ki_c
50725  * self.ai_ = self.ai_c
50726  * self.tanhKd_ = self.tanh_c # <<<<<<<<<<<<<<
50727  * self.sinhKd_ = self.sinh_c
50728  * self.phi_ = self.phi_c
50729  */
50730  __pyx_t_15 = __pyx_v_self->tanh_c;
50731  __pyx_v_self->tanhKd_ = __pyx_t_15;
50732 
50733  /* "WaveTools.py":2827
50734  * self.ai_ = self.ai_c
50735  * self.tanhKd_ = self.tanh_c
50736  * self.sinhKd_ = self.sinh_c # <<<<<<<<<<<<<<
50737  * self.phi_ = self.phi_c
50738  *
50739  */
50740  __pyx_t_15 = __pyx_v_self->sinh_c;
50741  __pyx_v_self->sinhKd_ = __pyx_t_15;
50742 
50743  /* "WaveTools.py":2828
50744  * self.tanhKd_ = self.tanh_c
50745  * self.sinhKd_ = self.sinh_c
50746  * self.phi_ = self.phi_c # <<<<<<<<<<<<<<
50747  *
50748  * #c++ declarations
50749  */
50750  __pyx_t_15 = __pyx_v_self->phi_c;
50751  __pyx_v_self->phi_ = __pyx_t_15;
50752 
50753  /* "WaveTools.py":2776
50754  * Switch for enabling optimised functions
50755  * """
50756  * def __init__(self, # <<<<<<<<<<<<<<
50757  * Tstart,
50758  * Tend,
50759  */
50760 
50761  /* function exit code */
50762  __pyx_r = 0;
50763  goto __pyx_L0;
50764  __pyx_L1_error:;
50765  __Pyx_XDECREF(__pyx_t_2);
50766  __Pyx_XDECREF(__pyx_t_3);
50767  __Pyx_XDECREF(__pyx_t_4);
50768  __Pyx_XDECREF(__pyx_t_7);
50769  __Pyx_XDECREF(__pyx_t_8);
50770  __Pyx_XDECREF(__pyx_t_11);
50771  __Pyx_AddTraceback("WaveTools.RandomNLWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
50772  __pyx_r = -1;
50773  __pyx_L0:;
50774  __Pyx_XDECREF((PyObject *)__pyx_v_RW);
50775  __Pyx_XDECREF(__pyx_v_ii);
50776  __Pyx_XDECREF(__pyx_v_ij);
50777  __Pyx_XDECREF(__pyx_v_kk);
50778  __Pyx_RefNannyFinishContext();
50779  return __pyx_r;
50780 }
50781 
50782 /* "WaveTools.py":2832
50783  * #c++ declarations
50784  *
50785  * def _cpp_eta_2ndOrder(self,x,t): # <<<<<<<<<<<<<<
50786  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast)
50787  * def eta_2ndOrder(self,x,t):
50788  */
50789 
50790 static double __pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_2ndOrder(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
50791  double __pyx_r;
50792  __Pyx_RefNannyDeclarations
50793  __Pyx_RefNannySetupContext("_cpp_eta_2ndOrder", 0);
50794 
50795  /* "WaveTools.py":2833
50796  *
50797  * def _cpp_eta_2ndOrder(self,x,t):
50798  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast) # <<<<<<<<<<<<<<
50799  * def eta_2ndOrder(self,x,t):
50800  * """Calculates the free surface elevation for 2nd-order terms
50801  */
50802  __pyx_r = proteus::__cpp_eta2nd(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->N, __pyx_v_self->sinhKd_, __pyx_v_self->tanhKd_, __pyx_v_self->fast);
50803  goto __pyx_L0;
50804 
50805  /* "WaveTools.py":2832
50806  * #c++ declarations
50807  *
50808  * def _cpp_eta_2ndOrder(self,x,t): # <<<<<<<<<<<<<<
50809  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast)
50810  * def eta_2ndOrder(self,x,t):
50811  */
50812 
50813  /* function exit code */
50814  __pyx_L0:;
50815  __Pyx_RefNannyFinishContext();
50816  return __pyx_r;
50817 }
50818 
50819 /* "WaveTools.py":2834
50820  * def _cpp_eta_2ndOrder(self,x,t):
50821  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast)
50822  * def eta_2ndOrder(self,x,t): # <<<<<<<<<<<<<<
50823  * """Calculates the free surface elevation for 2nd-order terms
50824  *
50825  */
50826 
50827 /* Python wrapper */
50828 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_3eta_2ndOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
50829 static char __pyx_doc_9WaveTools_13RandomNLWaves_2eta_2ndOrder[] = "Calculates the free surface elevation for 2nd-order terms\n\n Uses 2nd order random wave theory\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
50830 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_3eta_2ndOrder = {"eta_2ndOrder", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_3eta_2ndOrder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_2eta_2ndOrder};
50831 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_3eta_2ndOrder(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
50832  PyObject *__pyx_v_x = 0;
50833  PyObject *__pyx_v_t = 0;
50834  PyObject *__pyx_r = 0;
50835  __Pyx_RefNannyDeclarations
50836  __Pyx_RefNannySetupContext("eta_2ndOrder (wrapper)", 0);
50837  {
50838  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
50839  PyObject* values[2] = {0,0};
50840  if (unlikely(__pyx_kwds)) {
50841  Py_ssize_t kw_args;
50842  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
50843  switch (pos_args) {
50844  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
50845  CYTHON_FALLTHROUGH;
50846  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
50847  CYTHON_FALLTHROUGH;
50848  case 0: break;
50849  default: goto __pyx_L5_argtuple_error;
50850  }
50851  kw_args = PyDict_Size(__pyx_kwds);
50852  switch (pos_args) {
50853  case 0:
50854  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
50855  else goto __pyx_L5_argtuple_error;
50856  CYTHON_FALLTHROUGH;
50857  case 1:
50858  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
50859  else {
50860  __Pyx_RaiseArgtupleInvalid("eta_2ndOrder", 1, 2, 2, 1); __PYX_ERR(0, 2834, __pyx_L3_error)
50861  }
50862  }
50863  if (unlikely(kw_args > 0)) {
50864  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta_2ndOrder") < 0)) __PYX_ERR(0, 2834, __pyx_L3_error)
50865  }
50866  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
50867  goto __pyx_L5_argtuple_error;
50868  } else {
50869  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
50870  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
50871  }
50872  __pyx_v_x = values[0];
50873  __pyx_v_t = values[1];
50874  }
50875  goto __pyx_L4_argument_unpacking_done;
50876  __pyx_L5_argtuple_error:;
50877  __Pyx_RaiseArgtupleInvalid("eta_2ndOrder", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2834, __pyx_L3_error)
50878  __pyx_L3_error:;
50879  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_2ndOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
50880  __Pyx_RefNannyFinishContext();
50881  return NULL;
50882  __pyx_L4_argument_unpacking_done:;
50883  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_2eta_2ndOrder(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
50884 
50885  /* function exit code */
50886  __Pyx_RefNannyFinishContext();
50887  return __pyx_r;
50888 }
50889 
50890 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_2eta_2ndOrder(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
50891  double __pyx_v_xx[3];
50892  PyObject *__pyx_r = NULL;
50893  __Pyx_RefNannyDeclarations
50894  PyObject *__pyx_t_1 = NULL;
50895  double __pyx_t_2;
50896  __Pyx_RefNannySetupContext("eta_2ndOrder", 0);
50897 
50898  /* "WaveTools.py":2854
50899  *
50900  * cython.declare(xx=cython.double[3])
50901  * xx[0] = x[0] # <<<<<<<<<<<<<<
50902  * xx[1] = x[1]
50903  * xx[2] = x[2]
50904  */
50905  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error)
50906  __Pyx_GOTREF(__pyx_t_1);
50907  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2854, __pyx_L1_error)
50908  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50909  (__pyx_v_xx[0]) = __pyx_t_2;
50910 
50911  /* "WaveTools.py":2855
50912  * cython.declare(xx=cython.double[3])
50913  * xx[0] = x[0]
50914  * xx[1] = x[1] # <<<<<<<<<<<<<<
50915  * xx[2] = x[2]
50916  * return self._cpp_eta_2ndOrder(xx,t)
50917  */
50918  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2855, __pyx_L1_error)
50919  __Pyx_GOTREF(__pyx_t_1);
50920  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2855, __pyx_L1_error)
50921  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50922  (__pyx_v_xx[1]) = __pyx_t_2;
50923 
50924  /* "WaveTools.py":2856
50925  * xx[0] = x[0]
50926  * xx[1] = x[1]
50927  * xx[2] = x[2] # <<<<<<<<<<<<<<
50928  * return self._cpp_eta_2ndOrder(xx,t)
50929  * '''
50930  */
50931  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2856, __pyx_L1_error)
50932  __Pyx_GOTREF(__pyx_t_1);
50933  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2856, __pyx_L1_error)
50934  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50935  (__pyx_v_xx[2]) = __pyx_t_2;
50936 
50937  /* "WaveTools.py":2857
50938  * xx[1] = x[1]
50939  * xx[2] = x[2]
50940  * return self._cpp_eta_2ndOrder(xx,t) # <<<<<<<<<<<<<<
50941  * '''
50942  * Eta2nd = 0.
50943  */
50944  __Pyx_XDECREF(__pyx_r);
50945  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2857, __pyx_L1_error)
50946  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta_2ndOrder(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
50947  __Pyx_GOTREF(__pyx_t_1);
50948  __pyx_r = __pyx_t_1;
50949  __pyx_t_1 = 0;
50950  goto __pyx_L0;
50951 
50952  /* "WaveTools.py":2834
50953  * def _cpp_eta_2ndOrder(self,x,t):
50954  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast)
50955  * def eta_2ndOrder(self,x,t): # <<<<<<<<<<<<<<
50956  * """Calculates the free surface elevation for 2nd-order terms
50957  *
50958  */
50959 
50960  /* function exit code */
50961  __pyx_L1_error:;
50962  __Pyx_XDECREF(__pyx_t_1);
50963  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_2ndOrder", __pyx_clineno, __pyx_lineno, __pyx_filename);
50964  __pyx_r = NULL;
50965  __pyx_L0:;
50966  __Pyx_XGIVEREF(__pyx_r);
50967  __Pyx_RefNannyFinishContext();
50968  return __pyx_r;
50969 }
50970 
50971 /* "WaveTools.py":2867
50972  * '''
50973  *
50974  * def _cpp_eta_short(self,x,t): # <<<<<<<<<<<<<<
50975  * return __cpp_eta_short(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_,self.gAbs, self.fast)
50976  *
50977  */
50978 
50979 static double __pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_short(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
50980  double __pyx_r;
50981  __Pyx_RefNannyDeclarations
50982  __Pyx_RefNannySetupContext("_cpp_eta_short", 0);
50983 
50984  /* "WaveTools.py":2868
50985  *
50986  * def _cpp_eta_short(self,x,t):
50987  * return __cpp_eta_short(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_,self.gAbs, self.fast) # <<<<<<<<<<<<<<
50988  *
50989  *
50990  */
50991  __pyx_r = proteus::__cpp_eta_short(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->N, __pyx_v_self->sinhKd_, __pyx_v_self->tanhKd_, __pyx_v_self->gAbs, __pyx_v_self->fast);
50992  goto __pyx_L0;
50993 
50994  /* "WaveTools.py":2867
50995  * '''
50996  *
50997  * def _cpp_eta_short(self,x,t): # <<<<<<<<<<<<<<
50998  * return __cpp_eta_short(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_,self.gAbs, self.fast)
50999  *
51000  */
51001 
51002  /* function exit code */
51003  __pyx_L0:;
51004  __Pyx_RefNannyFinishContext();
51005  return __pyx_r;
51006 }
51007 
51008 /* "WaveTools.py":2872
51009  *
51010  * #higher harmonics
51011  * def eta_short(self,x,t): # <<<<<<<<<<<<<<
51012  * """Calculates the free surface elevation for higher-order terms
51013  *
51014  */
51015 
51016 /* Python wrapper */
51017 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_5eta_short(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
51018 static char __pyx_doc_9WaveTools_13RandomNLWaves_4eta_short[] = "Calculates the free surface elevation for higher-order terms\n\n Uses 2nd order random wave theory\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
51019 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_5eta_short = {"eta_short", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_5eta_short, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_4eta_short};
51020 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_5eta_short(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
51021  PyObject *__pyx_v_x = 0;
51022  PyObject *__pyx_v_t = 0;
51023  PyObject *__pyx_r = 0;
51024  __Pyx_RefNannyDeclarations
51025  __Pyx_RefNannySetupContext("eta_short (wrapper)", 0);
51026  {
51027  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
51028  PyObject* values[2] = {0,0};
51029  if (unlikely(__pyx_kwds)) {
51030  Py_ssize_t kw_args;
51031  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
51032  switch (pos_args) {
51033  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51034  CYTHON_FALLTHROUGH;
51035  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51036  CYTHON_FALLTHROUGH;
51037  case 0: break;
51038  default: goto __pyx_L5_argtuple_error;
51039  }
51040  kw_args = PyDict_Size(__pyx_kwds);
51041  switch (pos_args) {
51042  case 0:
51043  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
51044  else goto __pyx_L5_argtuple_error;
51045  CYTHON_FALLTHROUGH;
51046  case 1:
51047  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
51048  else {
51049  __Pyx_RaiseArgtupleInvalid("eta_short", 1, 2, 2, 1); __PYX_ERR(0, 2872, __pyx_L3_error)
51050  }
51051  }
51052  if (unlikely(kw_args > 0)) {
51053  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta_short") < 0)) __PYX_ERR(0, 2872, __pyx_L3_error)
51054  }
51055  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
51056  goto __pyx_L5_argtuple_error;
51057  } else {
51058  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51059  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51060  }
51061  __pyx_v_x = values[0];
51062  __pyx_v_t = values[1];
51063  }
51064  goto __pyx_L4_argument_unpacking_done;
51065  __pyx_L5_argtuple_error:;
51066  __Pyx_RaiseArgtupleInvalid("eta_short", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2872, __pyx_L3_error)
51067  __pyx_L3_error:;
51068  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_short", __pyx_clineno, __pyx_lineno, __pyx_filename);
51069  __Pyx_RefNannyFinishContext();
51070  return NULL;
51071  __pyx_L4_argument_unpacking_done:;
51072  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_4eta_short(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
51073 
51074  /* function exit code */
51075  __Pyx_RefNannyFinishContext();
51076  return __pyx_r;
51077 }
51078 
51079 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_4eta_short(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
51080  double __pyx_v_xx[3];
51081  PyObject *__pyx_r = NULL;
51082  __Pyx_RefNannyDeclarations
51083  PyObject *__pyx_t_1 = NULL;
51084  double __pyx_t_2;
51085  __Pyx_RefNannySetupContext("eta_short", 0);
51086 
51087  /* "WaveTools.py":2891
51088  * """
51089  * cython.declare(xx=cython.double[3])
51090  * xx[0] = x[0] # <<<<<<<<<<<<<<
51091  * xx[1] = x[1]
51092  * xx[2] = x[2]
51093  */
51094  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error)
51095  __Pyx_GOTREF(__pyx_t_1);
51096  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2891, __pyx_L1_error)
51097  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51098  (__pyx_v_xx[0]) = __pyx_t_2;
51099 
51100  /* "WaveTools.py":2892
51101  * cython.declare(xx=cython.double[3])
51102  * xx[0] = x[0]
51103  * xx[1] = x[1] # <<<<<<<<<<<<<<
51104  * xx[2] = x[2]
51105  * return self._cpp_eta_short(xx,t)
51106  */
51107  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2892, __pyx_L1_error)
51108  __Pyx_GOTREF(__pyx_t_1);
51109  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2892, __pyx_L1_error)
51110  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51111  (__pyx_v_xx[1]) = __pyx_t_2;
51112 
51113  /* "WaveTools.py":2893
51114  * xx[0] = x[0]
51115  * xx[1] = x[1]
51116  * xx[2] = x[2] # <<<<<<<<<<<<<<
51117  * return self._cpp_eta_short(xx,t)
51118  * '''
51119  */
51120  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
51121  __Pyx_GOTREF(__pyx_t_1);
51122  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2893, __pyx_L1_error)
51123  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51124  (__pyx_v_xx[2]) = __pyx_t_2;
51125 
51126  /* "WaveTools.py":2894
51127  * xx[1] = x[1]
51128  * xx[2] = x[2]
51129  * return self._cpp_eta_short(xx,t) # <<<<<<<<<<<<<<
51130  * '''
51131  * Etashort = 0.
51132  */
51133  __Pyx_XDECREF(__pyx_r);
51134  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2894, __pyx_L1_error)
51135  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta_short(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2894, __pyx_L1_error)
51136  __Pyx_GOTREF(__pyx_t_1);
51137  __pyx_r = __pyx_t_1;
51138  __pyx_t_1 = 0;
51139  goto __pyx_L0;
51140 
51141  /* "WaveTools.py":2872
51142  *
51143  * #higher harmonics
51144  * def eta_short(self,x,t): # <<<<<<<<<<<<<<
51145  * """Calculates the free surface elevation for higher-order terms
51146  *
51147  */
51148 
51149  /* function exit code */
51150  __pyx_L1_error:;
51151  __Pyx_XDECREF(__pyx_t_1);
51152  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_short", __pyx_clineno, __pyx_lineno, __pyx_filename);
51153  __pyx_r = NULL;
51154  __pyx_L0:;
51155  __Pyx_XGIVEREF(__pyx_r);
51156  __Pyx_RefNannyFinishContext();
51157  return __pyx_r;
51158 }
51159 
51160 /* "WaveTools.py":2909
51161  * '''
51162  *
51163  * def _cpp_eta_long(self,x,t): # <<<<<<<<<<<<<<
51164  * return __cpp_eta_long(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_,self.gAbs, self.fast)
51165  *
51166  */
51167 
51168 static double __pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_long(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, double *__pyx_v_x, double __pyx_v_t) {
51169  double __pyx_r;
51170  __Pyx_RefNannyDeclarations
51171  __Pyx_RefNannySetupContext("_cpp_eta_long", 0);
51172 
51173  /* "WaveTools.py":2910
51174  *
51175  * def _cpp_eta_long(self,x,t):
51176  * return __cpp_eta_long(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_,self.gAbs, self.fast) # <<<<<<<<<<<<<<
51177  *
51178  * #lower harmonics
51179  */
51180  __pyx_r = proteus::__cpp_eta_long(__pyx_v_x, __pyx_v_t, __pyx_v_self->kDir_, __pyx_v_self->ki_, __pyx_v_self->omega_, __pyx_v_self->phi_, __pyx_v_self->ai_, __pyx_v_self->N, __pyx_v_self->sinhKd_, __pyx_v_self->tanhKd_, __pyx_v_self->gAbs, __pyx_v_self->fast);
51181  goto __pyx_L0;
51182 
51183  /* "WaveTools.py":2909
51184  * '''
51185  *
51186  * def _cpp_eta_long(self,x,t): # <<<<<<<<<<<<<<
51187  * return __cpp_eta_long(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_,self.gAbs, self.fast)
51188  *
51189  */
51190 
51191  /* function exit code */
51192  __pyx_L0:;
51193  __Pyx_RefNannyFinishContext();
51194  return __pyx_r;
51195 }
51196 
51197 /* "WaveTools.py":2913
51198  *
51199  * #lower harmonics
51200  * def eta_long(self,x,t): # <<<<<<<<<<<<<<
51201  * """Calculates the free surface elevation for lower-order terms
51202  *
51203  */
51204 
51205 /* Python wrapper */
51206 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_7eta_long(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
51207 static char __pyx_doc_9WaveTools_13RandomNLWaves_6eta_long[] = "Calculates the free surface elevation for lower-order terms\n\n Uses 2nd order random wave theory\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
51208 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_7eta_long = {"eta_long", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_7eta_long, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_6eta_long};
51209 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_7eta_long(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
51210  PyObject *__pyx_v_x = 0;
51211  PyObject *__pyx_v_t = 0;
51212  PyObject *__pyx_r = 0;
51213  __Pyx_RefNannyDeclarations
51214  __Pyx_RefNannySetupContext("eta_long (wrapper)", 0);
51215  {
51216  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
51217  PyObject* values[2] = {0,0};
51218  if (unlikely(__pyx_kwds)) {
51219  Py_ssize_t kw_args;
51220  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
51221  switch (pos_args) {
51222  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51223  CYTHON_FALLTHROUGH;
51224  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51225  CYTHON_FALLTHROUGH;
51226  case 0: break;
51227  default: goto __pyx_L5_argtuple_error;
51228  }
51229  kw_args = PyDict_Size(__pyx_kwds);
51230  switch (pos_args) {
51231  case 0:
51232  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
51233  else goto __pyx_L5_argtuple_error;
51234  CYTHON_FALLTHROUGH;
51235  case 1:
51236  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
51237  else {
51238  __Pyx_RaiseArgtupleInvalid("eta_long", 1, 2, 2, 1); __PYX_ERR(0, 2913, __pyx_L3_error)
51239  }
51240  }
51241  if (unlikely(kw_args > 0)) {
51242  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta_long") < 0)) __PYX_ERR(0, 2913, __pyx_L3_error)
51243  }
51244  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
51245  goto __pyx_L5_argtuple_error;
51246  } else {
51247  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51248  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51249  }
51250  __pyx_v_x = values[0];
51251  __pyx_v_t = values[1];
51252  }
51253  goto __pyx_L4_argument_unpacking_done;
51254  __pyx_L5_argtuple_error:;
51255  __Pyx_RaiseArgtupleInvalid("eta_long", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2913, __pyx_L3_error)
51256  __pyx_L3_error:;
51257  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
51258  __Pyx_RefNannyFinishContext();
51259  return NULL;
51260  __pyx_L4_argument_unpacking_done:;
51261  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_6eta_long(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
51262 
51263  /* function exit code */
51264  __Pyx_RefNannyFinishContext();
51265  return __pyx_r;
51266 }
51267 
51268 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_6eta_long(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
51269  double __pyx_v_xx[3];
51270  PyObject *__pyx_r = NULL;
51271  __Pyx_RefNannyDeclarations
51272  PyObject *__pyx_t_1 = NULL;
51273  double __pyx_t_2;
51274  __Pyx_RefNannySetupContext("eta_long", 0);
51275 
51276  /* "WaveTools.py":2932
51277  * """
51278  * cython.declare(xx=cython.double[3])
51279  * xx[0] = x[0] # <<<<<<<<<<<<<<
51280  * xx[1] = x[1]
51281  * xx[2] = x[2]
51282  */
51283  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2932, __pyx_L1_error)
51284  __Pyx_GOTREF(__pyx_t_1);
51285  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2932, __pyx_L1_error)
51286  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51287  (__pyx_v_xx[0]) = __pyx_t_2;
51288 
51289  /* "WaveTools.py":2933
51290  * cython.declare(xx=cython.double[3])
51291  * xx[0] = x[0]
51292  * xx[1] = x[1] # <<<<<<<<<<<<<<
51293  * xx[2] = x[2]
51294  * return self._cpp_eta_long(xx,t)
51295  */
51296  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2933, __pyx_L1_error)
51297  __Pyx_GOTREF(__pyx_t_1);
51298  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2933, __pyx_L1_error)
51299  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51300  (__pyx_v_xx[1]) = __pyx_t_2;
51301 
51302  /* "WaveTools.py":2934
51303  * xx[0] = x[0]
51304  * xx[1] = x[1]
51305  * xx[2] = x[2] # <<<<<<<<<<<<<<
51306  * return self._cpp_eta_long(xx,t)
51307  *
51308  */
51309  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2934, __pyx_L1_error)
51310  __Pyx_GOTREF(__pyx_t_1);
51311  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2934, __pyx_L1_error)
51312  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51313  (__pyx_v_xx[2]) = __pyx_t_2;
51314 
51315  /* "WaveTools.py":2935
51316  * xx[1] = x[1]
51317  * xx[2] = x[2]
51318  * return self._cpp_eta_long(xx,t) # <<<<<<<<<<<<<<
51319  *
51320  *
51321  */
51322  __Pyx_XDECREF(__pyx_r);
51323  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2935, __pyx_L1_error)
51324  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta_long(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2935, __pyx_L1_error)
51325  __Pyx_GOTREF(__pyx_t_1);
51326  __pyx_r = __pyx_t_1;
51327  __pyx_t_1 = 0;
51328  goto __pyx_L0;
51329 
51330  /* "WaveTools.py":2913
51331  *
51332  * #lower harmonics
51333  * def eta_long(self,x,t): # <<<<<<<<<<<<<<
51334  * """Calculates the free surface elevation for lower-order terms
51335  *
51336  */
51337 
51338  /* function exit code */
51339  __pyx_L1_error:;
51340  __Pyx_XDECREF(__pyx_t_1);
51341  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_long", __pyx_clineno, __pyx_lineno, __pyx_filename);
51342  __pyx_r = NULL;
51343  __pyx_L0:;
51344  __Pyx_XGIVEREF(__pyx_r);
51345  __Pyx_RefNannyFinishContext();
51346  return __pyx_r;
51347 }
51348 
51349 /* "WaveTools.py":2951
51350  *
51351  * #set-up calculation
51352  * def eta_setUp(self,x,t): # <<<<<<<<<<<<<<
51353  * """Calculates the free surface elevation set up
51354  *
51355  */
51356 
51357 /* Python wrapper */
51358 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_9eta_setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
51359 static char __pyx_doc_9WaveTools_13RandomNLWaves_8eta_setUp[] = "Calculates the free surface elevation set up\n\n Uses 2nd order random wave theory\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
51360 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_9eta_setUp = {"eta_setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_9eta_setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_8eta_setUp};
51361 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_9eta_setUp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
51362  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
51363  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
51364  PyObject *__pyx_r = 0;
51365  __Pyx_RefNannyDeclarations
51366  __Pyx_RefNannySetupContext("eta_setUp (wrapper)", 0);
51367  {
51368  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
51369  PyObject* values[2] = {0,0};
51370  if (unlikely(__pyx_kwds)) {
51371  Py_ssize_t kw_args;
51372  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
51373  switch (pos_args) {
51374  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51375  CYTHON_FALLTHROUGH;
51376  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51377  CYTHON_FALLTHROUGH;
51378  case 0: break;
51379  default: goto __pyx_L5_argtuple_error;
51380  }
51381  kw_args = PyDict_Size(__pyx_kwds);
51382  switch (pos_args) {
51383  case 0:
51384  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
51385  else goto __pyx_L5_argtuple_error;
51386  CYTHON_FALLTHROUGH;
51387  case 1:
51388  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
51389  else {
51390  __Pyx_RaiseArgtupleInvalid("eta_setUp", 1, 2, 2, 1); __PYX_ERR(0, 2951, __pyx_L3_error)
51391  }
51392  }
51393  if (unlikely(kw_args > 0)) {
51394  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta_setUp") < 0)) __PYX_ERR(0, 2951, __pyx_L3_error)
51395  }
51396  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
51397  goto __pyx_L5_argtuple_error;
51398  } else {
51399  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51400  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51401  }
51402  __pyx_v_x = values[0];
51403  __pyx_v_t = values[1];
51404  }
51405  goto __pyx_L4_argument_unpacking_done;
51406  __pyx_L5_argtuple_error:;
51407  __Pyx_RaiseArgtupleInvalid("eta_setUp", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2951, __pyx_L3_error)
51408  __pyx_L3_error:;
51409  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_setUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
51410  __Pyx_RefNannyFinishContext();
51411  return NULL;
51412  __pyx_L4_argument_unpacking_done:;
51413  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_8eta_setUp(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
51414 
51415  /* function exit code */
51416  __Pyx_RefNannyFinishContext();
51417  return __pyx_r;
51418 }
51419 
51420 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_8eta_setUp(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
51421  PyObject *__pyx_v_EtasetUp = NULL;
51422  PyObject *__pyx_v_i = NULL;
51423  PyObject *__pyx_v_wwi_setUp = NULL;
51424  PyObject *__pyx_r = NULL;
51425  __Pyx_RefNannyDeclarations
51426  PyObject *__pyx_t_1 = NULL;
51427  PyObject *__pyx_t_2 = NULL;
51428  PyObject *__pyx_t_3 = NULL;
51429  PyObject *__pyx_t_4 = NULL;
51430  int __pyx_t_5;
51431  PyObject *__pyx_t_6 = NULL;
51432  Py_ssize_t __pyx_t_7;
51433  PyObject *(*__pyx_t_8)(PyObject *);
51434  PyObject *__pyx_t_9 = NULL;
51435  PyObject *__pyx_t_10 = NULL;
51436  double __pyx_t_11;
51437  __Pyx_RefNannySetupContext("eta_setUp", 0);
51438 
51439  /* "WaveTools.py":2971
51440  *
51441  *
51442  * EtasetUp = 0. # <<<<<<<<<<<<<<
51443  * for i in range(0,self.N):
51444  * wwi_setUp = old_div((self.ai[i]**2*self.ki[i]),(2*sinh(2*self.ki[i]*self.depth)))
51445  */
51446  __Pyx_INCREF(__pyx_float_0_);
51447  __pyx_v_EtasetUp = __pyx_float_0_;
51448 
51449  /* "WaveTools.py":2972
51450  *
51451  * EtasetUp = 0.
51452  * for i in range(0,self.N): # <<<<<<<<<<<<<<
51453  * wwi_setUp = old_div((self.ai[i]**2*self.ki[i]),(2*sinh(2*self.ki[i]*self.depth)))
51454  * EtasetUp += wwi_setUp
51455  */
51456  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
51457  __Pyx_GOTREF(__pyx_t_2);
51458  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->N); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2972, __pyx_L1_error)
51459  __Pyx_GOTREF(__pyx_t_3);
51460  __pyx_t_4 = NULL;
51461  __pyx_t_5 = 0;
51462  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
51463  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
51464  if (likely(__pyx_t_4)) {
51465  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
51466  __Pyx_INCREF(__pyx_t_4);
51467  __Pyx_INCREF(function);
51468  __Pyx_DECREF_SET(__pyx_t_2, function);
51469  __pyx_t_5 = 1;
51470  }
51471  }
51472  #if CYTHON_FAST_PYCALL
51473  if (PyFunction_Check(__pyx_t_2)) {
51474  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_0, __pyx_t_3};
51475  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
51476  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
51477  __Pyx_GOTREF(__pyx_t_1);
51478  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51479  } else
51480  #endif
51481  #if CYTHON_FAST_PYCCALL
51482  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
51483  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_int_0, __pyx_t_3};
51484  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
51485  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
51486  __Pyx_GOTREF(__pyx_t_1);
51487  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51488  } else
51489  #endif
51490  {
51491  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2972, __pyx_L1_error)
51492  __Pyx_GOTREF(__pyx_t_6);
51493  if (__pyx_t_4) {
51494  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
51495  }
51496  __Pyx_INCREF(__pyx_int_0);
51497  __Pyx_GIVEREF(__pyx_int_0);
51498  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_int_0);
51499  __Pyx_GIVEREF(__pyx_t_3);
51500  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
51501  __pyx_t_3 = 0;
51502  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
51503  __Pyx_GOTREF(__pyx_t_1);
51504  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
51505  }
51506  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51507  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
51508  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
51509  __pyx_t_8 = NULL;
51510  } else {
51511  __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
51512  __Pyx_GOTREF(__pyx_t_2);
51513  __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2972, __pyx_L1_error)
51514  }
51515  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51516  for (;;) {
51517  if (likely(!__pyx_t_8)) {
51518  if (likely(PyList_CheckExact(__pyx_t_2))) {
51519  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
51520  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
51521  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2972, __pyx_L1_error)
51522  #else
51523  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
51524  __Pyx_GOTREF(__pyx_t_1);
51525  #endif
51526  } else {
51527  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
51528  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
51529  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2972, __pyx_L1_error)
51530  #else
51531  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
51532  __Pyx_GOTREF(__pyx_t_1);
51533  #endif
51534  }
51535  } else {
51536  __pyx_t_1 = __pyx_t_8(__pyx_t_2);
51537  if (unlikely(!__pyx_t_1)) {
51538  PyObject* exc_type = PyErr_Occurred();
51539  if (exc_type) {
51540  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
51541  else __PYX_ERR(0, 2972, __pyx_L1_error)
51542  }
51543  break;
51544  }
51545  __Pyx_GOTREF(__pyx_t_1);
51546  }
51547  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
51548  __pyx_t_1 = 0;
51549 
51550  /* "WaveTools.py":2973
51551  * EtasetUp = 0.
51552  * for i in range(0,self.N):
51553  * wwi_setUp = old_div((self.ai[i]**2*self.ki[i]),(2*sinh(2*self.ki[i]*self.depth))) # <<<<<<<<<<<<<<
51554  * EtasetUp += wwi_setUp
51555  * return EtasetUp
51556  */
51557  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_old_div); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2973, __pyx_L1_error)
51558  __Pyx_GOTREF(__pyx_t_6);
51559  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ai), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
51560  __Pyx_GOTREF(__pyx_t_3);
51561  __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __pyx_L1_error)
51562  __Pyx_GOTREF(__pyx_t_4);
51563  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51564  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
51565  __Pyx_GOTREF(__pyx_t_3);
51566  __pyx_t_9 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2973, __pyx_L1_error)
51567  __Pyx_GOTREF(__pyx_t_9);
51568  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
51569  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51570  __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->ki), __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
51571  __Pyx_GOTREF(__pyx_t_3);
51572  __pyx_t_4 = PyNumber_Multiply(__pyx_int_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __pyx_L1_error)
51573  __Pyx_GOTREF(__pyx_t_4);
51574  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51575  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
51576  __Pyx_GOTREF(__pyx_t_3);
51577  __pyx_t_10 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2973, __pyx_L1_error)
51578  __Pyx_GOTREF(__pyx_t_10);
51579  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
51580  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51581  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L1_error)
51582  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
51583  __pyx_t_10 = PyFloat_FromDouble((2.0 * sinh(__pyx_t_11))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2973, __pyx_L1_error)
51584  __Pyx_GOTREF(__pyx_t_10);
51585  __pyx_t_3 = NULL;
51586  __pyx_t_5 = 0;
51587  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
51588  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
51589  if (likely(__pyx_t_3)) {
51590  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
51591  __Pyx_INCREF(__pyx_t_3);
51592  __Pyx_INCREF(function);
51593  __Pyx_DECREF_SET(__pyx_t_6, function);
51594  __pyx_t_5 = 1;
51595  }
51596  }
51597  #if CYTHON_FAST_PYCALL
51598  if (PyFunction_Check(__pyx_t_6)) {
51599  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_9, __pyx_t_10};
51600  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __pyx_L1_error)
51601  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
51602  __Pyx_GOTREF(__pyx_t_1);
51603  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
51604  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
51605  } else
51606  #endif
51607  #if CYTHON_FAST_PYCCALL
51608  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
51609  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_9, __pyx_t_10};
51610  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __pyx_L1_error)
51611  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
51612  __Pyx_GOTREF(__pyx_t_1);
51613  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
51614  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
51615  } else
51616  #endif
51617  {
51618  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __pyx_L1_error)
51619  __Pyx_GOTREF(__pyx_t_4);
51620  if (__pyx_t_3) {
51621  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
51622  }
51623  __Pyx_GIVEREF(__pyx_t_9);
51624  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_9);
51625  __Pyx_GIVEREF(__pyx_t_10);
51626  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_10);
51627  __pyx_t_9 = 0;
51628  __pyx_t_10 = 0;
51629  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2973, __pyx_L1_error)
51630  __Pyx_GOTREF(__pyx_t_1);
51631  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
51632  }
51633  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
51634  __Pyx_XDECREF_SET(__pyx_v_wwi_setUp, __pyx_t_1);
51635  __pyx_t_1 = 0;
51636 
51637  /* "WaveTools.py":2974
51638  * for i in range(0,self.N):
51639  * wwi_setUp = old_div((self.ai[i]**2*self.ki[i]),(2*sinh(2*self.ki[i]*self.depth)))
51640  * EtasetUp += wwi_setUp # <<<<<<<<<<<<<<
51641  * return EtasetUp
51642  *
51643  */
51644  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_EtasetUp, __pyx_v_wwi_setUp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2974, __pyx_L1_error)
51645  __Pyx_GOTREF(__pyx_t_1);
51646  __Pyx_DECREF_SET(__pyx_v_EtasetUp, __pyx_t_1);
51647  __pyx_t_1 = 0;
51648 
51649  /* "WaveTools.py":2972
51650  *
51651  * EtasetUp = 0.
51652  * for i in range(0,self.N): # <<<<<<<<<<<<<<
51653  * wwi_setUp = old_div((self.ai[i]**2*self.ki[i]),(2*sinh(2*self.ki[i]*self.depth)))
51654  * EtasetUp += wwi_setUp
51655  */
51656  }
51657  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
51658 
51659  /* "WaveTools.py":2975
51660  * wwi_setUp = old_div((self.ai[i]**2*self.ki[i]),(2*sinh(2*self.ki[i]*self.depth)))
51661  * EtasetUp += wwi_setUp
51662  * return EtasetUp # <<<<<<<<<<<<<<
51663  *
51664  *
51665  */
51666  __Pyx_XDECREF(__pyx_r);
51667  __Pyx_INCREF(__pyx_v_EtasetUp);
51668  __pyx_r = __pyx_v_EtasetUp;
51669  goto __pyx_L0;
51670 
51671  /* "WaveTools.py":2951
51672  *
51673  * #set-up calculation
51674  * def eta_setUp(self,x,t): # <<<<<<<<<<<<<<
51675  * """Calculates the free surface elevation set up
51676  *
51677  */
51678 
51679  /* function exit code */
51680  __pyx_L1_error:;
51681  __Pyx_XDECREF(__pyx_t_1);
51682  __Pyx_XDECREF(__pyx_t_2);
51683  __Pyx_XDECREF(__pyx_t_3);
51684  __Pyx_XDECREF(__pyx_t_4);
51685  __Pyx_XDECREF(__pyx_t_6);
51686  __Pyx_XDECREF(__pyx_t_9);
51687  __Pyx_XDECREF(__pyx_t_10);
51688  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_setUp", __pyx_clineno, __pyx_lineno, __pyx_filename);
51689  __pyx_r = NULL;
51690  __pyx_L0:;
51691  __Pyx_XDECREF(__pyx_v_EtasetUp);
51692  __Pyx_XDECREF(__pyx_v_i);
51693  __Pyx_XDECREF(__pyx_v_wwi_setUp);
51694  __Pyx_XGIVEREF(__pyx_r);
51695  __Pyx_RefNannyFinishContext();
51696  return __pyx_r;
51697 }
51698 
51699 /* "WaveTools.py":2980
51700  *
51701  * #overall free surface elevation
51702  * def eta_overall(self,x,t,setUp=False): # <<<<<<<<<<<<<<
51703  * """Calculates the free surface elevation with 2nd order corrections
51704  *
51705  */
51706 
51707 /* Python wrapper */
51708 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_11eta_overall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
51709 static char __pyx_doc_9WaveTools_13RandomNLWaves_10eta_overall[] = "Calculates the free surface elevation with 2nd order corrections\n\n Uses 2nd order random wave theory\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
51710 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_11eta_overall = {"eta_overall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_11eta_overall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_10eta_overall};
51711 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_11eta_overall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
51712  PyObject *__pyx_v_x = 0;
51713  PyObject *__pyx_v_t = 0;
51714  PyObject *__pyx_v_setUp = 0;
51715  PyObject *__pyx_r = 0;
51716  __Pyx_RefNannyDeclarations
51717  __Pyx_RefNannySetupContext("eta_overall (wrapper)", 0);
51718  {
51719  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,&__pyx_n_s_setUp,0};
51720  PyObject* values[3] = {0,0,0};
51721  values[2] = ((PyObject *)Py_False);
51722  if (unlikely(__pyx_kwds)) {
51723  Py_ssize_t kw_args;
51724  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
51725  switch (pos_args) {
51726  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
51727  CYTHON_FALLTHROUGH;
51728  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51729  CYTHON_FALLTHROUGH;
51730  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51731  CYTHON_FALLTHROUGH;
51732  case 0: break;
51733  default: goto __pyx_L5_argtuple_error;
51734  }
51735  kw_args = PyDict_Size(__pyx_kwds);
51736  switch (pos_args) {
51737  case 0:
51738  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
51739  else goto __pyx_L5_argtuple_error;
51740  CYTHON_FALLTHROUGH;
51741  case 1:
51742  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
51743  else {
51744  __Pyx_RaiseArgtupleInvalid("eta_overall", 0, 2, 3, 1); __PYX_ERR(0, 2980, __pyx_L3_error)
51745  }
51746  CYTHON_FALLTHROUGH;
51747  case 2:
51748  if (kw_args > 0) {
51749  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setUp);
51750  if (value) { values[2] = value; kw_args--; }
51751  }
51752  }
51753  if (unlikely(kw_args > 0)) {
51754  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta_overall") < 0)) __PYX_ERR(0, 2980, __pyx_L3_error)
51755  }
51756  } else {
51757  switch (PyTuple_GET_SIZE(__pyx_args)) {
51758  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
51759  CYTHON_FALLTHROUGH;
51760  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51761  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51762  break;
51763  default: goto __pyx_L5_argtuple_error;
51764  }
51765  }
51766  __pyx_v_x = values[0];
51767  __pyx_v_t = values[1];
51768  __pyx_v_setUp = values[2];
51769  }
51770  goto __pyx_L4_argument_unpacking_done;
51771  __pyx_L5_argtuple_error:;
51772  __Pyx_RaiseArgtupleInvalid("eta_overall", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2980, __pyx_L3_error)
51773  __pyx_L3_error:;
51774  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_overall", __pyx_clineno, __pyx_lineno, __pyx_filename);
51775  __Pyx_RefNannyFinishContext();
51776  return NULL;
51777  __pyx_L4_argument_unpacking_done:;
51778  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_10eta_overall(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t, __pyx_v_setUp);
51779 
51780  /* function exit code */
51781  __Pyx_RefNannyFinishContext();
51782  return __pyx_r;
51783 }
51784 
51785 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_10eta_overall(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t, PyObject *__pyx_v_setUp) {
51786  double __pyx_v_xx[3];
51787  PyObject *__pyx_v_Etaoverall = NULL;
51788  PyObject *__pyx_r = NULL;
51789  __Pyx_RefNannyDeclarations
51790  PyObject *__pyx_t_1 = NULL;
51791  double __pyx_t_2;
51792  PyObject *__pyx_t_3 = NULL;
51793  PyObject *__pyx_t_4 = NULL;
51794  int __pyx_t_5;
51795  PyObject *__pyx_t_6 = NULL;
51796  int __pyx_t_7;
51797  PyObject *__pyx_t_8 = NULL;
51798  __Pyx_RefNannySetupContext("eta_overall", 0);
51799 
51800  /* "WaveTools.py":2999
51801  * """
51802  * cython.declare(xx=cython.double[3])
51803  * xx[0] = x[0] # <<<<<<<<<<<<<<
51804  * xx[1] = x[1]
51805  * xx[2] = x[2]
51806  */
51807  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2999, __pyx_L1_error)
51808  __Pyx_GOTREF(__pyx_t_1);
51809  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2999, __pyx_L1_error)
51810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51811  (__pyx_v_xx[0]) = __pyx_t_2;
51812 
51813  /* "WaveTools.py":3000
51814  * cython.declare(xx=cython.double[3])
51815  * xx[0] = x[0]
51816  * xx[1] = x[1] # <<<<<<<<<<<<<<
51817  * xx[2] = x[2]
51818  * Etaoverall = self.eta_linear(x,t) + self._cpp_eta_2ndOrder(xx,t) + self._cpp_eta_short(xx,t) + self._cpp_eta_long(xx,t)
51819  */
51820  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3000, __pyx_L1_error)
51821  __Pyx_GOTREF(__pyx_t_1);
51822  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3000, __pyx_L1_error)
51823  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51824  (__pyx_v_xx[1]) = __pyx_t_2;
51825 
51826  /* "WaveTools.py":3001
51827  * xx[0] = x[0]
51828  * xx[1] = x[1]
51829  * xx[2] = x[2] # <<<<<<<<<<<<<<
51830  * Etaoverall = self.eta_linear(x,t) + self._cpp_eta_2ndOrder(xx,t) + self._cpp_eta_short(xx,t) + self._cpp_eta_long(xx,t)
51831  * if setUp:
51832  */
51833  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3001, __pyx_L1_error)
51834  __Pyx_GOTREF(__pyx_t_1);
51835  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3001, __pyx_L1_error)
51836  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51837  (__pyx_v_xx[2]) = __pyx_t_2;
51838 
51839  /* "WaveTools.py":3002
51840  * xx[1] = x[1]
51841  * xx[2] = x[2]
51842  * Etaoverall = self.eta_linear(x,t) + self._cpp_eta_2ndOrder(xx,t) + self._cpp_eta_short(xx,t) + self._cpp_eta_long(xx,t) # <<<<<<<<<<<<<<
51843  * if setUp:
51844  * Etaoverall -= self.eta_setUp(xx,t)
51845  */
51846  __Pyx_INCREF(__pyx_v_self->eta_linear);
51847  __pyx_t_3 = __pyx_v_self->eta_linear; __pyx_t_4 = NULL;
51848  __pyx_t_5 = 0;
51849  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
51850  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
51851  if (likely(__pyx_t_4)) {
51852  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
51853  __Pyx_INCREF(__pyx_t_4);
51854  __Pyx_INCREF(function);
51855  __Pyx_DECREF_SET(__pyx_t_3, function);
51856  __pyx_t_5 = 1;
51857  }
51858  }
51859  #if CYTHON_FAST_PYCALL
51860  if (PyFunction_Check(__pyx_t_3)) {
51861  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_x, __pyx_v_t};
51862  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3002, __pyx_L1_error)
51863  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
51864  __Pyx_GOTREF(__pyx_t_1);
51865  } else
51866  #endif
51867  #if CYTHON_FAST_PYCCALL
51868  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
51869  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_x, __pyx_v_t};
51870  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3002, __pyx_L1_error)
51871  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
51872  __Pyx_GOTREF(__pyx_t_1);
51873  } else
51874  #endif
51875  {
51876  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3002, __pyx_L1_error)
51877  __Pyx_GOTREF(__pyx_t_6);
51878  if (__pyx_t_4) {
51879  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
51880  }
51881  __Pyx_INCREF(__pyx_v_x);
51882  __Pyx_GIVEREF(__pyx_v_x);
51883  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_x);
51884  __Pyx_INCREF(__pyx_v_t);
51885  __Pyx_GIVEREF(__pyx_v_t);
51886  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_t);
51887  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3002, __pyx_L1_error)
51888  __Pyx_GOTREF(__pyx_t_1);
51889  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
51890  }
51891  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51892  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3002, __pyx_L1_error)
51893  __pyx_t_3 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta_2ndOrder(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3002, __pyx_L1_error)
51894  __Pyx_GOTREF(__pyx_t_3);
51895  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3002, __pyx_L1_error)
51896  __Pyx_GOTREF(__pyx_t_6);
51897  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51898  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51899  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3002, __pyx_L1_error)
51900  __pyx_t_3 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta_short(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3002, __pyx_L1_error)
51901  __Pyx_GOTREF(__pyx_t_3);
51902  __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3002, __pyx_L1_error)
51903  __Pyx_GOTREF(__pyx_t_1);
51904  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
51905  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51906  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3002, __pyx_L1_error)
51907  __pyx_t_3 = PyFloat_FromDouble(((struct __pyx_vtabstruct_9WaveTools_RandomNLWaves *)__pyx_v_self->__pyx_vtab)->_cpp_eta_long(__pyx_v_self, __pyx_v_xx, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3002, __pyx_L1_error)
51908  __Pyx_GOTREF(__pyx_t_3);
51909  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3002, __pyx_L1_error)
51910  __Pyx_GOTREF(__pyx_t_6);
51911  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51912  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51913  __pyx_v_Etaoverall = __pyx_t_6;
51914  __pyx_t_6 = 0;
51915 
51916  /* "WaveTools.py":3003
51917  * xx[2] = x[2]
51918  * Etaoverall = self.eta_linear(x,t) + self._cpp_eta_2ndOrder(xx,t) + self._cpp_eta_short(xx,t) + self._cpp_eta_long(xx,t)
51919  * if setUp: # <<<<<<<<<<<<<<
51920  * Etaoverall -= self.eta_setUp(xx,t)
51921  * return Etaoverall
51922  */
51923  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_setUp); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 3003, __pyx_L1_error)
51924  if (__pyx_t_7) {
51925 
51926  /* "WaveTools.py":3004
51927  * Etaoverall = self.eta_linear(x,t) + self._cpp_eta_2ndOrder(xx,t) + self._cpp_eta_short(xx,t) + self._cpp_eta_long(xx,t)
51928  * if setUp:
51929  * Etaoverall -= self.eta_setUp(xx,t) # <<<<<<<<<<<<<<
51930  * return Etaoverall
51931  *
51932  */
51933  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta_setUp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3004, __pyx_L1_error)
51934  __Pyx_GOTREF(__pyx_t_3);
51935  __pyx_t_1 = __Pyx_carray_to_py_double(__pyx_v_xx, 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3004, __pyx_L1_error)
51936  __Pyx_GOTREF(__pyx_t_1);
51937  __pyx_t_4 = NULL;
51938  __pyx_t_5 = 0;
51939  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
51940  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
51941  if (likely(__pyx_t_4)) {
51942  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
51943  __Pyx_INCREF(__pyx_t_4);
51944  __Pyx_INCREF(function);
51945  __Pyx_DECREF_SET(__pyx_t_3, function);
51946  __pyx_t_5 = 1;
51947  }
51948  }
51949  #if CYTHON_FAST_PYCALL
51950  if (PyFunction_Check(__pyx_t_3)) {
51951  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_t};
51952  __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3004, __pyx_L1_error)
51953  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
51954  __Pyx_GOTREF(__pyx_t_6);
51955  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51956  } else
51957  #endif
51958  #if CYTHON_FAST_PYCCALL
51959  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
51960  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_t};
51961  __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3004, __pyx_L1_error)
51962  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
51963  __Pyx_GOTREF(__pyx_t_6);
51964  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51965  } else
51966  #endif
51967  {
51968  __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3004, __pyx_L1_error)
51969  __Pyx_GOTREF(__pyx_t_8);
51970  if (__pyx_t_4) {
51971  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
51972  }
51973  __Pyx_GIVEREF(__pyx_t_1);
51974  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_1);
51975  __Pyx_INCREF(__pyx_v_t);
51976  __Pyx_GIVEREF(__pyx_v_t);
51977  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_t);
51978  __pyx_t_1 = 0;
51979  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3004, __pyx_L1_error)
51980  __Pyx_GOTREF(__pyx_t_6);
51981  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
51982  }
51983  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
51984  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_Etaoverall, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3004, __pyx_L1_error)
51985  __Pyx_GOTREF(__pyx_t_3);
51986  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
51987  __Pyx_DECREF_SET(__pyx_v_Etaoverall, __pyx_t_3);
51988  __pyx_t_3 = 0;
51989 
51990  /* "WaveTools.py":3003
51991  * xx[2] = x[2]
51992  * Etaoverall = self.eta_linear(x,t) + self._cpp_eta_2ndOrder(xx,t) + self._cpp_eta_short(xx,t) + self._cpp_eta_long(xx,t)
51993  * if setUp: # <<<<<<<<<<<<<<
51994  * Etaoverall -= self.eta_setUp(xx,t)
51995  * return Etaoverall
51996  */
51997  }
51998 
51999  /* "WaveTools.py":3005
52000  * if setUp:
52001  * Etaoverall -= self.eta_setUp(xx,t)
52002  * return Etaoverall # <<<<<<<<<<<<<<
52003  *
52004  *
52005  */
52006  __Pyx_XDECREF(__pyx_r);
52007  __Pyx_INCREF(__pyx_v_Etaoverall);
52008  __pyx_r = __pyx_v_Etaoverall;
52009  goto __pyx_L0;
52010 
52011  /* "WaveTools.py":2980
52012  *
52013  * #overall free surface elevation
52014  * def eta_overall(self,x,t,setUp=False): # <<<<<<<<<<<<<<
52015  * """Calculates the free surface elevation with 2nd order corrections
52016  *
52017  */
52018 
52019  /* function exit code */
52020  __pyx_L1_error:;
52021  __Pyx_XDECREF(__pyx_t_1);
52022  __Pyx_XDECREF(__pyx_t_3);
52023  __Pyx_XDECREF(__pyx_t_4);
52024  __Pyx_XDECREF(__pyx_t_6);
52025  __Pyx_XDECREF(__pyx_t_8);
52026  __Pyx_AddTraceback("WaveTools.RandomNLWaves.eta_overall", __pyx_clineno, __pyx_lineno, __pyx_filename);
52027  __pyx_r = NULL;
52028  __pyx_L0:;
52029  __Pyx_XDECREF(__pyx_v_Etaoverall);
52030  __Pyx_XGIVEREF(__pyx_r);
52031  __Pyx_RefNannyFinishContext();
52032  return __pyx_r;
52033 }
52034 
52035 /* "WaveTools.py":3009
52036  *
52037  *
52038  * def writeEtaSeries(self,Tstart,Tend,dt,x0,fname, mode="all",setUp=False, Lgen=np.zeros(3,)): # <<<<<<<<<<<<<<
52039  * """Writes a timeseries of the free-surface elevation
52040  *
52041  */
52042 
52043 /* Python wrapper */
52044 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_13writeEtaSeries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
52045 static char __pyx_doc_9WaveTools_13RandomNLWaves_12writeEtaSeries[] = "Writes a timeseries of the free-surface elevation\n\n It also returns the free surface elevation as a time-eta array.\n If Lgen !=[0.,0.,0.,] then Tstart is modified to account for the\n wave transformation at the most remote point of the relaxation zone.\n\n Parameters\n ----------\n Tstart : float\n Start time\n Tend : float\n End time\n dt : float\n Sampling interval\n x0 : numpy.ndarray\n Position vector of the time series\n fname : string\n Filename for timeseries file\n mode: Optional[string]\n Mode of set up calculations (all, long, short, setup)\n setUp: Optional[bool]\n Switch for activating setup calculation\n Lgen : Optional[numpy.ndarray]\n Length vector of relaxation zone\n\n\n Returns\n ----------\n numpy.ndarray\n 2D numpy array Nx2 containing free-surface elevation in time.\n ";
52046 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_13writeEtaSeries = {"writeEtaSeries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_13writeEtaSeries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_12writeEtaSeries};
52047 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_13writeEtaSeries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
52048  PyObject *__pyx_v_Tstart = 0;
52049  PyObject *__pyx_v_Tend = 0;
52050  PyObject *__pyx_v_dt = 0;
52051  PyObject *__pyx_v_x0 = 0;
52052  PyObject *__pyx_v_fname = 0;
52053  PyObject *__pyx_v_mode = 0;
52054  PyObject *__pyx_v_setUp = 0;
52055  PyObject *__pyx_v_Lgen = 0;
52056  PyObject *__pyx_r = 0;
52057  __Pyx_RefNannyDeclarations
52058  __Pyx_RefNannySetupContext("writeEtaSeries (wrapper)", 0);
52059  {
52060  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Tstart,&__pyx_n_s_Tend,&__pyx_n_s_dt,&__pyx_n_s_x0,&__pyx_n_s_fname,&__pyx_n_s_mode,&__pyx_n_s_setUp,&__pyx_n_s_Lgen,0};
52061  PyObject* values[8] = {0,0,0,0,0,0,0,0};
52062  values[5] = ((PyObject *)__pyx_n_s_all);
52063  values[6] = ((PyObject *)Py_False);
52064  values[7] = __pyx_k__51;
52065  if (unlikely(__pyx_kwds)) {
52066  Py_ssize_t kw_args;
52067  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
52068  switch (pos_args) {
52069  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
52070  CYTHON_FALLTHROUGH;
52071  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
52072  CYTHON_FALLTHROUGH;
52073  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
52074  CYTHON_FALLTHROUGH;
52075  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
52076  CYTHON_FALLTHROUGH;
52077  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
52078  CYTHON_FALLTHROUGH;
52079  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
52080  CYTHON_FALLTHROUGH;
52081  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
52082  CYTHON_FALLTHROUGH;
52083  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
52084  CYTHON_FALLTHROUGH;
52085  case 0: break;
52086  default: goto __pyx_L5_argtuple_error;
52087  }
52088  kw_args = PyDict_Size(__pyx_kwds);
52089  switch (pos_args) {
52090  case 0:
52091  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tstart)) != 0)) kw_args--;
52092  else goto __pyx_L5_argtuple_error;
52093  CYTHON_FALLTHROUGH;
52094  case 1:
52095  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tend)) != 0)) kw_args--;
52096  else {
52097  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 5, 8, 1); __PYX_ERR(0, 3009, __pyx_L3_error)
52098  }
52099  CYTHON_FALLTHROUGH;
52100  case 2:
52101  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dt)) != 0)) kw_args--;
52102  else {
52103  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 5, 8, 2); __PYX_ERR(0, 3009, __pyx_L3_error)
52104  }
52105  CYTHON_FALLTHROUGH;
52106  case 3:
52107  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
52108  else {
52109  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 5, 8, 3); __PYX_ERR(0, 3009, __pyx_L3_error)
52110  }
52111  CYTHON_FALLTHROUGH;
52112  case 4:
52113  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fname)) != 0)) kw_args--;
52114  else {
52115  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 5, 8, 4); __PYX_ERR(0, 3009, __pyx_L3_error)
52116  }
52117  CYTHON_FALLTHROUGH;
52118  case 5:
52119  if (kw_args > 0) {
52120  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
52121  if (value) { values[5] = value; kw_args--; }
52122  }
52123  CYTHON_FALLTHROUGH;
52124  case 6:
52125  if (kw_args > 0) {
52126  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_setUp);
52127  if (value) { values[6] = value; kw_args--; }
52128  }
52129  CYTHON_FALLTHROUGH;
52130  case 7:
52131  if (kw_args > 0) {
52132  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Lgen);
52133  if (value) { values[7] = value; kw_args--; }
52134  }
52135  }
52136  if (unlikely(kw_args > 0)) {
52137  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "writeEtaSeries") < 0)) __PYX_ERR(0, 3009, __pyx_L3_error)
52138  }
52139  } else {
52140  switch (PyTuple_GET_SIZE(__pyx_args)) {
52141  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
52142  CYTHON_FALLTHROUGH;
52143  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
52144  CYTHON_FALLTHROUGH;
52145  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
52146  CYTHON_FALLTHROUGH;
52147  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
52148  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
52149  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
52150  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
52151  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
52152  break;
52153  default: goto __pyx_L5_argtuple_error;
52154  }
52155  }
52156  __pyx_v_Tstart = values[0];
52157  __pyx_v_Tend = values[1];
52158  __pyx_v_dt = values[2];
52159  __pyx_v_x0 = values[3];
52160  __pyx_v_fname = values[4];
52161  __pyx_v_mode = values[5];
52162  __pyx_v_setUp = values[6];
52163  __pyx_v_Lgen = values[7];
52164  }
52165  goto __pyx_L4_argument_unpacking_done;
52166  __pyx_L5_argtuple_error:;
52167  __Pyx_RaiseArgtupleInvalid("writeEtaSeries", 0, 5, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3009, __pyx_L3_error)
52168  __pyx_L3_error:;
52169  __Pyx_AddTraceback("WaveTools.RandomNLWaves.writeEtaSeries", __pyx_clineno, __pyx_lineno, __pyx_filename);
52170  __Pyx_RefNannyFinishContext();
52171  return NULL;
52172  __pyx_L4_argument_unpacking_done:;
52173  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_12writeEtaSeries(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_dt, __pyx_v_x0, __pyx_v_fname, __pyx_v_mode, __pyx_v_setUp, __pyx_v_Lgen);
52174 
52175  /* function exit code */
52176  __Pyx_RefNannyFinishContext();
52177  return __pyx_r;
52178 }
52179 
52180 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_12writeEtaSeries(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_dt, PyObject *__pyx_v_x0, PyObject *__pyx_v_fname, PyObject *__pyx_v_mode, PyObject *__pyx_v_setUp, PyObject *__pyx_v_Lgen) {
52181  PyObject *__pyx_v_Tlag = NULL;
52182  PyObject *__pyx_v_j = NULL;
52183  PyObject *__pyx_v_Nseries = NULL;
52184  PyObject *__pyx_v_timelst = NULL;
52185  PyObject *__pyx_v_series = NULL;
52186  PyObject *__pyx_v_i = NULL;
52187  PyObject *__pyx_v_time = NULL;
52188  PyObject *__pyx_v_delimiter = NULL;
52189  PyObject *__pyx_r = NULL;
52190  __Pyx_RefNannyDeclarations
52191  PyObject *__pyx_t_1 = NULL;
52192  PyObject *__pyx_t_2 = NULL;
52193  PyObject *__pyx_t_3 = NULL;
52194  int __pyx_t_4;
52195  Py_ssize_t __pyx_t_5;
52196  PyObject *__pyx_t_6 = NULL;
52197  PyObject *(*__pyx_t_7)(PyObject *);
52198  PyObject *__pyx_t_8 = NULL;
52199  PyObject *__pyx_t_9 = NULL;
52200  int __pyx_t_10;
52201  PyObject *__pyx_t_11 = NULL;
52202  __Pyx_RefNannySetupContext("writeEtaSeries", 0);
52203  __Pyx_INCREF(__pyx_v_Tstart);
52204 
52205  /* "WaveTools.py":3041
52206  * 2D numpy array Nx2 containing free-surface elevation in time.
52207  * """
52208  * if sum(Lgen[:]*self.waveDir[:])< 0 : # <<<<<<<<<<<<<<
52209  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
52210  * sys.exit(1)
52211  */
52212  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3041, __pyx_L1_error)
52213  __Pyx_GOTREF(__pyx_t_1);
52214  __pyx_t_2 = __Pyx_PyObject_GetSlice(((PyObject *)__pyx_v_self->waveDir), 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3041, __pyx_L1_error)
52215  __Pyx_GOTREF(__pyx_t_2);
52216  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3041, __pyx_L1_error)
52217  __Pyx_GOTREF(__pyx_t_3);
52218  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52219  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52220  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3041, __pyx_L1_error)
52221  __Pyx_GOTREF(__pyx_t_2);
52222  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52223  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3041, __pyx_L1_error)
52224  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52225  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3041, __pyx_L1_error)
52226  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52227  if (__pyx_t_4) {
52228 
52229  /* "WaveTools.py":3042
52230  * """
52231  * if sum(Lgen[:]*self.waveDir[:])< 0 :
52232  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction') # <<<<<<<<<<<<<<
52233  * sys.exit(1)
52234  *
52235  */
52236  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3042, __pyx_L1_error)
52237  __Pyx_GOTREF(__pyx_t_2);
52238  __pyx_t_1 = NULL;
52239  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
52240  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
52241  if (likely(__pyx_t_1)) {
52242  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52243  __Pyx_INCREF(__pyx_t_1);
52244  __Pyx_INCREF(function);
52245  __Pyx_DECREF_SET(__pyx_t_2, function);
52246  }
52247  }
52248  __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_s_ERROR_Wavetools_py_Location_vect) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_ERROR_Wavetools_py_Location_vect);
52249  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
52250  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3042, __pyx_L1_error)
52251  __Pyx_GOTREF(__pyx_t_3);
52252  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52253  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52254 
52255  /* "WaveTools.py":3043
52256  * if sum(Lgen[:]*self.waveDir[:])< 0 :
52257  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
52258  * sys.exit(1) # <<<<<<<<<<<<<<
52259  *
52260  * Tlag = np.zeros(len(self.omega),)
52261  */
52262  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3043, __pyx_L1_error)
52263  __Pyx_GOTREF(__pyx_t_2);
52264  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3043, __pyx_L1_error)
52265  __Pyx_GOTREF(__pyx_t_1);
52266  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52267  __pyx_t_2 = NULL;
52268  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
52269  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
52270  if (likely(__pyx_t_2)) {
52271  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
52272  __Pyx_INCREF(__pyx_t_2);
52273  __Pyx_INCREF(function);
52274  __Pyx_DECREF_SET(__pyx_t_1, function);
52275  }
52276  }
52277  __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_1);
52278  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
52279  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3043, __pyx_L1_error)
52280  __Pyx_GOTREF(__pyx_t_3);
52281  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52282  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52283 
52284  /* "WaveTools.py":3041
52285  * 2D numpy array Nx2 containing free-surface elevation in time.
52286  * """
52287  * if sum(Lgen[:]*self.waveDir[:])< 0 : # <<<<<<<<<<<<<<
52288  * logEvent('ERROR! Wavetools.py: Location vector of generation zone should not be opposite to the wave direction')
52289  * sys.exit(1)
52290  */
52291  }
52292 
52293  /* "WaveTools.py":3045
52294  * sys.exit(1)
52295  *
52296  * Tlag = np.zeros(len(self.omega),) # <<<<<<<<<<<<<<
52297  * for j in range(len(self.omega)):
52298  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
52299  */
52300  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3045, __pyx_L1_error)
52301  __Pyx_GOTREF(__pyx_t_1);
52302  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3045, __pyx_L1_error)
52303  __Pyx_GOTREF(__pyx_t_2);
52304  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52305  __pyx_t_1 = ((PyObject *)__pyx_v_self->omega);
52306  __Pyx_INCREF(__pyx_t_1);
52307  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3045, __pyx_L1_error)
52308  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52309  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3045, __pyx_L1_error)
52310  __Pyx_GOTREF(__pyx_t_1);
52311  __pyx_t_6 = NULL;
52312  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
52313  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
52314  if (likely(__pyx_t_6)) {
52315  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52316  __Pyx_INCREF(__pyx_t_6);
52317  __Pyx_INCREF(function);
52318  __Pyx_DECREF_SET(__pyx_t_2, function);
52319  }
52320  }
52321  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
52322  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
52323  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52324  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3045, __pyx_L1_error)
52325  __Pyx_GOTREF(__pyx_t_3);
52326  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52327  __pyx_v_Tlag = __pyx_t_3;
52328  __pyx_t_3 = 0;
52329 
52330  /* "WaveTools.py":3046
52331  *
52332  * Tlag = np.zeros(len(self.omega),)
52333  * for j in range(len(self.omega)): # <<<<<<<<<<<<<<
52334  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
52335  * Tlag = max(Tlag)
52336  */
52337  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3046, __pyx_L1_error)
52338  __Pyx_GOTREF(__pyx_t_2);
52339  __pyx_t_1 = ((PyObject *)__pyx_v_self->omega);
52340  __Pyx_INCREF(__pyx_t_1);
52341  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3046, __pyx_L1_error)
52342  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52343  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3046, __pyx_L1_error)
52344  __Pyx_GOTREF(__pyx_t_1);
52345  __pyx_t_6 = NULL;
52346  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
52347  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
52348  if (likely(__pyx_t_6)) {
52349  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52350  __Pyx_INCREF(__pyx_t_6);
52351  __Pyx_INCREF(function);
52352  __Pyx_DECREF_SET(__pyx_t_2, function);
52353  }
52354  }
52355  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
52356  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
52357  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52358  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3046, __pyx_L1_error)
52359  __Pyx_GOTREF(__pyx_t_3);
52360  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52361  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
52362  __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
52363  __pyx_t_7 = NULL;
52364  } else {
52365  __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3046, __pyx_L1_error)
52366  __Pyx_GOTREF(__pyx_t_2);
52367  __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3046, __pyx_L1_error)
52368  }
52369  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52370  for (;;) {
52371  if (likely(!__pyx_t_7)) {
52372  if (likely(PyList_CheckExact(__pyx_t_2))) {
52373  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
52374  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
52375  __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3046, __pyx_L1_error)
52376  #else
52377  __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3046, __pyx_L1_error)
52378  __Pyx_GOTREF(__pyx_t_3);
52379  #endif
52380  } else {
52381  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
52382  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
52383  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3046, __pyx_L1_error)
52384  #else
52385  __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3046, __pyx_L1_error)
52386  __Pyx_GOTREF(__pyx_t_3);
52387  #endif
52388  }
52389  } else {
52390  __pyx_t_3 = __pyx_t_7(__pyx_t_2);
52391  if (unlikely(!__pyx_t_3)) {
52392  PyObject* exc_type = PyErr_Occurred();
52393  if (exc_type) {
52394  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
52395  else __PYX_ERR(0, 3046, __pyx_L1_error)
52396  }
52397  break;
52398  }
52399  __Pyx_GOTREF(__pyx_t_3);
52400  }
52401  __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
52402  __pyx_t_3 = 0;
52403 
52404  /* "WaveTools.py":3047
52405  * Tlag = np.zeros(len(self.omega),)
52406  * for j in range(len(self.omega)):
52407  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j]) # <<<<<<<<<<<<<<
52408  * Tlag = max(Tlag)
52409  * Tstart = Tstart - Tlag
52410  */
52411  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
52412  __Pyx_GOTREF(__pyx_t_1);
52413  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3047, __pyx_L1_error)
52414  __Pyx_GOTREF(__pyx_t_6);
52415  __Pyx_INCREF(__pyx_v_j);
52416  __Pyx_GIVEREF(__pyx_v_j);
52417  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_j);
52418  __Pyx_INCREF(__pyx_slice__4);
52419  __Pyx_GIVEREF(__pyx_slice__4);
52420  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__4);
52421  __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->kDir), __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3047, __pyx_L1_error)
52422  __Pyx_GOTREF(__pyx_t_8);
52423  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
52424  __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_Lgen, 0, 0, NULL, NULL, &__pyx_slice__4, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3047, __pyx_L1_error)
52425  __Pyx_GOTREF(__pyx_t_6);
52426  __pyx_t_9 = PyNumber_Multiply(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L1_error)
52427  __Pyx_GOTREF(__pyx_t_9);
52428  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
52429  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
52430  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3047, __pyx_L1_error)
52431  __Pyx_GOTREF(__pyx_t_6);
52432  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52433  __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->omega), __pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3047, __pyx_L1_error)
52434  __Pyx_GOTREF(__pyx_t_9);
52435  __pyx_t_8 = NULL;
52436  __pyx_t_10 = 0;
52437  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
52438  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
52439  if (likely(__pyx_t_8)) {
52440  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
52441  __Pyx_INCREF(__pyx_t_8);
52442  __Pyx_INCREF(function);
52443  __Pyx_DECREF_SET(__pyx_t_1, function);
52444  __pyx_t_10 = 1;
52445  }
52446  }
52447  #if CYTHON_FAST_PYCALL
52448  if (PyFunction_Check(__pyx_t_1)) {
52449  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_9};
52450  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3047, __pyx_L1_error)
52451  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
52452  __Pyx_GOTREF(__pyx_t_3);
52453  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
52454  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52455  } else
52456  #endif
52457  #if CYTHON_FAST_PYCCALL
52458  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
52459  PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_6, __pyx_t_9};
52460  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3047, __pyx_L1_error)
52461  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
52462  __Pyx_GOTREF(__pyx_t_3);
52463  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
52464  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52465  } else
52466  #endif
52467  {
52468  __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3047, __pyx_L1_error)
52469  __Pyx_GOTREF(__pyx_t_11);
52470  if (__pyx_t_8) {
52471  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
52472  }
52473  __Pyx_GIVEREF(__pyx_t_6);
52474  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_6);
52475  __Pyx_GIVEREF(__pyx_t_9);
52476  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_9);
52477  __pyx_t_6 = 0;
52478  __pyx_t_9 = 0;
52479  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3047, __pyx_L1_error)
52480  __Pyx_GOTREF(__pyx_t_3);
52481  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
52482  }
52483  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52484  if (unlikely(PyObject_SetItem(__pyx_v_Tlag, __pyx_v_j, __pyx_t_3) < 0)) __PYX_ERR(0, 3047, __pyx_L1_error)
52485  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52486 
52487  /* "WaveTools.py":3046
52488  *
52489  * Tlag = np.zeros(len(self.omega),)
52490  * for j in range(len(self.omega)): # <<<<<<<<<<<<<<
52491  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
52492  * Tlag = max(Tlag)
52493  */
52494  }
52495  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52496 
52497  /* "WaveTools.py":3048
52498  * for j in range(len(self.omega)):
52499  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
52500  * Tlag = max(Tlag) # <<<<<<<<<<<<<<
52501  * Tstart = Tstart - Tlag
52502  *
52503  */
52504  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_Tlag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3048, __pyx_L1_error)
52505  __Pyx_GOTREF(__pyx_t_2);
52506  __Pyx_DECREF_SET(__pyx_v_Tlag, __pyx_t_2);
52507  __pyx_t_2 = 0;
52508 
52509  /* "WaveTools.py":3049
52510  * Tlag[j] = old_div(sum(self.kDir[j,:]*Lgen[:]),self.omega[j])
52511  * Tlag = max(Tlag)
52512  * Tstart = Tstart - Tlag # <<<<<<<<<<<<<<
52513  *
52514  * Nseries = int(old_div((Tend - Tstart),dt)) + 1
52515  */
52516  __pyx_t_2 = PyNumber_Subtract(__pyx_v_Tstart, __pyx_v_Tlag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3049, __pyx_L1_error)
52517  __Pyx_GOTREF(__pyx_t_2);
52518  __Pyx_DECREF_SET(__pyx_v_Tstart, __pyx_t_2);
52519  __pyx_t_2 = 0;
52520 
52521  /* "WaveTools.py":3051
52522  * Tstart = Tstart - Tlag
52523  *
52524  * Nseries = int(old_div((Tend - Tstart),dt)) + 1 # <<<<<<<<<<<<<<
52525  * timelst=np.linspace(Tstart, Tend, Nseries)
52526  * series = np.zeros((Nseries,2),)
52527  */
52528  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3051, __pyx_L1_error)
52529  __Pyx_GOTREF(__pyx_t_3);
52530  __pyx_t_1 = PyNumber_Subtract(__pyx_v_Tend, __pyx_v_Tstart); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3051, __pyx_L1_error)
52531  __Pyx_GOTREF(__pyx_t_1);
52532  __pyx_t_11 = NULL;
52533  __pyx_t_10 = 0;
52534  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
52535  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
52536  if (likely(__pyx_t_11)) {
52537  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
52538  __Pyx_INCREF(__pyx_t_11);
52539  __Pyx_INCREF(function);
52540  __Pyx_DECREF_SET(__pyx_t_3, function);
52541  __pyx_t_10 = 1;
52542  }
52543  }
52544  #if CYTHON_FAST_PYCALL
52545  if (PyFunction_Check(__pyx_t_3)) {
52546  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_dt};
52547  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
52548  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
52549  __Pyx_GOTREF(__pyx_t_2);
52550  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52551  } else
52552  #endif
52553  #if CYTHON_FAST_PYCCALL
52554  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
52555  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_1, __pyx_v_dt};
52556  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
52557  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
52558  __Pyx_GOTREF(__pyx_t_2);
52559  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52560  } else
52561  #endif
52562  {
52563  __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3051, __pyx_L1_error)
52564  __Pyx_GOTREF(__pyx_t_9);
52565  if (__pyx_t_11) {
52566  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11); __pyx_t_11 = NULL;
52567  }
52568  __Pyx_GIVEREF(__pyx_t_1);
52569  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_t_1);
52570  __Pyx_INCREF(__pyx_v_dt);
52571  __Pyx_GIVEREF(__pyx_v_dt);
52572  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_v_dt);
52573  __pyx_t_1 = 0;
52574  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
52575  __Pyx_GOTREF(__pyx_t_2);
52576  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52577  }
52578  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52579  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3051, __pyx_L1_error)
52580  __Pyx_GOTREF(__pyx_t_3);
52581  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52582  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3051, __pyx_L1_error)
52583  __Pyx_GOTREF(__pyx_t_2);
52584  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52585  __pyx_v_Nseries = __pyx_t_2;
52586  __pyx_t_2 = 0;
52587 
52588  /* "WaveTools.py":3052
52589  *
52590  * Nseries = int(old_div((Tend - Tstart),dt)) + 1
52591  * timelst=np.linspace(Tstart, Tend, Nseries) # <<<<<<<<<<<<<<
52592  * series = np.zeros((Nseries,2),)
52593  * series[:,0] = timelst
52594  */
52595  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3052, __pyx_L1_error)
52596  __Pyx_GOTREF(__pyx_t_3);
52597  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_linspace); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3052, __pyx_L1_error)
52598  __Pyx_GOTREF(__pyx_t_9);
52599  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52600  __pyx_t_3 = NULL;
52601  __pyx_t_10 = 0;
52602  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
52603  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
52604  if (likely(__pyx_t_3)) {
52605  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
52606  __Pyx_INCREF(__pyx_t_3);
52607  __Pyx_INCREF(function);
52608  __Pyx_DECREF_SET(__pyx_t_9, function);
52609  __pyx_t_10 = 1;
52610  }
52611  }
52612  #if CYTHON_FAST_PYCALL
52613  if (PyFunction_Check(__pyx_t_9)) {
52614  PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Nseries};
52615  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error)
52616  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52617  __Pyx_GOTREF(__pyx_t_2);
52618  } else
52619  #endif
52620  #if CYTHON_FAST_PYCCALL
52621  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
52622  PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_Nseries};
52623  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error)
52624  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52625  __Pyx_GOTREF(__pyx_t_2);
52626  } else
52627  #endif
52628  {
52629  __pyx_t_1 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3052, __pyx_L1_error)
52630  __Pyx_GOTREF(__pyx_t_1);
52631  if (__pyx_t_3) {
52632  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
52633  }
52634  __Pyx_INCREF(__pyx_v_Tstart);
52635  __Pyx_GIVEREF(__pyx_v_Tstart);
52636  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_v_Tstart);
52637  __Pyx_INCREF(__pyx_v_Tend);
52638  __Pyx_GIVEREF(__pyx_v_Tend);
52639  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_v_Tend);
52640  __Pyx_INCREF(__pyx_v_Nseries);
52641  __Pyx_GIVEREF(__pyx_v_Nseries);
52642  PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_10, __pyx_v_Nseries);
52643  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3052, __pyx_L1_error)
52644  __Pyx_GOTREF(__pyx_t_2);
52645  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52646  }
52647  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52648  __pyx_v_timelst = __pyx_t_2;
52649  __pyx_t_2 = 0;
52650 
52651  /* "WaveTools.py":3053
52652  * Nseries = int(old_div((Tend - Tstart),dt)) + 1
52653  * timelst=np.linspace(Tstart, Tend, Nseries)
52654  * series = np.zeros((Nseries,2),) # <<<<<<<<<<<<<<
52655  * series[:,0] = timelst
52656  * for i in range(len(timelst)):
52657  */
52658  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3053, __pyx_L1_error)
52659  __Pyx_GOTREF(__pyx_t_9);
52660  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error)
52661  __Pyx_GOTREF(__pyx_t_1);
52662  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52663  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3053, __pyx_L1_error)
52664  __Pyx_GOTREF(__pyx_t_9);
52665  __Pyx_INCREF(__pyx_v_Nseries);
52666  __Pyx_GIVEREF(__pyx_v_Nseries);
52667  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_Nseries);
52668  __Pyx_INCREF(__pyx_int_2);
52669  __Pyx_GIVEREF(__pyx_int_2);
52670  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_2);
52671  __pyx_t_3 = NULL;
52672  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
52673  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
52674  if (likely(__pyx_t_3)) {
52675  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
52676  __Pyx_INCREF(__pyx_t_3);
52677  __Pyx_INCREF(function);
52678  __Pyx_DECREF_SET(__pyx_t_1, function);
52679  }
52680  }
52681  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
52682  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52683  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52684  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error)
52685  __Pyx_GOTREF(__pyx_t_2);
52686  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52687  __pyx_v_series = __pyx_t_2;
52688  __pyx_t_2 = 0;
52689 
52690  /* "WaveTools.py":3054
52691  * timelst=np.linspace(Tstart, Tend, Nseries)
52692  * series = np.zeros((Nseries,2),)
52693  * series[:,0] = timelst # <<<<<<<<<<<<<<
52694  * for i in range(len(timelst)):
52695  * time = series[i,0]
52696  */
52697  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_tuple__25, __pyx_v_timelst) < 0)) __PYX_ERR(0, 3054, __pyx_L1_error)
52698 
52699  /* "WaveTools.py":3055
52700  * series = np.zeros((Nseries,2),)
52701  * series[:,0] = timelst
52702  * for i in range(len(timelst)): # <<<<<<<<<<<<<<
52703  * time = series[i,0]
52704  * if mode == "all":
52705  */
52706  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __pyx_L1_error)
52707  __Pyx_GOTREF(__pyx_t_1);
52708  __pyx_t_5 = PyObject_Length(__pyx_v_timelst); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3055, __pyx_L1_error)
52709  __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3055, __pyx_L1_error)
52710  __Pyx_GOTREF(__pyx_t_9);
52711  __pyx_t_3 = NULL;
52712  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
52713  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
52714  if (likely(__pyx_t_3)) {
52715  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
52716  __Pyx_INCREF(__pyx_t_3);
52717  __Pyx_INCREF(function);
52718  __Pyx_DECREF_SET(__pyx_t_1, function);
52719  }
52720  }
52721  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9);
52722  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52723  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52724  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error)
52725  __Pyx_GOTREF(__pyx_t_2);
52726  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52727  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
52728  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
52729  __pyx_t_7 = NULL;
52730  } else {
52731  __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3055, __pyx_L1_error)
52732  __Pyx_GOTREF(__pyx_t_1);
52733  __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3055, __pyx_L1_error)
52734  }
52735  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52736  for (;;) {
52737  if (likely(!__pyx_t_7)) {
52738  if (likely(PyList_CheckExact(__pyx_t_1))) {
52739  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
52740  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
52741  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3055, __pyx_L1_error)
52742  #else
52743  __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error)
52744  __Pyx_GOTREF(__pyx_t_2);
52745  #endif
52746  } else {
52747  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
52748  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
52749  __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3055, __pyx_L1_error)
52750  #else
52751  __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3055, __pyx_L1_error)
52752  __Pyx_GOTREF(__pyx_t_2);
52753  #endif
52754  }
52755  } else {
52756  __pyx_t_2 = __pyx_t_7(__pyx_t_1);
52757  if (unlikely(!__pyx_t_2)) {
52758  PyObject* exc_type = PyErr_Occurred();
52759  if (exc_type) {
52760  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
52761  else __PYX_ERR(0, 3055, __pyx_L1_error)
52762  }
52763  break;
52764  }
52765  __Pyx_GOTREF(__pyx_t_2);
52766  }
52767  __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
52768  __pyx_t_2 = 0;
52769 
52770  /* "WaveTools.py":3056
52771  * series[:,0] = timelst
52772  * for i in range(len(timelst)):
52773  * time = series[i,0] # <<<<<<<<<<<<<<
52774  * if mode == "all":
52775  * series[i,1] = self.eta_overall(x0,time,setUp)
52776  */
52777  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error)
52778  __Pyx_GOTREF(__pyx_t_2);
52779  __Pyx_INCREF(__pyx_v_i);
52780  __Pyx_GIVEREF(__pyx_v_i);
52781  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
52782  __Pyx_INCREF(__pyx_int_0);
52783  __Pyx_GIVEREF(__pyx_int_0);
52784  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
52785  __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_v_series, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3056, __pyx_L1_error)
52786  __Pyx_GOTREF(__pyx_t_9);
52787  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52788  __Pyx_XDECREF_SET(__pyx_v_time, __pyx_t_9);
52789  __pyx_t_9 = 0;
52790 
52791  /* "WaveTools.py":3057
52792  * for i in range(len(timelst)):
52793  * time = series[i,0]
52794  * if mode == "all": # <<<<<<<<<<<<<<
52795  * series[i,1] = self.eta_overall(x0,time,setUp)
52796  * elif mode == "setup":
52797  */
52798  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_all, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3057, __pyx_L1_error)
52799  if (__pyx_t_4) {
52800 
52801  /* "WaveTools.py":3058
52802  * time = series[i,0]
52803  * if mode == "all":
52804  * series[i,1] = self.eta_overall(x0,time,setUp) # <<<<<<<<<<<<<<
52805  * elif mode == "setup":
52806  * series[i,1] = self.eta_setUp(x0,time)
52807  */
52808  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta_overall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error)
52809  __Pyx_GOTREF(__pyx_t_2);
52810  __pyx_t_3 = NULL;
52811  __pyx_t_10 = 0;
52812  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
52813  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
52814  if (likely(__pyx_t_3)) {
52815  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52816  __Pyx_INCREF(__pyx_t_3);
52817  __Pyx_INCREF(function);
52818  __Pyx_DECREF_SET(__pyx_t_2, function);
52819  __pyx_t_10 = 1;
52820  }
52821  }
52822  #if CYTHON_FAST_PYCALL
52823  if (PyFunction_Check(__pyx_t_2)) {
52824  PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_x0, __pyx_v_time, __pyx_v_setUp};
52825  __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3058, __pyx_L1_error)
52826  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52827  __Pyx_GOTREF(__pyx_t_9);
52828  } else
52829  #endif
52830  #if CYTHON_FAST_PYCCALL
52831  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
52832  PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_x0, __pyx_v_time, __pyx_v_setUp};
52833  __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3058, __pyx_L1_error)
52834  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
52835  __Pyx_GOTREF(__pyx_t_9);
52836  } else
52837  #endif
52838  {
52839  __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3058, __pyx_L1_error)
52840  __Pyx_GOTREF(__pyx_t_11);
52841  if (__pyx_t_3) {
52842  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
52843  }
52844  __Pyx_INCREF(__pyx_v_x0);
52845  __Pyx_GIVEREF(__pyx_v_x0);
52846  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_x0);
52847  __Pyx_INCREF(__pyx_v_time);
52848  __Pyx_GIVEREF(__pyx_v_time);
52849  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_time);
52850  __Pyx_INCREF(__pyx_v_setUp);
52851  __Pyx_GIVEREF(__pyx_v_setUp);
52852  PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_setUp);
52853  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3058, __pyx_L1_error)
52854  __Pyx_GOTREF(__pyx_t_9);
52855  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
52856  }
52857  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52858  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3058, __pyx_L1_error)
52859  __Pyx_GOTREF(__pyx_t_2);
52860  __Pyx_INCREF(__pyx_v_i);
52861  __Pyx_GIVEREF(__pyx_v_i);
52862  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
52863  __Pyx_INCREF(__pyx_int_1);
52864  __Pyx_GIVEREF(__pyx_int_1);
52865  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
52866  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_t_2, __pyx_t_9) < 0)) __PYX_ERR(0, 3058, __pyx_L1_error)
52867  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52868  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52869 
52870  /* "WaveTools.py":3057
52871  * for i in range(len(timelst)):
52872  * time = series[i,0]
52873  * if mode == "all": # <<<<<<<<<<<<<<
52874  * series[i,1] = self.eta_overall(x0,time,setUp)
52875  * elif mode == "setup":
52876  */
52877  goto __pyx_L8;
52878  }
52879 
52880  /* "WaveTools.py":3059
52881  * if mode == "all":
52882  * series[i,1] = self.eta_overall(x0,time,setUp)
52883  * elif mode == "setup": # <<<<<<<<<<<<<<
52884  * series[i,1] = self.eta_setUp(x0,time)
52885  * elif mode == "short":
52886  */
52887  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_setup, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3059, __pyx_L1_error)
52888  if (__pyx_t_4) {
52889 
52890  /* "WaveTools.py":3060
52891  * series[i,1] = self.eta_overall(x0,time,setUp)
52892  * elif mode == "setup":
52893  * series[i,1] = self.eta_setUp(x0,time) # <<<<<<<<<<<<<<
52894  * elif mode == "short":
52895  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time)
52896  */
52897  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta_setUp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __pyx_L1_error)
52898  __Pyx_GOTREF(__pyx_t_2);
52899  __pyx_t_11 = NULL;
52900  __pyx_t_10 = 0;
52901  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
52902  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
52903  if (likely(__pyx_t_11)) {
52904  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52905  __Pyx_INCREF(__pyx_t_11);
52906  __Pyx_INCREF(function);
52907  __Pyx_DECREF_SET(__pyx_t_2, function);
52908  __pyx_t_10 = 1;
52909  }
52910  }
52911  #if CYTHON_FAST_PYCALL
52912  if (PyFunction_Check(__pyx_t_2)) {
52913  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_x0, __pyx_v_time};
52914  __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3060, __pyx_L1_error)
52915  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
52916  __Pyx_GOTREF(__pyx_t_9);
52917  } else
52918  #endif
52919  #if CYTHON_FAST_PYCCALL
52920  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
52921  PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_x0, __pyx_v_time};
52922  __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3060, __pyx_L1_error)
52923  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
52924  __Pyx_GOTREF(__pyx_t_9);
52925  } else
52926  #endif
52927  {
52928  __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3060, __pyx_L1_error)
52929  __Pyx_GOTREF(__pyx_t_3);
52930  if (__pyx_t_11) {
52931  __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); __pyx_t_11 = NULL;
52932  }
52933  __Pyx_INCREF(__pyx_v_x0);
52934  __Pyx_GIVEREF(__pyx_v_x0);
52935  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_v_x0);
52936  __Pyx_INCREF(__pyx_v_time);
52937  __Pyx_GIVEREF(__pyx_v_time);
52938  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_v_time);
52939  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3060, __pyx_L1_error)
52940  __Pyx_GOTREF(__pyx_t_9);
52941  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52942  }
52943  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52944  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3060, __pyx_L1_error)
52945  __Pyx_GOTREF(__pyx_t_2);
52946  __Pyx_INCREF(__pyx_v_i);
52947  __Pyx_GIVEREF(__pyx_v_i);
52948  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
52949  __Pyx_INCREF(__pyx_int_1);
52950  __Pyx_GIVEREF(__pyx_int_1);
52951  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
52952  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_t_2, __pyx_t_9) < 0)) __PYX_ERR(0, 3060, __pyx_L1_error)
52953  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52954  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
52955 
52956  /* "WaveTools.py":3059
52957  * if mode == "all":
52958  * series[i,1] = self.eta_overall(x0,time,setUp)
52959  * elif mode == "setup": # <<<<<<<<<<<<<<
52960  * series[i,1] = self.eta_setUp(x0,time)
52961  * elif mode == "short":
52962  */
52963  goto __pyx_L8;
52964  }
52965 
52966  /* "WaveTools.py":3061
52967  * elif mode == "setup":
52968  * series[i,1] = self.eta_setUp(x0,time)
52969  * elif mode == "short": # <<<<<<<<<<<<<<
52970  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time)
52971  * elif mode == "long":
52972  */
52973  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_short, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3061, __pyx_L1_error)
52974  if (__pyx_t_4) {
52975 
52976  /* "WaveTools.py":3062
52977  * series[i,1] = self.eta_setUp(x0,time)
52978  * elif mode == "short":
52979  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time) # <<<<<<<<<<<<<<
52980  * elif mode == "long":
52981  * series[i,1] = self.eta_long(x0,time)
52982  */
52983  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta_short); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error)
52984  __Pyx_GOTREF(__pyx_t_2);
52985  __pyx_t_3 = NULL;
52986  __pyx_t_10 = 0;
52987  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
52988  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
52989  if (likely(__pyx_t_3)) {
52990  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
52991  __Pyx_INCREF(__pyx_t_3);
52992  __Pyx_INCREF(function);
52993  __Pyx_DECREF_SET(__pyx_t_2, function);
52994  __pyx_t_10 = 1;
52995  }
52996  }
52997  #if CYTHON_FAST_PYCALL
52998  if (PyFunction_Check(__pyx_t_2)) {
52999  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x0, __pyx_v_time};
53000  __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3062, __pyx_L1_error)
53001  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53002  __Pyx_GOTREF(__pyx_t_9);
53003  } else
53004  #endif
53005  #if CYTHON_FAST_PYCCALL
53006  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
53007  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x0, __pyx_v_time};
53008  __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3062, __pyx_L1_error)
53009  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53010  __Pyx_GOTREF(__pyx_t_9);
53011  } else
53012  #endif
53013  {
53014  __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3062, __pyx_L1_error)
53015  __Pyx_GOTREF(__pyx_t_11);
53016  if (__pyx_t_3) {
53017  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
53018  }
53019  __Pyx_INCREF(__pyx_v_x0);
53020  __Pyx_GIVEREF(__pyx_v_x0);
53021  PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_x0);
53022  __Pyx_INCREF(__pyx_v_time);
53023  __Pyx_GIVEREF(__pyx_v_time);
53024  PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_time);
53025  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3062, __pyx_L1_error)
53026  __Pyx_GOTREF(__pyx_t_9);
53027  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53028  }
53029  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53030  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta_2ndOrder); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3062, __pyx_L1_error)
53031  __Pyx_GOTREF(__pyx_t_11);
53032  __pyx_t_3 = NULL;
53033  __pyx_t_10 = 0;
53034  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
53035  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11);
53036  if (likely(__pyx_t_3)) {
53037  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
53038  __Pyx_INCREF(__pyx_t_3);
53039  __Pyx_INCREF(function);
53040  __Pyx_DECREF_SET(__pyx_t_11, function);
53041  __pyx_t_10 = 1;
53042  }
53043  }
53044  #if CYTHON_FAST_PYCALL
53045  if (PyFunction_Check(__pyx_t_11)) {
53046  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x0, __pyx_v_time};
53047  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error)
53048  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53049  __Pyx_GOTREF(__pyx_t_2);
53050  } else
53051  #endif
53052  #if CYTHON_FAST_PYCCALL
53053  if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
53054  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x0, __pyx_v_time};
53055  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error)
53056  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53057  __Pyx_GOTREF(__pyx_t_2);
53058  } else
53059  #endif
53060  {
53061  __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3062, __pyx_L1_error)
53062  __Pyx_GOTREF(__pyx_t_6);
53063  if (__pyx_t_3) {
53064  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
53065  }
53066  __Pyx_INCREF(__pyx_v_x0);
53067  __Pyx_GIVEREF(__pyx_v_x0);
53068  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_10, __pyx_v_x0);
53069  __Pyx_INCREF(__pyx_v_time);
53070  __Pyx_GIVEREF(__pyx_v_time);
53071  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_v_time);
53072  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error)
53073  __Pyx_GOTREF(__pyx_t_2);
53074  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53075  }
53076  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53077  __pyx_t_11 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3062, __pyx_L1_error)
53078  __Pyx_GOTREF(__pyx_t_11);
53079  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
53080  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53081  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3062, __pyx_L1_error)
53082  __Pyx_GOTREF(__pyx_t_2);
53083  __Pyx_INCREF(__pyx_v_i);
53084  __Pyx_GIVEREF(__pyx_v_i);
53085  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
53086  __Pyx_INCREF(__pyx_int_1);
53087  __Pyx_GIVEREF(__pyx_int_1);
53088  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
53089  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_t_2, __pyx_t_11) < 0)) __PYX_ERR(0, 3062, __pyx_L1_error)
53090  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53091  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53092 
53093  /* "WaveTools.py":3061
53094  * elif mode == "setup":
53095  * series[i,1] = self.eta_setUp(x0,time)
53096  * elif mode == "short": # <<<<<<<<<<<<<<
53097  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time)
53098  * elif mode == "long":
53099  */
53100  goto __pyx_L8;
53101  }
53102 
53103  /* "WaveTools.py":3063
53104  * elif mode == "short":
53105  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time)
53106  * elif mode == "long": # <<<<<<<<<<<<<<
53107  * series[i,1] = self.eta_long(x0,time)
53108  * elif mode == "linear":
53109  */
53110  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_long, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3063, __pyx_L1_error)
53111  if (__pyx_t_4) {
53112 
53113  /* "WaveTools.py":3064
53114  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time)
53115  * elif mode == "long":
53116  * series[i,1] = self.eta_long(x0,time) # <<<<<<<<<<<<<<
53117  * elif mode == "linear":
53118  * series[i,1] = self.eta_linear(x0,time)
53119  */
53120  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_eta_long); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3064, __pyx_L1_error)
53121  __Pyx_GOTREF(__pyx_t_2);
53122  __pyx_t_9 = NULL;
53123  __pyx_t_10 = 0;
53124  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
53125  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
53126  if (likely(__pyx_t_9)) {
53127  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
53128  __Pyx_INCREF(__pyx_t_9);
53129  __Pyx_INCREF(function);
53130  __Pyx_DECREF_SET(__pyx_t_2, function);
53131  __pyx_t_10 = 1;
53132  }
53133  }
53134  #if CYTHON_FAST_PYCALL
53135  if (PyFunction_Check(__pyx_t_2)) {
53136  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_x0, __pyx_v_time};
53137  __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3064, __pyx_L1_error)
53138  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
53139  __Pyx_GOTREF(__pyx_t_11);
53140  } else
53141  #endif
53142  #if CYTHON_FAST_PYCCALL
53143  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
53144  PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_x0, __pyx_v_time};
53145  __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3064, __pyx_L1_error)
53146  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
53147  __Pyx_GOTREF(__pyx_t_11);
53148  } else
53149  #endif
53150  {
53151  __pyx_t_6 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3064, __pyx_L1_error)
53152  __Pyx_GOTREF(__pyx_t_6);
53153  if (__pyx_t_9) {
53154  __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
53155  }
53156  __Pyx_INCREF(__pyx_v_x0);
53157  __Pyx_GIVEREF(__pyx_v_x0);
53158  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_10, __pyx_v_x0);
53159  __Pyx_INCREF(__pyx_v_time);
53160  __Pyx_GIVEREF(__pyx_v_time);
53161  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_10, __pyx_v_time);
53162  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3064, __pyx_L1_error)
53163  __Pyx_GOTREF(__pyx_t_11);
53164  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53165  }
53166  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53167  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3064, __pyx_L1_error)
53168  __Pyx_GOTREF(__pyx_t_2);
53169  __Pyx_INCREF(__pyx_v_i);
53170  __Pyx_GIVEREF(__pyx_v_i);
53171  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
53172  __Pyx_INCREF(__pyx_int_1);
53173  __Pyx_GIVEREF(__pyx_int_1);
53174  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
53175  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_t_2, __pyx_t_11) < 0)) __PYX_ERR(0, 3064, __pyx_L1_error)
53176  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53177  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53178 
53179  /* "WaveTools.py":3063
53180  * elif mode == "short":
53181  * series[i,1] = self.eta_short(x0,time) + self.eta_2ndOrder(x0,time)
53182  * elif mode == "long": # <<<<<<<<<<<<<<
53183  * series[i,1] = self.eta_long(x0,time)
53184  * elif mode == "linear":
53185  */
53186  goto __pyx_L8;
53187  }
53188 
53189  /* "WaveTools.py":3065
53190  * elif mode == "long":
53191  * series[i,1] = self.eta_long(x0,time)
53192  * elif mode == "linear": # <<<<<<<<<<<<<<
53193  * series[i,1] = self.eta_linear(x0,time)
53194  * else:
53195  */
53196  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_linear, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3065, __pyx_L1_error)
53197  if (__pyx_t_4) {
53198 
53199  /* "WaveTools.py":3066
53200  * series[i,1] = self.eta_long(x0,time)
53201  * elif mode == "linear":
53202  * series[i,1] = self.eta_linear(x0,time) # <<<<<<<<<<<<<<
53203  * else:
53204  * logEvent('ERROR! Wavetools.pyx: Argument mode in RandomNLWaves.writeEtaSeries should be "all", "setup", "short", "long" or "linear"')
53205  */
53206  __Pyx_INCREF(__pyx_v_self->eta_linear);
53207  __pyx_t_2 = __pyx_v_self->eta_linear; __pyx_t_6 = NULL;
53208  __pyx_t_10 = 0;
53209  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
53210  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
53211  if (likely(__pyx_t_6)) {
53212  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
53213  __Pyx_INCREF(__pyx_t_6);
53214  __Pyx_INCREF(function);
53215  __Pyx_DECREF_SET(__pyx_t_2, function);
53216  __pyx_t_10 = 1;
53217  }
53218  }
53219  #if CYTHON_FAST_PYCALL
53220  if (PyFunction_Check(__pyx_t_2)) {
53221  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x0, __pyx_v_time};
53222  __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3066, __pyx_L1_error)
53223  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
53224  __Pyx_GOTREF(__pyx_t_11);
53225  } else
53226  #endif
53227  #if CYTHON_FAST_PYCCALL
53228  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
53229  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x0, __pyx_v_time};
53230  __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3066, __pyx_L1_error)
53231  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
53232  __Pyx_GOTREF(__pyx_t_11);
53233  } else
53234  #endif
53235  {
53236  __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3066, __pyx_L1_error)
53237  __Pyx_GOTREF(__pyx_t_9);
53238  if (__pyx_t_6) {
53239  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
53240  }
53241  __Pyx_INCREF(__pyx_v_x0);
53242  __Pyx_GIVEREF(__pyx_v_x0);
53243  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_10, __pyx_v_x0);
53244  __Pyx_INCREF(__pyx_v_time);
53245  __Pyx_GIVEREF(__pyx_v_time);
53246  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_v_time);
53247  __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3066, __pyx_L1_error)
53248  __Pyx_GOTREF(__pyx_t_11);
53249  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
53250  }
53251  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53252  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3066, __pyx_L1_error)
53253  __Pyx_GOTREF(__pyx_t_2);
53254  __Pyx_INCREF(__pyx_v_i);
53255  __Pyx_GIVEREF(__pyx_v_i);
53256  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_i);
53257  __Pyx_INCREF(__pyx_int_1);
53258  __Pyx_GIVEREF(__pyx_int_1);
53259  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_1);
53260  if (unlikely(PyObject_SetItem(__pyx_v_series, __pyx_t_2, __pyx_t_11) < 0)) __PYX_ERR(0, 3066, __pyx_L1_error)
53261  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53262  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53263 
53264  /* "WaveTools.py":3065
53265  * elif mode == "long":
53266  * series[i,1] = self.eta_long(x0,time)
53267  * elif mode == "linear": # <<<<<<<<<<<<<<
53268  * series[i,1] = self.eta_linear(x0,time)
53269  * else:
53270  */
53271  goto __pyx_L8;
53272  }
53273 
53274  /* "WaveTools.py":3068
53275  * series[i,1] = self.eta_linear(x0,time)
53276  * else:
53277  * logEvent('ERROR! Wavetools.pyx: Argument mode in RandomNLWaves.writeEtaSeries should be "all", "setup", "short", "long" or "linear"') # <<<<<<<<<<<<<<
53278  * sys.exit(1)
53279  * delimiter =" "
53280  */
53281  /*else*/ {
53282  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3068, __pyx_L1_error)
53283  __Pyx_GOTREF(__pyx_t_2);
53284  __pyx_t_9 = NULL;
53285  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
53286  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
53287  if (likely(__pyx_t_9)) {
53288  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
53289  __Pyx_INCREF(__pyx_t_9);
53290  __Pyx_INCREF(function);
53291  __Pyx_DECREF_SET(__pyx_t_2, function);
53292  }
53293  }
53294  __pyx_t_11 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_kp_s_ERROR_Wavetools_pyx_Argument_mod) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_ERROR_Wavetools_pyx_Argument_mod);
53295  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
53296  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3068, __pyx_L1_error)
53297  __Pyx_GOTREF(__pyx_t_11);
53298  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53299  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53300 
53301  /* "WaveTools.py":3069
53302  * else:
53303  * logEvent('ERROR! Wavetools.pyx: Argument mode in RandomNLWaves.writeEtaSeries should be "all", "setup", "short", "long" or "linear"')
53304  * sys.exit(1) # <<<<<<<<<<<<<<
53305  * delimiter =" "
53306  * if fname[-4:]==".csv":
53307  */
53308  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3069, __pyx_L1_error)
53309  __Pyx_GOTREF(__pyx_t_2);
53310  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3069, __pyx_L1_error)
53311  __Pyx_GOTREF(__pyx_t_9);
53312  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53313  __pyx_t_2 = NULL;
53314  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
53315  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
53316  if (likely(__pyx_t_2)) {
53317  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
53318  __Pyx_INCREF(__pyx_t_2);
53319  __Pyx_INCREF(function);
53320  __Pyx_DECREF_SET(__pyx_t_9, function);
53321  }
53322  }
53323  __pyx_t_11 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_2, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_int_1);
53324  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
53325  if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3069, __pyx_L1_error)
53326  __Pyx_GOTREF(__pyx_t_11);
53327  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
53328  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53329  }
53330  __pyx_L8:;
53331 
53332  /* "WaveTools.py":3055
53333  * series = np.zeros((Nseries,2),)
53334  * series[:,0] = timelst
53335  * for i in range(len(timelst)): # <<<<<<<<<<<<<<
53336  * time = series[i,0]
53337  * if mode == "all":
53338  */
53339  }
53340  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53341 
53342  /* "WaveTools.py":3070
53343  * logEvent('ERROR! Wavetools.pyx: Argument mode in RandomNLWaves.writeEtaSeries should be "all", "setup", "short", "long" or "linear"')
53344  * sys.exit(1)
53345  * delimiter =" " # <<<<<<<<<<<<<<
53346  * if fname[-4:]==".csv":
53347  * delimiter = ","
53348  */
53349  __Pyx_INCREF(__pyx_kp_s__52);
53350  __pyx_v_delimiter = __pyx_kp_s__52;
53351 
53352  /* "WaveTools.py":3071
53353  * sys.exit(1)
53354  * delimiter =" "
53355  * if fname[-4:]==".csv": # <<<<<<<<<<<<<<
53356  * delimiter = ","
53357  * np.savetxt(fname,series,delimiter=delimiter)
53358  */
53359  __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_fname, -4L, 0, NULL, NULL, &__pyx_slice__42, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3071, __pyx_L1_error)
53360  __Pyx_GOTREF(__pyx_t_1);
53361  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_csv, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 3071, __pyx_L1_error)
53362  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53363  if (__pyx_t_4) {
53364 
53365  /* "WaveTools.py":3072
53366  * delimiter =" "
53367  * if fname[-4:]==".csv":
53368  * delimiter = "," # <<<<<<<<<<<<<<
53369  * np.savetxt(fname,series,delimiter=delimiter)
53370  * return series
53371  */
53372  __Pyx_INCREF(__pyx_kp_s__43);
53373  __Pyx_DECREF_SET(__pyx_v_delimiter, __pyx_kp_s__43);
53374 
53375  /* "WaveTools.py":3071
53376  * sys.exit(1)
53377  * delimiter =" "
53378  * if fname[-4:]==".csv": # <<<<<<<<<<<<<<
53379  * delimiter = ","
53380  * np.savetxt(fname,series,delimiter=delimiter)
53381  */
53382  }
53383 
53384  /* "WaveTools.py":3073
53385  * if fname[-4:]==".csv":
53386  * delimiter = ","
53387  * np.savetxt(fname,series,delimiter=delimiter) # <<<<<<<<<<<<<<
53388  * return series
53389  *
53390  */
53391  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3073, __pyx_L1_error)
53392  __Pyx_GOTREF(__pyx_t_1);
53393  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_savetxt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3073, __pyx_L1_error)
53394  __Pyx_GOTREF(__pyx_t_11);
53395  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53396  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3073, __pyx_L1_error)
53397  __Pyx_GOTREF(__pyx_t_1);
53398  __Pyx_INCREF(__pyx_v_fname);
53399  __Pyx_GIVEREF(__pyx_v_fname);
53400  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fname);
53401  __Pyx_INCREF(__pyx_v_series);
53402  __Pyx_GIVEREF(__pyx_v_series);
53403  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_series);
53404  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3073, __pyx_L1_error)
53405  __Pyx_GOTREF(__pyx_t_9);
53406  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_delimiter, __pyx_v_delimiter) < 0) __PYX_ERR(0, 3073, __pyx_L1_error)
53407  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3073, __pyx_L1_error)
53408  __Pyx_GOTREF(__pyx_t_2);
53409  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
53410  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53411  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
53412  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53413 
53414  /* "WaveTools.py":3074
53415  * delimiter = ","
53416  * np.savetxt(fname,series,delimiter=delimiter)
53417  * return series # <<<<<<<<<<<<<<
53418  *
53419  * def wtError(self,x,t):
53420  */
53421  __Pyx_XDECREF(__pyx_r);
53422  __Pyx_INCREF(__pyx_v_series);
53423  __pyx_r = __pyx_v_series;
53424  goto __pyx_L0;
53425 
53426  /* "WaveTools.py":3009
53427  *
53428  *
53429  * def writeEtaSeries(self,Tstart,Tend,dt,x0,fname, mode="all",setUp=False, Lgen=np.zeros(3,)): # <<<<<<<<<<<<<<
53430  * """Writes a timeseries of the free-surface elevation
53431  *
53432  */
53433 
53434  /* function exit code */
53435  __pyx_L1_error:;
53436  __Pyx_XDECREF(__pyx_t_1);
53437  __Pyx_XDECREF(__pyx_t_2);
53438  __Pyx_XDECREF(__pyx_t_3);
53439  __Pyx_XDECREF(__pyx_t_6);
53440  __Pyx_XDECREF(__pyx_t_8);
53441  __Pyx_XDECREF(__pyx_t_9);
53442  __Pyx_XDECREF(__pyx_t_11);
53443  __Pyx_AddTraceback("WaveTools.RandomNLWaves.writeEtaSeries", __pyx_clineno, __pyx_lineno, __pyx_filename);
53444  __pyx_r = NULL;
53445  __pyx_L0:;
53446  __Pyx_XDECREF(__pyx_v_Tlag);
53447  __Pyx_XDECREF(__pyx_v_j);
53448  __Pyx_XDECREF(__pyx_v_Nseries);
53449  __Pyx_XDECREF(__pyx_v_timelst);
53450  __Pyx_XDECREF(__pyx_v_series);
53451  __Pyx_XDECREF(__pyx_v_i);
53452  __Pyx_XDECREF(__pyx_v_time);
53453  __Pyx_XDECREF(__pyx_v_delimiter);
53454  __Pyx_XDECREF(__pyx_v_Tstart);
53455  __Pyx_XGIVEREF(__pyx_r);
53456  __Pyx_RefNannyFinishContext();
53457  return __pyx_r;
53458 }
53459 
53460 /* "WaveTools.py":3076
53461  * return series
53462  *
53463  * def wtError(self,x,t): # <<<<<<<<<<<<<<
53464  * """Raises error for using RandomNLWavesFast class instead
53465  *
53466  */
53467 
53468 /* Python wrapper */
53469 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_15wtError(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
53470 static char __pyx_doc_9WaveTools_13RandomNLWaves_14wtError[] = "Raises error for using RandomNLWavesFast class instead\n\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n\n Returns\n --------\n None\n\n Raises\n --------\n SystemExit\n\n ";
53471 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_15wtError = {"wtError", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_15wtError, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_14wtError};
53472 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_15wtError(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
53473  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
53474  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
53475  PyObject *__pyx_r = 0;
53476  __Pyx_RefNannyDeclarations
53477  __Pyx_RefNannySetupContext("wtError (wrapper)", 0);
53478  {
53479  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
53480  PyObject* values[2] = {0,0};
53481  if (unlikely(__pyx_kwds)) {
53482  Py_ssize_t kw_args;
53483  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
53484  switch (pos_args) {
53485  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
53486  CYTHON_FALLTHROUGH;
53487  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
53488  CYTHON_FALLTHROUGH;
53489  case 0: break;
53490  default: goto __pyx_L5_argtuple_error;
53491  }
53492  kw_args = PyDict_Size(__pyx_kwds);
53493  switch (pos_args) {
53494  case 0:
53495  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
53496  else goto __pyx_L5_argtuple_error;
53497  CYTHON_FALLTHROUGH;
53498  case 1:
53499  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
53500  else {
53501  __Pyx_RaiseArgtupleInvalid("wtError", 1, 2, 2, 1); __PYX_ERR(0, 3076, __pyx_L3_error)
53502  }
53503  }
53504  if (unlikely(kw_args > 0)) {
53505  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wtError") < 0)) __PYX_ERR(0, 3076, __pyx_L3_error)
53506  }
53507  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
53508  goto __pyx_L5_argtuple_error;
53509  } else {
53510  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
53511  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
53512  }
53513  __pyx_v_x = values[0];
53514  __pyx_v_t = values[1];
53515  }
53516  goto __pyx_L4_argument_unpacking_done;
53517  __pyx_L5_argtuple_error:;
53518  __Pyx_RaiseArgtupleInvalid("wtError", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3076, __pyx_L3_error)
53519  __pyx_L3_error:;
53520  __Pyx_AddTraceback("WaveTools.RandomNLWaves.wtError", __pyx_clineno, __pyx_lineno, __pyx_filename);
53521  __Pyx_RefNannyFinishContext();
53522  return NULL;
53523  __pyx_L4_argument_unpacking_done:;
53524  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_14wtError(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), __pyx_v_x, __pyx_v_t);
53525 
53526  /* function exit code */
53527  __Pyx_RefNannyFinishContext();
53528  return __pyx_r;
53529 }
53530 
53531 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_14wtError(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
53532  PyObject *__pyx_r = NULL;
53533  __Pyx_RefNannyDeclarations
53534  PyObject *__pyx_t_1 = NULL;
53535  PyObject *__pyx_t_2 = NULL;
53536  PyObject *__pyx_t_3 = NULL;
53537  __Pyx_RefNannySetupContext("wtError", 0);
53538 
53539  /* "WaveTools.py":3097
53540  * """
53541  *
53542  * logEvent("ERROR! Wavetools.py: eta and u functions not available for this class. Please use RandomNLWavesFast for generating random waves with nonlinear correction",0) # <<<<<<<<<<<<<<
53543  * sys.exit(1)
53544  *
53545  */
53546  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3097, __pyx_L1_error)
53547  __Pyx_GOTREF(__pyx_t_1);
53548  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
53549  __Pyx_GOTREF(__pyx_t_2);
53550  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53551  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53552 
53553  /* "WaveTools.py":3098
53554  *
53555  * logEvent("ERROR! Wavetools.py: eta and u functions not available for this class. Please use RandomNLWavesFast for generating random waves with nonlinear correction",0)
53556  * sys.exit(1) # <<<<<<<<<<<<<<
53557  *
53558  *
53559  */
53560  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3098, __pyx_L1_error)
53561  __Pyx_GOTREF(__pyx_t_1);
53562  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3098, __pyx_L1_error)
53563  __Pyx_GOTREF(__pyx_t_3);
53564  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53565  __pyx_t_1 = NULL;
53566  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
53567  __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
53568  if (likely(__pyx_t_1)) {
53569  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
53570  __Pyx_INCREF(__pyx_t_1);
53571  __Pyx_INCREF(function);
53572  __Pyx_DECREF_SET(__pyx_t_3, function);
53573  }
53574  }
53575  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_1);
53576  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
53577  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3098, __pyx_L1_error)
53578  __Pyx_GOTREF(__pyx_t_2);
53579  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53580  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53581 
53582  /* "WaveTools.py":3076
53583  * return series
53584  *
53585  * def wtError(self,x,t): # <<<<<<<<<<<<<<
53586  * """Raises error for using RandomNLWavesFast class instead
53587  *
53588  */
53589 
53590  /* function exit code */
53591  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
53592  goto __pyx_L0;
53593  __pyx_L1_error:;
53594  __Pyx_XDECREF(__pyx_t_1);
53595  __Pyx_XDECREF(__pyx_t_2);
53596  __Pyx_XDECREF(__pyx_t_3);
53597  __Pyx_AddTraceback("WaveTools.RandomNLWaves.wtError", __pyx_clineno, __pyx_lineno, __pyx_filename);
53598  __pyx_r = NULL;
53599  __pyx_L0:;
53600  __Pyx_XGIVEREF(__pyx_r);
53601  __Pyx_RefNannyFinishContext();
53602  return __pyx_r;
53603 }
53604 
53605 /* "WaveTools.pxd":252
53606  * cdef double _cpp_eta_long(self,double* x, double t)
53607  * cdef public:
53608  * object eta # <<<<<<<<<<<<<<
53609  * object u
53610  * object eta_linear
53611  */
53612 
53613 /* Python wrapper */
53614 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_3eta_1__get__(PyObject *__pyx_v_self); /*proto*/
53615 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_3eta_1__get__(PyObject *__pyx_v_self) {
53616  PyObject *__pyx_r = 0;
53617  __Pyx_RefNannyDeclarations
53618  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
53619  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_3eta___get__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53620 
53621  /* function exit code */
53622  __Pyx_RefNannyFinishContext();
53623  return __pyx_r;
53624 }
53625 
53626 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_3eta___get__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53627  PyObject *__pyx_r = NULL;
53628  __Pyx_RefNannyDeclarations
53629  __Pyx_RefNannySetupContext("__get__", 0);
53630  __Pyx_XDECREF(__pyx_r);
53631  __Pyx_INCREF(__pyx_v_self->eta);
53632  __pyx_r = __pyx_v_self->eta;
53633  goto __pyx_L0;
53634 
53635  /* function exit code */
53636  __pyx_L0:;
53637  __Pyx_XGIVEREF(__pyx_r);
53638  __Pyx_RefNannyFinishContext();
53639  return __pyx_r;
53640 }
53641 
53642 /* Python wrapper */
53643 static int __pyx_pw_9WaveTools_13RandomNLWaves_3eta_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
53644 static int __pyx_pw_9WaveTools_13RandomNLWaves_3eta_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
53645  int __pyx_r;
53646  __Pyx_RefNannyDeclarations
53647  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
53648  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_3eta_2__set__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
53649 
53650  /* function exit code */
53651  __Pyx_RefNannyFinishContext();
53652  return __pyx_r;
53653 }
53654 
53655 static int __pyx_pf_9WaveTools_13RandomNLWaves_3eta_2__set__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_value) {
53656  int __pyx_r;
53657  __Pyx_RefNannyDeclarations
53658  __Pyx_RefNannySetupContext("__set__", 0);
53659  __Pyx_INCREF(__pyx_v_value);
53660  __Pyx_GIVEREF(__pyx_v_value);
53661  __Pyx_GOTREF(__pyx_v_self->eta);
53662  __Pyx_DECREF(__pyx_v_self->eta);
53663  __pyx_v_self->eta = __pyx_v_value;
53664 
53665  /* function exit code */
53666  __pyx_r = 0;
53667  __Pyx_RefNannyFinishContext();
53668  return __pyx_r;
53669 }
53670 
53671 /* Python wrapper */
53672 static int __pyx_pw_9WaveTools_13RandomNLWaves_3eta_5__del__(PyObject *__pyx_v_self); /*proto*/
53673 static int __pyx_pw_9WaveTools_13RandomNLWaves_3eta_5__del__(PyObject *__pyx_v_self) {
53674  int __pyx_r;
53675  __Pyx_RefNannyDeclarations
53676  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
53677  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_3eta_4__del__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53678 
53679  /* function exit code */
53680  __Pyx_RefNannyFinishContext();
53681  return __pyx_r;
53682 }
53683 
53684 static int __pyx_pf_9WaveTools_13RandomNLWaves_3eta_4__del__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53685  int __pyx_r;
53686  __Pyx_RefNannyDeclarations
53687  __Pyx_RefNannySetupContext("__del__", 0);
53688  __Pyx_INCREF(Py_None);
53689  __Pyx_GIVEREF(Py_None);
53690  __Pyx_GOTREF(__pyx_v_self->eta);
53691  __Pyx_DECREF(__pyx_v_self->eta);
53692  __pyx_v_self->eta = Py_None;
53693 
53694  /* function exit code */
53695  __pyx_r = 0;
53696  __Pyx_RefNannyFinishContext();
53697  return __pyx_r;
53698 }
53699 
53700 /* "WaveTools.pxd":253
53701  * cdef public:
53702  * object eta
53703  * object u # <<<<<<<<<<<<<<
53704  * object eta_linear
53705  *
53706  */
53707 
53708 /* Python wrapper */
53709 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_1u_1__get__(PyObject *__pyx_v_self); /*proto*/
53710 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_1u_1__get__(PyObject *__pyx_v_self) {
53711  PyObject *__pyx_r = 0;
53712  __Pyx_RefNannyDeclarations
53713  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
53714  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_1u___get__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53715 
53716  /* function exit code */
53717  __Pyx_RefNannyFinishContext();
53718  return __pyx_r;
53719 }
53720 
53721 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_1u___get__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53722  PyObject *__pyx_r = NULL;
53723  __Pyx_RefNannyDeclarations
53724  __Pyx_RefNannySetupContext("__get__", 0);
53725  __Pyx_XDECREF(__pyx_r);
53726  __Pyx_INCREF(__pyx_v_self->u);
53727  __pyx_r = __pyx_v_self->u;
53728  goto __pyx_L0;
53729 
53730  /* function exit code */
53731  __pyx_L0:;
53732  __Pyx_XGIVEREF(__pyx_r);
53733  __Pyx_RefNannyFinishContext();
53734  return __pyx_r;
53735 }
53736 
53737 /* Python wrapper */
53738 static int __pyx_pw_9WaveTools_13RandomNLWaves_1u_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
53739 static int __pyx_pw_9WaveTools_13RandomNLWaves_1u_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
53740  int __pyx_r;
53741  __Pyx_RefNannyDeclarations
53742  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
53743  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_1u_2__set__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
53744 
53745  /* function exit code */
53746  __Pyx_RefNannyFinishContext();
53747  return __pyx_r;
53748 }
53749 
53750 static int __pyx_pf_9WaveTools_13RandomNLWaves_1u_2__set__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_value) {
53751  int __pyx_r;
53752  __Pyx_RefNannyDeclarations
53753  __Pyx_RefNannySetupContext("__set__", 0);
53754  __Pyx_INCREF(__pyx_v_value);
53755  __Pyx_GIVEREF(__pyx_v_value);
53756  __Pyx_GOTREF(__pyx_v_self->u);
53757  __Pyx_DECREF(__pyx_v_self->u);
53758  __pyx_v_self->u = __pyx_v_value;
53759 
53760  /* function exit code */
53761  __pyx_r = 0;
53762  __Pyx_RefNannyFinishContext();
53763  return __pyx_r;
53764 }
53765 
53766 /* Python wrapper */
53767 static int __pyx_pw_9WaveTools_13RandomNLWaves_1u_5__del__(PyObject *__pyx_v_self); /*proto*/
53768 static int __pyx_pw_9WaveTools_13RandomNLWaves_1u_5__del__(PyObject *__pyx_v_self) {
53769  int __pyx_r;
53770  __Pyx_RefNannyDeclarations
53771  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
53772  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_1u_4__del__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53773 
53774  /* function exit code */
53775  __Pyx_RefNannyFinishContext();
53776  return __pyx_r;
53777 }
53778 
53779 static int __pyx_pf_9WaveTools_13RandomNLWaves_1u_4__del__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53780  int __pyx_r;
53781  __Pyx_RefNannyDeclarations
53782  __Pyx_RefNannySetupContext("__del__", 0);
53783  __Pyx_INCREF(Py_None);
53784  __Pyx_GIVEREF(Py_None);
53785  __Pyx_GOTREF(__pyx_v_self->u);
53786  __Pyx_DECREF(__pyx_v_self->u);
53787  __pyx_v_self->u = Py_None;
53788 
53789  /* function exit code */
53790  __pyx_r = 0;
53791  __Pyx_RefNannyFinishContext();
53792  return __pyx_r;
53793 }
53794 
53795 /* "WaveTools.pxd":254
53796  * object eta
53797  * object u
53798  * object eta_linear # <<<<<<<<<<<<<<
53799  *
53800  */
53801 
53802 /* Python wrapper */
53803 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_1__get__(PyObject *__pyx_v_self); /*proto*/
53804 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_1__get__(PyObject *__pyx_v_self) {
53805  PyObject *__pyx_r = 0;
53806  __Pyx_RefNannyDeclarations
53807  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
53808  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear___get__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53809 
53810  /* function exit code */
53811  __Pyx_RefNannyFinishContext();
53812  return __pyx_r;
53813 }
53814 
53815 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear___get__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53816  PyObject *__pyx_r = NULL;
53817  __Pyx_RefNannyDeclarations
53818  __Pyx_RefNannySetupContext("__get__", 0);
53819  __Pyx_XDECREF(__pyx_r);
53820  __Pyx_INCREF(__pyx_v_self->eta_linear);
53821  __pyx_r = __pyx_v_self->eta_linear;
53822  goto __pyx_L0;
53823 
53824  /* function exit code */
53825  __pyx_L0:;
53826  __Pyx_XGIVEREF(__pyx_r);
53827  __Pyx_RefNannyFinishContext();
53828  return __pyx_r;
53829 }
53830 
53831 /* Python wrapper */
53832 static int __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
53833 static int __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
53834  int __pyx_r;
53835  __Pyx_RefNannyDeclarations
53836  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
53837  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear_2__set__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), ((PyObject *)__pyx_v_value));
53838 
53839  /* function exit code */
53840  __Pyx_RefNannyFinishContext();
53841  return __pyx_r;
53842 }
53843 
53844 static int __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear_2__set__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, PyObject *__pyx_v_value) {
53845  int __pyx_r;
53846  __Pyx_RefNannyDeclarations
53847  __Pyx_RefNannySetupContext("__set__", 0);
53848  __Pyx_INCREF(__pyx_v_value);
53849  __Pyx_GIVEREF(__pyx_v_value);
53850  __Pyx_GOTREF(__pyx_v_self->eta_linear);
53851  __Pyx_DECREF(__pyx_v_self->eta_linear);
53852  __pyx_v_self->eta_linear = __pyx_v_value;
53853 
53854  /* function exit code */
53855  __pyx_r = 0;
53856  __Pyx_RefNannyFinishContext();
53857  return __pyx_r;
53858 }
53859 
53860 /* Python wrapper */
53861 static int __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_5__del__(PyObject *__pyx_v_self); /*proto*/
53862 static int __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_5__del__(PyObject *__pyx_v_self) {
53863  int __pyx_r;
53864  __Pyx_RefNannyDeclarations
53865  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
53866  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear_4__del__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53867 
53868  /* function exit code */
53869  __Pyx_RefNannyFinishContext();
53870  return __pyx_r;
53871 }
53872 
53873 static int __pyx_pf_9WaveTools_13RandomNLWaves_10eta_linear_4__del__(struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53874  int __pyx_r;
53875  __Pyx_RefNannyDeclarations
53876  __Pyx_RefNannySetupContext("__del__", 0);
53877  __Pyx_INCREF(Py_None);
53878  __Pyx_GIVEREF(Py_None);
53879  __Pyx_GOTREF(__pyx_v_self->eta_linear);
53880  __Pyx_DECREF(__pyx_v_self->eta_linear);
53881  __pyx_v_self->eta_linear = Py_None;
53882 
53883  /* function exit code */
53884  __pyx_r = 0;
53885  __Pyx_RefNannyFinishContext();
53886  return __pyx_r;
53887 }
53888 
53889 /* "(tree fragment)":1
53890  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
53891  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53892  * def __setstate_cython__(self, __pyx_state):
53893  */
53894 
53895 /* Python wrapper */
53896 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
53897 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_13RandomNLWaves_17__reduce_cython__, METH_NOARGS, 0};
53898 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_17__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
53899  PyObject *__pyx_r = 0;
53900  __Pyx_RefNannyDeclarations
53901  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
53902  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_16__reduce_cython__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self));
53903 
53904  /* function exit code */
53905  __Pyx_RefNannyFinishContext();
53906  return __pyx_r;
53907 }
53908 
53909 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self) {
53910  PyObject *__pyx_r = NULL;
53911  __Pyx_RefNannyDeclarations
53912  PyObject *__pyx_t_1 = NULL;
53913  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
53914 
53915  /* "(tree fragment)":2
53916  * def __reduce_cython__(self):
53917  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
53918  * def __setstate_cython__(self, __pyx_state):
53919  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53920  */
53921  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
53922  __Pyx_GOTREF(__pyx_t_1);
53923  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
53924  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53925  __PYX_ERR(1, 2, __pyx_L1_error)
53926 
53927  /* "(tree fragment)":1
53928  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
53929  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53930  * def __setstate_cython__(self, __pyx_state):
53931  */
53932 
53933  /* function exit code */
53934  __pyx_L1_error:;
53935  __Pyx_XDECREF(__pyx_t_1);
53936  __Pyx_AddTraceback("WaveTools.RandomNLWaves.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
53937  __pyx_r = NULL;
53938  __Pyx_XGIVEREF(__pyx_r);
53939  __Pyx_RefNannyFinishContext();
53940  return __pyx_r;
53941 }
53942 
53943 /* "(tree fragment)":3
53944  * def __reduce_cython__(self):
53945  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53946  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
53947  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53948  */
53949 
53950 /* Python wrapper */
53951 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
53952 static PyMethodDef __pyx_mdef_9WaveTools_13RandomNLWaves_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_13RandomNLWaves_19__setstate_cython__, METH_O, 0};
53953 static PyObject *__pyx_pw_9WaveTools_13RandomNLWaves_19__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
53954  PyObject *__pyx_r = 0;
53955  __Pyx_RefNannyDeclarations
53956  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
53957  __pyx_r = __pyx_pf_9WaveTools_13RandomNLWaves_18__setstate_cython__(((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
53958 
53959  /* function exit code */
53960  __Pyx_RefNannyFinishContext();
53961  return __pyx_r;
53962 }
53963 
53964 static PyObject *__pyx_pf_9WaveTools_13RandomNLWaves_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
53965  PyObject *__pyx_r = NULL;
53966  __Pyx_RefNannyDeclarations
53967  PyObject *__pyx_t_1 = NULL;
53968  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
53969 
53970  /* "(tree fragment)":4
53971  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53972  * def __setstate_cython__(self, __pyx_state):
53973  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
53974  */
53975  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
53976  __Pyx_GOTREF(__pyx_t_1);
53977  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
53978  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53979  __PYX_ERR(1, 4, __pyx_L1_error)
53980 
53981  /* "(tree fragment)":3
53982  * def __reduce_cython__(self):
53983  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53984  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
53985  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
53986  */
53987 
53988  /* function exit code */
53989  __pyx_L1_error:;
53990  __Pyx_XDECREF(__pyx_t_1);
53991  __Pyx_AddTraceback("WaveTools.RandomNLWaves.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
53992  __pyx_r = NULL;
53993  __Pyx_XGIVEREF(__pyx_r);
53994  __Pyx_RefNannyFinishContext();
53995  return __pyx_r;
53996 }
53997 
53998 /* "WaveTools.py":3152
53999  * Switch for enabling optimised functions
54000  * """
54001  * def __init__(self, # <<<<<<<<<<<<<<
54002  * Tstart,
54003  * Tend,
54004  */
54005 
54006 static PyObject *__pyx_pf_9WaveTools_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
54007  PyObject *__pyx_r = NULL;
54008  __Pyx_RefNannyDeclarations
54009  PyObject *__pyx_t_1 = NULL;
54010  PyObject *__pyx_t_2 = NULL;
54011  __Pyx_RefNannySetupContext("__defaults__", 0);
54012  __Pyx_XDECREF(__pyx_r);
54013 
54014  /* "WaveTools.py":3171
54015  * Nfreq = 32,
54016  * NLongW = 10.,
54017  * fast = True # <<<<<<<<<<<<<<
54018  * ):
54019  * self.fast = fast
54020  */
54021  __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3152, __pyx_L1_error)
54022  __Pyx_GOTREF(__pyx_t_1);
54023  __Pyx_INCREF(((PyObject *)Py_None));
54024  __Pyx_GIVEREF(((PyObject *)Py_None));
54025  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
54026  __Pyx_INCREF(((PyObject *)Py_None));
54027  __Pyx_GIVEREF(((PyObject *)Py_None));
54028  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_None));
54029  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_Lgen);
54030  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_Lgen);
54031  PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_Lgen);
54032  __Pyx_INCREF(((PyObject *)__pyx_int_15));
54033  __Pyx_GIVEREF(((PyObject *)__pyx_int_15));
54034  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_int_15));
54035  __Pyx_INCREF(((PyObject *)__pyx_int_32));
54036  __Pyx_GIVEREF(((PyObject *)__pyx_int_32));
54037  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_int_32));
54038  __Pyx_INCREF(((PyObject*)__pyx_float_10_));
54039  __Pyx_GIVEREF(((PyObject*)__pyx_float_10_));
54040  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject*)__pyx_float_10_));
54041  __Pyx_INCREF(((PyObject *)Py_True));
54042  __Pyx_GIVEREF(((PyObject *)Py_True));
54043  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject *)Py_True));
54044 
54045  /* "WaveTools.py":3152
54046  * Switch for enabling optimised functions
54047  * """
54048  * def __init__(self, # <<<<<<<<<<<<<<
54049  * Tstart,
54050  * Tend,
54051  */
54052  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3152, __pyx_L1_error)
54053  __Pyx_GOTREF(__pyx_t_2);
54054  __Pyx_GIVEREF(__pyx_t_1);
54055  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
54056  __Pyx_INCREF(Py_None);
54057  __Pyx_GIVEREF(Py_None);
54058  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
54059  __pyx_t_1 = 0;
54060  __pyx_r = __pyx_t_2;
54061  __pyx_t_2 = 0;
54062  goto __pyx_L0;
54063 
54064  /* function exit code */
54065  __pyx_L1_error:;
54066  __Pyx_XDECREF(__pyx_t_1);
54067  __Pyx_XDECREF(__pyx_t_2);
54068  __Pyx_AddTraceback("WaveTools.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
54069  __pyx_r = NULL;
54070  __pyx_L0:;
54071  __Pyx_XGIVEREF(__pyx_r);
54072  __Pyx_RefNannyFinishContext();
54073  return __pyx_r;
54074 }
54075 
54076 /* Python wrapper */
54077 static PyObject *__pyx_pw_9WaveTools_17RandomNLWavesFast_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
54078 static PyMethodDef __pyx_mdef_9WaveTools_17RandomNLWavesFast_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_17RandomNLWavesFast_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
54079 static PyObject *__pyx_pw_9WaveTools_17RandomNLWavesFast_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
54080  PyObject *__pyx_v_self = 0;
54081  PyObject *__pyx_v_Tstart = 0;
54082  PyObject *__pyx_v_Tend = 0;
54083  PyObject *__pyx_v_x0 = 0;
54084  PyObject *__pyx_v_Tp = 0;
54085  PyObject *__pyx_v_Hs = 0;
54086  PyObject *__pyx_v_mwl = 0;
54087  PyObject *__pyx_v_depth = 0;
54088  PyObject *__pyx_v_waveDir = 0;
54089  PyObject *__pyx_v_g = 0;
54090  PyObject *__pyx_v_N = 0;
54091  PyObject *__pyx_v_bandFactor = 0;
54092  PyObject *__pyx_v_spectName = 0;
54093  PyObject *__pyx_v_spectral_params = 0;
54094  PyObject *__pyx_v_phi = 0;
54095  PyObject *__pyx_v_Lgen = 0;
54096  PyObject *__pyx_v_Nwaves = 0;
54097  PyObject *__pyx_v_Nfreq = 0;
54098  PyObject *__pyx_v_NLongW = 0;
54099  PyObject *__pyx_v_fast = 0;
54100  PyObject *__pyx_r = 0;
54101  __Pyx_RefNannyDeclarations
54102  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
54103  {
54104  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_Tstart,&__pyx_n_s_Tend,&__pyx_n_s_x0,&__pyx_n_s_Tp,&__pyx_n_s_Hs,&__pyx_n_s_mwl,&__pyx_n_s_depth,&__pyx_n_s_waveDir,&__pyx_n_s_g,&__pyx_n_s_N,&__pyx_n_s_bandFactor,&__pyx_n_s_spectName,&__pyx_n_s_spectral_params,&__pyx_n_s_phi,&__pyx_n_s_Lgen,&__pyx_n_s_Nwaves,&__pyx_n_s_Nfreq,&__pyx_n_s_NLongW,&__pyx_n_s_fast,0};
54105  PyObject* values[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
54106  __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
54107  values[13] = ((PyObject *)((PyObject *)Py_None));
54108  values[14] = ((PyObject *)((PyObject *)Py_None));
54109  values[15] = __pyx_dynamic_args->__pyx_arg_Lgen;
54110  values[16] = ((PyObject *)((PyObject *)__pyx_int_15));
54111  values[17] = ((PyObject *)((PyObject *)__pyx_int_32));
54112  values[18] = ((PyObject *)((PyObject*)__pyx_float_10_));
54113  values[19] = ((PyObject *)((PyObject *)Py_True));
54114  if (unlikely(__pyx_kwds)) {
54115  Py_ssize_t kw_args;
54116  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
54117  switch (pos_args) {
54118  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
54119  CYTHON_FALLTHROUGH;
54120  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
54121  CYTHON_FALLTHROUGH;
54122  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
54123  CYTHON_FALLTHROUGH;
54124  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
54125  CYTHON_FALLTHROUGH;
54126  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
54127  CYTHON_FALLTHROUGH;
54128  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
54129  CYTHON_FALLTHROUGH;
54130  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
54131  CYTHON_FALLTHROUGH;
54132  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
54133  CYTHON_FALLTHROUGH;
54134  case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
54135  CYTHON_FALLTHROUGH;
54136  case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
54137  CYTHON_FALLTHROUGH;
54138  case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
54139  CYTHON_FALLTHROUGH;
54140  case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
54141  CYTHON_FALLTHROUGH;
54142  case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
54143  CYTHON_FALLTHROUGH;
54144  case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
54145  CYTHON_FALLTHROUGH;
54146  case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
54147  CYTHON_FALLTHROUGH;
54148  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
54149  CYTHON_FALLTHROUGH;
54150  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
54151  CYTHON_FALLTHROUGH;
54152  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
54153  CYTHON_FALLTHROUGH;
54154  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
54155  CYTHON_FALLTHROUGH;
54156  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
54157  CYTHON_FALLTHROUGH;
54158  case 0: break;
54159  default: goto __pyx_L5_argtuple_error;
54160  }
54161  kw_args = PyDict_Size(__pyx_kwds);
54162  switch (pos_args) {
54163  case 0:
54164  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
54165  else goto __pyx_L5_argtuple_error;
54166  CYTHON_FALLTHROUGH;
54167  case 1:
54168  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tstart)) != 0)) kw_args--;
54169  else {
54170  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 1); __PYX_ERR(0, 3152, __pyx_L3_error)
54171  }
54172  CYTHON_FALLTHROUGH;
54173  case 2:
54174  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tend)) != 0)) kw_args--;
54175  else {
54176  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 2); __PYX_ERR(0, 3152, __pyx_L3_error)
54177  }
54178  CYTHON_FALLTHROUGH;
54179  case 3:
54180  if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x0)) != 0)) kw_args--;
54181  else {
54182  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 3); __PYX_ERR(0, 3152, __pyx_L3_error)
54183  }
54184  CYTHON_FALLTHROUGH;
54185  case 4:
54186  if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Tp)) != 0)) kw_args--;
54187  else {
54188  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 4); __PYX_ERR(0, 3152, __pyx_L3_error)
54189  }
54190  CYTHON_FALLTHROUGH;
54191  case 5:
54192  if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hs)) != 0)) kw_args--;
54193  else {
54194  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 5); __PYX_ERR(0, 3152, __pyx_L3_error)
54195  }
54196  CYTHON_FALLTHROUGH;
54197  case 6:
54198  if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mwl)) != 0)) kw_args--;
54199  else {
54200  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 6); __PYX_ERR(0, 3152, __pyx_L3_error)
54201  }
54202  CYTHON_FALLTHROUGH;
54203  case 7:
54204  if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_depth)) != 0)) kw_args--;
54205  else {
54206  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 7); __PYX_ERR(0, 3152, __pyx_L3_error)
54207  }
54208  CYTHON_FALLTHROUGH;
54209  case 8:
54210  if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveDir)) != 0)) kw_args--;
54211  else {
54212  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 8); __PYX_ERR(0, 3152, __pyx_L3_error)
54213  }
54214  CYTHON_FALLTHROUGH;
54215  case 9:
54216  if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
54217  else {
54218  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 9); __PYX_ERR(0, 3152, __pyx_L3_error)
54219  }
54220  CYTHON_FALLTHROUGH;
54221  case 10:
54222  if (likely((values[10] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_N)) != 0)) kw_args--;
54223  else {
54224  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 10); __PYX_ERR(0, 3152, __pyx_L3_error)
54225  }
54226  CYTHON_FALLTHROUGH;
54227  case 11:
54228  if (likely((values[11] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_bandFactor)) != 0)) kw_args--;
54229  else {
54230  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 11); __PYX_ERR(0, 3152, __pyx_L3_error)
54231  }
54232  CYTHON_FALLTHROUGH;
54233  case 12:
54234  if (likely((values[12] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectName)) != 0)) kw_args--;
54235  else {
54236  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, 12); __PYX_ERR(0, 3152, __pyx_L3_error)
54237  }
54238  CYTHON_FALLTHROUGH;
54239  case 13:
54240  if (kw_args > 0) {
54241  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_spectral_params);
54242  if (value) { values[13] = value; kw_args--; }
54243  }
54244  CYTHON_FALLTHROUGH;
54245  case 14:
54246  if (kw_args > 0) {
54247  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi);
54248  if (value) { values[14] = value; kw_args--; }
54249  }
54250  CYTHON_FALLTHROUGH;
54251  case 15:
54252  if (kw_args > 0) {
54253  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Lgen);
54254  if (value) { values[15] = value; kw_args--; }
54255  }
54256  CYTHON_FALLTHROUGH;
54257  case 16:
54258  if (kw_args > 0) {
54259  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nwaves);
54260  if (value) { values[16] = value; kw_args--; }
54261  }
54262  CYTHON_FALLTHROUGH;
54263  case 17:
54264  if (kw_args > 0) {
54265  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Nfreq);
54266  if (value) { values[17] = value; kw_args--; }
54267  }
54268  CYTHON_FALLTHROUGH;
54269  case 18:
54270  if (kw_args > 0) {
54271  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_NLongW);
54272  if (value) { values[18] = value; kw_args--; }
54273  }
54274  CYTHON_FALLTHROUGH;
54275  case 19:
54276  if (kw_args > 0) {
54277  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fast);
54278  if (value) { values[19] = value; kw_args--; }
54279  }
54280  }
54281  if (unlikely(kw_args > 0)) {
54282  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3152, __pyx_L3_error)
54283  }
54284  } else {
54285  switch (PyTuple_GET_SIZE(__pyx_args)) {
54286  case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
54287  CYTHON_FALLTHROUGH;
54288  case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
54289  CYTHON_FALLTHROUGH;
54290  case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
54291  CYTHON_FALLTHROUGH;
54292  case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
54293  CYTHON_FALLTHROUGH;
54294  case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
54295  CYTHON_FALLTHROUGH;
54296  case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
54297  CYTHON_FALLTHROUGH;
54298  case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
54299  CYTHON_FALLTHROUGH;
54300  case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
54301  values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
54302  values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
54303  values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
54304  values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
54305  values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
54306  values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
54307  values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
54308  values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
54309  values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
54310  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
54311  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
54312  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
54313  break;
54314  default: goto __pyx_L5_argtuple_error;
54315  }
54316  }
54317  __pyx_v_self = values[0];
54318  __pyx_v_Tstart = values[1];
54319  __pyx_v_Tend = values[2];
54320  __pyx_v_x0 = values[3];
54321  __pyx_v_Tp = values[4];
54322  __pyx_v_Hs = values[5];
54323  __pyx_v_mwl = values[6];
54324  __pyx_v_depth = values[7];
54325  __pyx_v_waveDir = values[8];
54326  __pyx_v_g = values[9];
54327  __pyx_v_N = values[10];
54328  __pyx_v_bandFactor = values[11];
54329  __pyx_v_spectName = values[12];
54330  __pyx_v_spectral_params = values[13];
54331  __pyx_v_phi = values[14];
54332  __pyx_v_Lgen = values[15];
54333  __pyx_v_Nwaves = values[16];
54334  __pyx_v_Nfreq = values[17];
54335  __pyx_v_NLongW = values[18];
54336  __pyx_v_fast = values[19];
54337  }
54338  goto __pyx_L4_argument_unpacking_done;
54339  __pyx_L5_argtuple_error:;
54340  __Pyx_RaiseArgtupleInvalid("__init__", 0, 13, 20, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3152, __pyx_L3_error)
54341  __pyx_L3_error:;
54342  __Pyx_AddTraceback("WaveTools.RandomNLWavesFast.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
54343  __Pyx_RefNannyFinishContext();
54344  return NULL;
54345  __pyx_L4_argument_unpacking_done:;
54346  __pyx_r = __pyx_pf_9WaveTools_17RandomNLWavesFast___init__(__pyx_self, __pyx_v_self, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_x0, __pyx_v_Tp, __pyx_v_Hs, __pyx_v_mwl, __pyx_v_depth, __pyx_v_waveDir, __pyx_v_g, __pyx_v_N, __pyx_v_bandFactor, __pyx_v_spectName, __pyx_v_spectral_params, __pyx_v_phi, __pyx_v_Lgen, __pyx_v_Nwaves, __pyx_v_Nfreq, __pyx_v_NLongW, __pyx_v_fast);
54347 
54348  /* function exit code */
54349  __Pyx_RefNannyFinishContext();
54350  return __pyx_r;
54351 }
54352 
54353 static PyObject *__pyx_pf_9WaveTools_17RandomNLWavesFast___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_Tstart, PyObject *__pyx_v_Tend, PyObject *__pyx_v_x0, PyObject *__pyx_v_Tp, PyObject *__pyx_v_Hs, PyObject *__pyx_v_mwl, PyObject *__pyx_v_depth, PyObject *__pyx_v_waveDir, PyObject *__pyx_v_g, PyObject *__pyx_v_N, PyObject *__pyx_v_bandFactor, PyObject *__pyx_v_spectName, PyObject *__pyx_v_spectral_params, PyObject *__pyx_v_phi, PyObject *__pyx_v_Lgen, PyObject *__pyx_v_Nwaves, PyObject *__pyx_v_Nfreq, PyObject *__pyx_v_NLongW, PyObject *__pyx_v_fast) {
54354  struct __pyx_obj_9WaveTools_RandomWaves *__pyx_v_aR = NULL;
54355  struct __pyx_obj_9WaveTools_RandomNLWaves *__pyx_v_aRN = NULL;
54356  PyObject *__pyx_v_Tmax = NULL;
54357  PyObject *__pyx_v_modes = NULL;
54358  PyObject *__pyx_v_periods = NULL;
54359  PyObject *__pyx_v_ii = NULL;
54360  PyObject *__pyx_v_mode = NULL;
54361  PyObject *__pyx_v_fname = NULL;
54362  PyObject *__pyx_v_dt = NULL;
54363  PyObject *__pyx_v_series = NULL;
54364  PyObject *__pyx_v_Tstart_temp = NULL;
54365  PyObject *__pyx_v_cutoff = NULL;
54366  PyObject *__pyx_v_Nwaves_tot = NULL;
54367  PyObject *__pyx_v_Nwind = NULL;
54368  int __pyx_v_rec_d;
54369  PyObject *__pyx_r = NULL;
54370  __Pyx_RefNannyDeclarations
54371  PyObject *__pyx_t_1 = NULL;
54372  PyObject *__pyx_t_2 = NULL;
54373  PyObject *__pyx_t_3 = NULL;
54374  PyObject *__pyx_t_4 = NULL;
54375  int __pyx_t_5;
54376  PyObject *__pyx_t_6 = NULL;
54377  Py_ssize_t __pyx_t_7;
54378  PyObject *__pyx_t_8 = NULL;
54379  PyObject *__pyx_t_9 = NULL;
54380  int __pyx_t_10;
54381  int __pyx_t_11;
54382  __Pyx_RefNannySetupContext("__init__", 0);
54383  __Pyx_INCREF(__pyx_v_Nwaves);
54384 
54385  /* "WaveTools.py":3173
54386  * fast = True
54387  * ):
54388  * self.fast = fast # <<<<<<<<<<<<<<
54389  * aR = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast)
54390  * aRN = RandomNLWaves(Tstart,Tend,Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi, fast = self.fast)
54391  */
54392  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fast, __pyx_v_fast) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
54393 
54394  /* "WaveTools.py":3174
54395  * ):
54396  * self.fast = fast
54397  * aR = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast) # <<<<<<<<<<<<<<
54398  * aRN = RandomNLWaves(Tstart,Tend,Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi, fast = self.fast)
54399  * self.omega = aR.omega
54400  */
54401  __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3174, __pyx_L1_error)
54402  __Pyx_GOTREF(__pyx_t_1);
54403  __Pyx_INCREF(__pyx_v_Tp);
54404  __Pyx_GIVEREF(__pyx_v_Tp);
54405  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_Tp);
54406  __Pyx_INCREF(__pyx_v_Hs);
54407  __Pyx_GIVEREF(__pyx_v_Hs);
54408  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_Hs);
54409  __Pyx_INCREF(__pyx_v_mwl);
54410  __Pyx_GIVEREF(__pyx_v_mwl);
54411  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_mwl);
54412  __Pyx_INCREF(__pyx_v_depth);
54413  __Pyx_GIVEREF(__pyx_v_depth);
54414  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_depth);
54415  __Pyx_INCREF(__pyx_v_waveDir);
54416  __Pyx_GIVEREF(__pyx_v_waveDir);
54417  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_waveDir);
54418  __Pyx_INCREF(__pyx_v_g);
54419  __Pyx_GIVEREF(__pyx_v_g);
54420  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_g);
54421  __Pyx_INCREF(__pyx_v_N);
54422  __Pyx_GIVEREF(__pyx_v_N);
54423  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_N);
54424  __Pyx_INCREF(__pyx_v_bandFactor);
54425  __Pyx_GIVEREF(__pyx_v_bandFactor);
54426  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_bandFactor);
54427  __Pyx_INCREF(__pyx_v_spectName);
54428  __Pyx_GIVEREF(__pyx_v_spectName);
54429  PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_v_spectName);
54430  __Pyx_INCREF(__pyx_v_spectral_params);
54431  __Pyx_GIVEREF(__pyx_v_spectral_params);
54432  PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_v_spectral_params);
54433  __Pyx_INCREF(__pyx_v_phi);
54434  __Pyx_GIVEREF(__pyx_v_phi);
54435  PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_v_phi);
54436  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3174, __pyx_L1_error)
54437  __Pyx_GOTREF(__pyx_t_2);
54438  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fast); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3174, __pyx_L1_error)
54439  __Pyx_GOTREF(__pyx_t_3);
54440  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fast, __pyx_t_3) < 0) __PYX_ERR(0, 3174, __pyx_L1_error)
54441  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54442  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_RandomWaves), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3174, __pyx_L1_error)
54443  __Pyx_GOTREF(__pyx_t_3);
54444  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54445  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54446  __pyx_v_aR = ((struct __pyx_obj_9WaveTools_RandomWaves *)__pyx_t_3);
54447  __pyx_t_3 = 0;
54448 
54449  /* "WaveTools.py":3175
54450  * self.fast = fast
54451  * aR = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast)
54452  * aRN = RandomNLWaves(Tstart,Tend,Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi, fast = self.fast) # <<<<<<<<<<<<<<
54453  * self.omega = aR.omega
54454  * self.mwl = mwl
54455  */
54456  __pyx_t_3 = PyTuple_New(13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3175, __pyx_L1_error)
54457  __Pyx_GOTREF(__pyx_t_3);
54458  __Pyx_INCREF(__pyx_v_Tstart);
54459  __Pyx_GIVEREF(__pyx_v_Tstart);
54460  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_Tstart);
54461  __Pyx_INCREF(__pyx_v_Tend);
54462  __Pyx_GIVEREF(__pyx_v_Tend);
54463  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_Tend);
54464  __Pyx_INCREF(__pyx_v_Tp);
54465  __Pyx_GIVEREF(__pyx_v_Tp);
54466  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_Tp);
54467  __Pyx_INCREF(__pyx_v_Hs);
54468  __Pyx_GIVEREF(__pyx_v_Hs);
54469  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_Hs);
54470  __Pyx_INCREF(__pyx_v_mwl);
54471  __Pyx_GIVEREF(__pyx_v_mwl);
54472  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_mwl);
54473  __Pyx_INCREF(__pyx_v_depth);
54474  __Pyx_GIVEREF(__pyx_v_depth);
54475  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_depth);
54476  __Pyx_INCREF(__pyx_v_waveDir);
54477  __Pyx_GIVEREF(__pyx_v_waveDir);
54478  PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_v_waveDir);
54479  __Pyx_INCREF(__pyx_v_g);
54480  __Pyx_GIVEREF(__pyx_v_g);
54481  PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_v_g);
54482  __Pyx_INCREF(__pyx_v_N);
54483  __Pyx_GIVEREF(__pyx_v_N);
54484  PyTuple_SET_ITEM(__pyx_t_3, 8, __pyx_v_N);
54485  __Pyx_INCREF(__pyx_v_bandFactor);
54486  __Pyx_GIVEREF(__pyx_v_bandFactor);
54487  PyTuple_SET_ITEM(__pyx_t_3, 9, __pyx_v_bandFactor);
54488  __Pyx_INCREF(__pyx_v_spectName);
54489  __Pyx_GIVEREF(__pyx_v_spectName);
54490  PyTuple_SET_ITEM(__pyx_t_3, 10, __pyx_v_spectName);
54491  __Pyx_INCREF(__pyx_v_spectral_params);
54492  __Pyx_GIVEREF(__pyx_v_spectral_params);
54493  PyTuple_SET_ITEM(__pyx_t_3, 11, __pyx_v_spectral_params);
54494  __Pyx_INCREF(__pyx_v_phi);
54495  __Pyx_GIVEREF(__pyx_v_phi);
54496  PyTuple_SET_ITEM(__pyx_t_3, 12, __pyx_v_phi);
54497  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3175, __pyx_L1_error)
54498  __Pyx_GOTREF(__pyx_t_2);
54499  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fast); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3175, __pyx_L1_error)
54500  __Pyx_GOTREF(__pyx_t_1);
54501  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fast, __pyx_t_1) < 0) __PYX_ERR(0, 3175, __pyx_L1_error)
54502  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54503  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves), __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3175, __pyx_L1_error)
54504  __Pyx_GOTREF(__pyx_t_1);
54505  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54506  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54507  __pyx_v_aRN = ((struct __pyx_obj_9WaveTools_RandomNLWaves *)__pyx_t_1);
54508  __pyx_t_1 = 0;
54509 
54510  /* "WaveTools.py":3176
54511  * aR = RandomWaves(Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi,fast = self.fast)
54512  * aRN = RandomNLWaves(Tstart,Tend,Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi, fast = self.fast)
54513  * self.omega = aR.omega # <<<<<<<<<<<<<<
54514  * self.mwl = mwl
54515  *
54516  */
54517  __pyx_t_1 = ((PyObject *)__pyx_v_aR->omega);
54518  __Pyx_INCREF(__pyx_t_1);
54519  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_omega, __pyx_t_1) < 0) __PYX_ERR(0, 3176, __pyx_L1_error)
54520  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54521 
54522  /* "WaveTools.py":3177
54523  * aRN = RandomNLWaves(Tstart,Tend,Tp,Hs,mwl,depth,waveDir,g,N,bandFactor,spectName,spectral_params,phi, fast = self.fast)
54524  * self.omega = aR.omega
54525  * self.mwl = mwl # <<<<<<<<<<<<<<
54526  *
54527  * Tmax = NLongW*Tp/1.1
54528  */
54529  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mwl, __pyx_v_mwl) < 0) __PYX_ERR(0, 3177, __pyx_L1_error)
54530 
54531  /* "WaveTools.py":3179
54532  * self.mwl = mwl
54533  *
54534  * Tmax = NLongW*Tp/1.1 # <<<<<<<<<<<<<<
54535  * modes = ["short","linear","long"]
54536  * periods = [Tp/2./1.1,old_div(Tp,1.1), Tmax]
54537  */
54538  __pyx_t_1 = PyNumber_Multiply(__pyx_v_NLongW, __pyx_v_Tp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3179, __pyx_L1_error)
54539  __Pyx_GOTREF(__pyx_t_1);
54540  __pyx_t_2 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_1, __pyx_float_1_1, 1.1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3179, __pyx_L1_error)
54541  __Pyx_GOTREF(__pyx_t_2);
54542  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54543  __pyx_v_Tmax = __pyx_t_2;
54544  __pyx_t_2 = 0;
54545 
54546  /* "WaveTools.py":3180
54547  *
54548  * Tmax = NLongW*Tp/1.1
54549  * modes = ["short","linear","long"] # <<<<<<<<<<<<<<
54550  * periods = [Tp/2./1.1,old_div(Tp,1.1), Tmax]
54551  * self.TS= []
54552  */
54553  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3180, __pyx_L1_error)
54554  __Pyx_GOTREF(__pyx_t_2);
54555  __Pyx_INCREF(__pyx_n_s_short);
54556  __Pyx_GIVEREF(__pyx_n_s_short);
54557  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_short);
54558  __Pyx_INCREF(__pyx_n_s_linear);
54559  __Pyx_GIVEREF(__pyx_n_s_linear);
54560  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_linear);
54561  __Pyx_INCREF(__pyx_n_s_long);
54562  __Pyx_GIVEREF(__pyx_n_s_long);
54563  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_long);
54564  __pyx_v_modes = ((PyObject*)__pyx_t_2);
54565  __pyx_t_2 = 0;
54566 
54567  /* "WaveTools.py":3181
54568  * Tmax = NLongW*Tp/1.1
54569  * modes = ["short","linear","long"]
54570  * periods = [Tp/2./1.1,old_div(Tp,1.1), Tmax] # <<<<<<<<<<<<<<
54571  * self.TS= []
54572  * ii = -1
54573  */
54574  __pyx_t_2 = __Pyx_PyFloat_TrueDivideObjC(__pyx_v_Tp, __pyx_float_2_, 2., 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3181, __pyx_L1_error)
54575  __Pyx_GOTREF(__pyx_t_2);
54576  __pyx_t_1 = __Pyx_PyFloat_TrueDivideObjC(__pyx_t_2, __pyx_float_1_1, 1.1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3181, __pyx_L1_error)
54577  __Pyx_GOTREF(__pyx_t_1);
54578  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54579  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_old_div); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3181, __pyx_L1_error)
54580  __Pyx_GOTREF(__pyx_t_3);
54581  __pyx_t_4 = NULL;
54582  __pyx_t_5 = 0;
54583  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
54584  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
54585  if (likely(__pyx_t_4)) {
54586  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
54587  __Pyx_INCREF(__pyx_t_4);
54588  __Pyx_INCREF(function);
54589  __Pyx_DECREF_SET(__pyx_t_3, function);
54590  __pyx_t_5 = 1;
54591  }
54592  }
54593  #if CYTHON_FAST_PYCALL
54594  if (PyFunction_Check(__pyx_t_3)) {
54595  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_Tp, __pyx_float_1_1};
54596  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3181, __pyx_L1_error)
54597  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
54598  __Pyx_GOTREF(__pyx_t_2);
54599  } else
54600  #endif
54601  #if CYTHON_FAST_PYCCALL
54602  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
54603  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_Tp, __pyx_float_1_1};
54604  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3181, __pyx_L1_error)
54605  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
54606  __Pyx_GOTREF(__pyx_t_2);
54607  } else
54608  #endif
54609  {
54610  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3181, __pyx_L1_error)
54611  __Pyx_GOTREF(__pyx_t_6);
54612  if (__pyx_t_4) {
54613  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
54614  }
54615  __Pyx_INCREF(__pyx_v_Tp);
54616  __Pyx_GIVEREF(__pyx_v_Tp);
54617  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_Tp);
54618  __Pyx_INCREF(__pyx_float_1_1);
54619  __Pyx_GIVEREF(__pyx_float_1_1);
54620  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_float_1_1);
54621  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3181, __pyx_L1_error)
54622  __Pyx_GOTREF(__pyx_t_2);
54623  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54624  }
54625  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54626  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3181, __pyx_L1_error)
54627  __Pyx_GOTREF(__pyx_t_3);
54628  __Pyx_GIVEREF(__pyx_t_1);
54629  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
54630  __Pyx_GIVEREF(__pyx_t_2);
54631  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
54632  __Pyx_INCREF(__pyx_v_Tmax);
54633  __Pyx_GIVEREF(__pyx_v_Tmax);
54634  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_v_Tmax);
54635  __pyx_t_1 = 0;
54636  __pyx_t_2 = 0;
54637  __pyx_v_periods = ((PyObject*)__pyx_t_3);
54638  __pyx_t_3 = 0;
54639 
54640  /* "WaveTools.py":3182
54641  * modes = ["short","linear","long"]
54642  * periods = [Tp/2./1.1,old_div(Tp,1.1), Tmax]
54643  * self.TS= [] # <<<<<<<<<<<<<<
54644  * ii = -1
54645  * for mode in modes:
54646  */
54647  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3182, __pyx_L1_error)
54648  __Pyx_GOTREF(__pyx_t_3);
54649  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_TS, __pyx_t_3) < 0) __PYX_ERR(0, 3182, __pyx_L1_error)
54650  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54651 
54652  /* "WaveTools.py":3183
54653  * periods = [Tp/2./1.1,old_div(Tp,1.1), Tmax]
54654  * self.TS= []
54655  * ii = -1 # <<<<<<<<<<<<<<
54656  * for mode in modes:
54657  * logEvent("INFO: Calculating nonlinear corrections for "+mode+" waves. This may take a while")
54658  */
54659  __Pyx_INCREF(__pyx_int_neg_1);
54660  __pyx_v_ii = __pyx_int_neg_1;
54661 
54662  /* "WaveTools.py":3184
54663  * self.TS= []
54664  * ii = -1
54665  * for mode in modes: # <<<<<<<<<<<<<<
54666  * logEvent("INFO: Calculating nonlinear corrections for "+mode+" waves. This may take a while")
54667  * ii+=1
54668  */
54669  __pyx_t_3 = __pyx_v_modes; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
54670  for (;;) {
54671  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
54672  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
54673  __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 3184, __pyx_L1_error)
54674  #else
54675  __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3184, __pyx_L1_error)
54676  __Pyx_GOTREF(__pyx_t_2);
54677  #endif
54678  __Pyx_XDECREF_SET(__pyx_v_mode, __pyx_t_2);
54679  __pyx_t_2 = 0;
54680 
54681  /* "WaveTools.py":3185
54682  * ii = -1
54683  * for mode in modes:
54684  * logEvent("INFO: Calculating nonlinear corrections for "+mode+" waves. This may take a while") # <<<<<<<<<<<<<<
54685  * ii+=1
54686  * fname = "randomNLWaves_"+mode+".csv"
54687  */
54688  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3185, __pyx_L1_error)
54689  __Pyx_GOTREF(__pyx_t_1);
54690  __pyx_t_6 = PyNumber_Add(__pyx_kp_s_INFO_Calculating_nonlinear_corre, __pyx_v_mode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3185, __pyx_L1_error)
54691  __Pyx_GOTREF(__pyx_t_6);
54692  __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_kp_s_waves_This_may_take_a_while); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3185, __pyx_L1_error)
54693  __Pyx_GOTREF(__pyx_t_4);
54694  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
54695  __pyx_t_6 = NULL;
54696  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
54697  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
54698  if (likely(__pyx_t_6)) {
54699  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
54700  __Pyx_INCREF(__pyx_t_6);
54701  __Pyx_INCREF(function);
54702  __Pyx_DECREF_SET(__pyx_t_1, function);
54703  }
54704  }
54705  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
54706  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
54707  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54708  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3185, __pyx_L1_error)
54709  __Pyx_GOTREF(__pyx_t_2);
54710  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54711  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54712 
54713  /* "WaveTools.py":3186
54714  * for mode in modes:
54715  * logEvent("INFO: Calculating nonlinear corrections for "+mode+" waves. This may take a while")
54716  * ii+=1 # <<<<<<<<<<<<<<
54717  * fname = "randomNLWaves_"+mode+".csv"
54718  * dt = old_div(periods[ii],50.)
54719  */
54720  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_ii, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3186, __pyx_L1_error)
54721  __Pyx_GOTREF(__pyx_t_2);
54722  __Pyx_DECREF_SET(__pyx_v_ii, __pyx_t_2);
54723  __pyx_t_2 = 0;
54724 
54725  /* "WaveTools.py":3187
54726  * logEvent("INFO: Calculating nonlinear corrections for "+mode+" waves. This may take a while")
54727  * ii+=1
54728  * fname = "randomNLWaves_"+mode+".csv" # <<<<<<<<<<<<<<
54729  * dt = old_div(periods[ii],50.)
54730  * series = aRN.writeEtaSeries(Tstart,Tend,dt,x0,fname,mode,False,Lgen)
54731  */
54732  __pyx_t_2 = PyNumber_Add(__pyx_n_s_randomNLWaves, __pyx_v_mode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3187, __pyx_L1_error)
54733  __Pyx_GOTREF(__pyx_t_2);
54734  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_csv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3187, __pyx_L1_error)
54735  __Pyx_GOTREF(__pyx_t_1);
54736  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54737  __Pyx_XDECREF_SET(__pyx_v_fname, __pyx_t_1);
54738  __pyx_t_1 = 0;
54739 
54740  /* "WaveTools.py":3188
54741  * ii+=1
54742  * fname = "randomNLWaves_"+mode+".csv"
54743  * dt = old_div(periods[ii],50.) # <<<<<<<<<<<<<<
54744  * series = aRN.writeEtaSeries(Tstart,Tend,dt,x0,fname,mode,False,Lgen)
54745  * Tstart_temp = series[0,0]
54746  */
54747  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3188, __pyx_L1_error)
54748  __Pyx_GOTREF(__pyx_t_2);
54749  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_periods, __pyx_v_ii); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3188, __pyx_L1_error)
54750  __Pyx_GOTREF(__pyx_t_4);
54751  __pyx_t_6 = NULL;
54752  __pyx_t_5 = 0;
54753  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
54754  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
54755  if (likely(__pyx_t_6)) {
54756  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
54757  __Pyx_INCREF(__pyx_t_6);
54758  __Pyx_INCREF(function);
54759  __Pyx_DECREF_SET(__pyx_t_2, function);
54760  __pyx_t_5 = 1;
54761  }
54762  }
54763  #if CYTHON_FAST_PYCALL
54764  if (PyFunction_Check(__pyx_t_2)) {
54765  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_float_50_};
54766  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3188, __pyx_L1_error)
54767  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
54768  __Pyx_GOTREF(__pyx_t_1);
54769  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54770  } else
54771  #endif
54772  #if CYTHON_FAST_PYCCALL
54773  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
54774  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_float_50_};
54775  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3188, __pyx_L1_error)
54776  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
54777  __Pyx_GOTREF(__pyx_t_1);
54778  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54779  } else
54780  #endif
54781  {
54782  __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3188, __pyx_L1_error)
54783  __Pyx_GOTREF(__pyx_t_8);
54784  if (__pyx_t_6) {
54785  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
54786  }
54787  __Pyx_GIVEREF(__pyx_t_4);
54788  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_t_4);
54789  __Pyx_INCREF(__pyx_float_50_);
54790  __Pyx_GIVEREF(__pyx_float_50_);
54791  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_float_50_);
54792  __pyx_t_4 = 0;
54793  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3188, __pyx_L1_error)
54794  __Pyx_GOTREF(__pyx_t_1);
54795  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54796  }
54797  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54798  __Pyx_XDECREF_SET(__pyx_v_dt, __pyx_t_1);
54799  __pyx_t_1 = 0;
54800 
54801  /* "WaveTools.py":3189
54802  * fname = "randomNLWaves_"+mode+".csv"
54803  * dt = old_div(periods[ii],50.)
54804  * series = aRN.writeEtaSeries(Tstart,Tend,dt,x0,fname,mode,False,Lgen) # <<<<<<<<<<<<<<
54805  * Tstart_temp = series[0,0]
54806  * cutoff = 0.2*periods[ii]/(Tend-Tstart_temp)
54807  */
54808  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_aRN), __pyx_n_s_writeEtaSeries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3189, __pyx_L1_error)
54809  __Pyx_GOTREF(__pyx_t_2);
54810  __pyx_t_8 = NULL;
54811  __pyx_t_5 = 0;
54812  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
54813  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
54814  if (likely(__pyx_t_8)) {
54815  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
54816  __Pyx_INCREF(__pyx_t_8);
54817  __Pyx_INCREF(function);
54818  __Pyx_DECREF_SET(__pyx_t_2, function);
54819  __pyx_t_5 = 1;
54820  }
54821  }
54822  #if CYTHON_FAST_PYCALL
54823  if (PyFunction_Check(__pyx_t_2)) {
54824  PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_dt, __pyx_v_x0, __pyx_v_fname, __pyx_v_mode, Py_False, __pyx_v_Lgen};
54825  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 8+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3189, __pyx_L1_error)
54826  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
54827  __Pyx_GOTREF(__pyx_t_1);
54828  } else
54829  #endif
54830  #if CYTHON_FAST_PYCCALL
54831  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
54832  PyObject *__pyx_temp[9] = {__pyx_t_8, __pyx_v_Tstart, __pyx_v_Tend, __pyx_v_dt, __pyx_v_x0, __pyx_v_fname, __pyx_v_mode, Py_False, __pyx_v_Lgen};
54833  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 8+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3189, __pyx_L1_error)
54834  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
54835  __Pyx_GOTREF(__pyx_t_1);
54836  } else
54837  #endif
54838  {
54839  __pyx_t_4 = PyTuple_New(8+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3189, __pyx_L1_error)
54840  __Pyx_GOTREF(__pyx_t_4);
54841  if (__pyx_t_8) {
54842  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
54843  }
54844  __Pyx_INCREF(__pyx_v_Tstart);
54845  __Pyx_GIVEREF(__pyx_v_Tstart);
54846  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_Tstart);
54847  __Pyx_INCREF(__pyx_v_Tend);
54848  __Pyx_GIVEREF(__pyx_v_Tend);
54849  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_Tend);
54850  __Pyx_INCREF(__pyx_v_dt);
54851  __Pyx_GIVEREF(__pyx_v_dt);
54852  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_dt);
54853  __Pyx_INCREF(__pyx_v_x0);
54854  __Pyx_GIVEREF(__pyx_v_x0);
54855  PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_5, __pyx_v_x0);
54856  __Pyx_INCREF(__pyx_v_fname);
54857  __Pyx_GIVEREF(__pyx_v_fname);
54858  PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_5, __pyx_v_fname);
54859  __Pyx_INCREF(__pyx_v_mode);
54860  __Pyx_GIVEREF(__pyx_v_mode);
54861  PyTuple_SET_ITEM(__pyx_t_4, 5+__pyx_t_5, __pyx_v_mode);
54862  __Pyx_INCREF(Py_False);
54863  __Pyx_GIVEREF(Py_False);
54864  PyTuple_SET_ITEM(__pyx_t_4, 6+__pyx_t_5, Py_False);
54865  __Pyx_INCREF(__pyx_v_Lgen);
54866  __Pyx_GIVEREF(__pyx_v_Lgen);
54867  PyTuple_SET_ITEM(__pyx_t_4, 7+__pyx_t_5, __pyx_v_Lgen);
54868  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3189, __pyx_L1_error)
54869  __Pyx_GOTREF(__pyx_t_1);
54870  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54871  }
54872  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54873  __Pyx_XDECREF_SET(__pyx_v_series, __pyx_t_1);
54874  __pyx_t_1 = 0;
54875 
54876  /* "WaveTools.py":3190
54877  * dt = old_div(periods[ii],50.)
54878  * series = aRN.writeEtaSeries(Tstart,Tend,dt,x0,fname,mode,False,Lgen)
54879  * Tstart_temp = series[0,0] # <<<<<<<<<<<<<<
54880  * cutoff = 0.2*periods[ii]/(Tend-Tstart_temp)
54881  *
54882  */
54883  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_series, __pyx_tuple__46); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3190, __pyx_L1_error)
54884  __Pyx_GOTREF(__pyx_t_1);
54885  __Pyx_XDECREF_SET(__pyx_v_Tstart_temp, __pyx_t_1);
54886  __pyx_t_1 = 0;
54887 
54888  /* "WaveTools.py":3191
54889  * series = aRN.writeEtaSeries(Tstart,Tend,dt,x0,fname,mode,False,Lgen)
54890  * Tstart_temp = series[0,0]
54891  * cutoff = 0.2*periods[ii]/(Tend-Tstart_temp) # <<<<<<<<<<<<<<
54892  *
54893  * #Checking if there are enough windows
54894  */
54895  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_periods, __pyx_v_ii); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3191, __pyx_L1_error)
54896  __Pyx_GOTREF(__pyx_t_1);
54897  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_2, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3191, __pyx_L1_error)
54898  __Pyx_GOTREF(__pyx_t_2);
54899  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54900  __pyx_t_1 = PyNumber_Subtract(__pyx_v_Tend, __pyx_v_Tstart_temp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3191, __pyx_L1_error)
54901  __Pyx_GOTREF(__pyx_t_1);
54902  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3191, __pyx_L1_error)
54903  __Pyx_GOTREF(__pyx_t_4);
54904  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54905  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54906  __Pyx_XDECREF_SET(__pyx_v_cutoff, __pyx_t_4);
54907  __pyx_t_4 = 0;
54908 
54909  /* "WaveTools.py":3194
54910  *
54911  * #Checking if there are enough windows
54912  * Nwaves_tot = int(old_div((Tend-Tstart_temp),periods[ii])) # <<<<<<<<<<<<<<
54913  * Nwaves = min(Nwaves,Nwaves_tot)
54914  * Nwind = int(old_div(Nwaves_tot,Nwaves))
54915  */
54916  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3194, __pyx_L1_error)
54917  __Pyx_GOTREF(__pyx_t_1);
54918  __pyx_t_2 = PyNumber_Subtract(__pyx_v_Tend, __pyx_v_Tstart_temp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3194, __pyx_L1_error)
54919  __Pyx_GOTREF(__pyx_t_2);
54920  __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_periods, __pyx_v_ii); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3194, __pyx_L1_error)
54921  __Pyx_GOTREF(__pyx_t_8);
54922  __pyx_t_6 = NULL;
54923  __pyx_t_5 = 0;
54924  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
54925  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
54926  if (likely(__pyx_t_6)) {
54927  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
54928  __Pyx_INCREF(__pyx_t_6);
54929  __Pyx_INCREF(function);
54930  __Pyx_DECREF_SET(__pyx_t_1, function);
54931  __pyx_t_5 = 1;
54932  }
54933  }
54934  #if CYTHON_FAST_PYCALL
54935  if (PyFunction_Check(__pyx_t_1)) {
54936  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_8};
54937  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3194, __pyx_L1_error)
54938  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
54939  __Pyx_GOTREF(__pyx_t_4);
54940  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54941  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54942  } else
54943  #endif
54944  #if CYTHON_FAST_PYCCALL
54945  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
54946  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_8};
54947  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3194, __pyx_L1_error)
54948  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
54949  __Pyx_GOTREF(__pyx_t_4);
54950  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54951  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54952  } else
54953  #endif
54954  {
54955  __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3194, __pyx_L1_error)
54956  __Pyx_GOTREF(__pyx_t_9);
54957  if (__pyx_t_6) {
54958  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
54959  }
54960  __Pyx_GIVEREF(__pyx_t_2);
54961  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_t_2);
54962  __Pyx_GIVEREF(__pyx_t_8);
54963  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_t_8);
54964  __pyx_t_2 = 0;
54965  __pyx_t_8 = 0;
54966  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3194, __pyx_L1_error)
54967  __Pyx_GOTREF(__pyx_t_4);
54968  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
54969  }
54970  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
54971  __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3194, __pyx_L1_error)
54972  __Pyx_GOTREF(__pyx_t_1);
54973  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54974  __Pyx_XDECREF_SET(__pyx_v_Nwaves_tot, __pyx_t_1);
54975  __pyx_t_1 = 0;
54976 
54977  /* "WaveTools.py":3195
54978  * #Checking if there are enough windows
54979  * Nwaves_tot = int(old_div((Tend-Tstart_temp),periods[ii]))
54980  * Nwaves = min(Nwaves,Nwaves_tot) # <<<<<<<<<<<<<<
54981  * Nwind = int(old_div(Nwaves_tot,Nwaves))
54982  * if Nwind < 3:
54983  */
54984  __Pyx_INCREF(__pyx_v_Nwaves_tot);
54985  __pyx_t_1 = __pyx_v_Nwaves_tot;
54986  __Pyx_INCREF(__pyx_v_Nwaves);
54987  __pyx_t_4 = __pyx_v_Nwaves;
54988  __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3195, __pyx_L1_error)
54989  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3195, __pyx_L1_error)
54990  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
54991  if (__pyx_t_10) {
54992  __Pyx_INCREF(__pyx_t_1);
54993  __pyx_t_9 = __pyx_t_1;
54994  } else {
54995  __Pyx_INCREF(__pyx_t_4);
54996  __pyx_t_9 = __pyx_t_4;
54997  }
54998  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54999  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55000  __pyx_t_1 = __pyx_t_9;
55001  __Pyx_INCREF(__pyx_t_1);
55002  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55003  __Pyx_DECREF_SET(__pyx_v_Nwaves, __pyx_t_1);
55004  __pyx_t_1 = 0;
55005 
55006  /* "WaveTools.py":3196
55007  * Nwaves_tot = int(old_div((Tend-Tstart_temp),periods[ii]))
55008  * Nwaves = min(Nwaves,Nwaves_tot)
55009  * Nwind = int(old_div(Nwaves_tot,Nwaves)) # <<<<<<<<<<<<<<
55010  * if Nwind < 3:
55011  * rec_d = True
55012  */
55013  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_old_div); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3196, __pyx_L1_error)
55014  __Pyx_GOTREF(__pyx_t_9);
55015  __pyx_t_4 = NULL;
55016  __pyx_t_5 = 0;
55017  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
55018  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
55019  if (likely(__pyx_t_4)) {
55020  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
55021  __Pyx_INCREF(__pyx_t_4);
55022  __Pyx_INCREF(function);
55023  __Pyx_DECREF_SET(__pyx_t_9, function);
55024  __pyx_t_5 = 1;
55025  }
55026  }
55027  #if CYTHON_FAST_PYCALL
55028  if (PyFunction_Check(__pyx_t_9)) {
55029  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_Nwaves_tot, __pyx_v_Nwaves};
55030  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __pyx_L1_error)
55031  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
55032  __Pyx_GOTREF(__pyx_t_1);
55033  } else
55034  #endif
55035  #if CYTHON_FAST_PYCCALL
55036  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
55037  PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_Nwaves_tot, __pyx_v_Nwaves};
55038  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __pyx_L1_error)
55039  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
55040  __Pyx_GOTREF(__pyx_t_1);
55041  } else
55042  #endif
55043  {
55044  __pyx_t_8 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3196, __pyx_L1_error)
55045  __Pyx_GOTREF(__pyx_t_8);
55046  if (__pyx_t_4) {
55047  __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
55048  }
55049  __Pyx_INCREF(__pyx_v_Nwaves_tot);
55050  __Pyx_GIVEREF(__pyx_v_Nwaves_tot);
55051  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_5, __pyx_v_Nwaves_tot);
55052  __Pyx_INCREF(__pyx_v_Nwaves);
55053  __Pyx_GIVEREF(__pyx_v_Nwaves);
55054  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_5, __pyx_v_Nwaves);
55055  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3196, __pyx_L1_error)
55056  __Pyx_GOTREF(__pyx_t_1);
55057  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55058  }
55059  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55060  __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3196, __pyx_L1_error)
55061  __Pyx_GOTREF(__pyx_t_9);
55062  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55063  __Pyx_XDECREF_SET(__pyx_v_Nwind, __pyx_t_9);
55064  __pyx_t_9 = 0;
55065 
55066  /* "WaveTools.py":3197
55067  * Nwaves = min(Nwaves,Nwaves_tot)
55068  * Nwind = int(old_div(Nwaves_tot,Nwaves))
55069  * if Nwind < 3: # <<<<<<<<<<<<<<
55070  * rec_d = True
55071  * else:
55072  */
55073  __pyx_t_9 = PyObject_RichCompare(__pyx_v_Nwind, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3197, __pyx_L1_error)
55074  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 3197, __pyx_L1_error)
55075  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55076  if (__pyx_t_10) {
55077 
55078  /* "WaveTools.py":3198
55079  * Nwind = int(old_div(Nwaves_tot,Nwaves))
55080  * if Nwind < 3:
55081  * rec_d = True # <<<<<<<<<<<<<<
55082  * else:
55083  * rec_d = False
55084  */
55085  __pyx_v_rec_d = 1;
55086 
55087  /* "WaveTools.py":3197
55088  * Nwaves = min(Nwaves,Nwaves_tot)
55089  * Nwind = int(old_div(Nwaves_tot,Nwaves))
55090  * if Nwind < 3: # <<<<<<<<<<<<<<
55091  * rec_d = True
55092  * else:
55093  */
55094  goto __pyx_L5;
55095  }
55096 
55097  /* "WaveTools.py":3200
55098  * rec_d = True
55099  * else:
55100  * rec_d = False # <<<<<<<<<<<<<<
55101  *
55102  *
55103  */
55104  /*else*/ {
55105  __pyx_v_rec_d = 0;
55106  }
55107  __pyx_L5:;
55108 
55109  /* "WaveTools.py":3203
55110  *
55111  *
55112  * self.TS.append(TimeSeries( # <<<<<<<<<<<<<<
55113  * fname,
55114  * 0,
55115  */
55116  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3203, __pyx_L1_error)
55117  __Pyx_GOTREF(__pyx_t_9);
55118 
55119  /* "WaveTools.py":3211
55120  * mwl,
55121  * waveDir,
55122  * g, # <<<<<<<<<<<<<<
55123  * cutoffTotal = cutoff,
55124  * rec_direct = rec_d,
55125  */
55126  __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3203, __pyx_L1_error)
55127  __Pyx_GOTREF(__pyx_t_1);
55128  __Pyx_INCREF(__pyx_v_fname);
55129  __Pyx_GIVEREF(__pyx_v_fname);
55130  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fname);
55131  __Pyx_INCREF(__pyx_int_0);
55132  __Pyx_GIVEREF(__pyx_int_0);
55133  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
55134  __Pyx_INCREF(__pyx_v_x0);
55135  __Pyx_GIVEREF(__pyx_v_x0);
55136  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_x0);
55137  __Pyx_INCREF(__pyx_v_depth);
55138  __Pyx_GIVEREF(__pyx_v_depth);
55139  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_depth);
55140  __Pyx_INCREF(__pyx_v_Nfreq);
55141  __Pyx_GIVEREF(__pyx_v_Nfreq);
55142  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_Nfreq);
55143  __Pyx_INCREF(__pyx_v_mwl);
55144  __Pyx_GIVEREF(__pyx_v_mwl);
55145  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_mwl);
55146  __Pyx_INCREF(__pyx_v_waveDir);
55147  __Pyx_GIVEREF(__pyx_v_waveDir);
55148  PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_waveDir);
55149  __Pyx_INCREF(__pyx_v_g);
55150  __Pyx_GIVEREF(__pyx_v_g);
55151  PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_g);
55152 
55153  /* "WaveTools.py":3212
55154  * waveDir,
55155  * g,
55156  * cutoffTotal = cutoff, # <<<<<<<<<<<<<<
55157  * rec_direct = rec_d,
55158  * window_params = {"Nwaves":Nwaves ,"Tm":periods[ii],"Window":"costap","Overlap":0.7,"Cutoff":0.1},
55159  */
55160  __pyx_t_8 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3212, __pyx_L1_error)
55161  __Pyx_GOTREF(__pyx_t_8);
55162  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_cutoffTotal, __pyx_v_cutoff) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
55163 
55164  /* "WaveTools.py":3213
55165  * g,
55166  * cutoffTotal = cutoff,
55167  * rec_direct = rec_d, # <<<<<<<<<<<<<<
55168  * window_params = {"Nwaves":Nwaves ,"Tm":periods[ii],"Window":"costap","Overlap":0.7,"Cutoff":0.1},
55169  * arrayData = True,
55170  */
55171  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_rec_d); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3213, __pyx_L1_error)
55172  __Pyx_GOTREF(__pyx_t_4);
55173  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_rec_direct, __pyx_t_4) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
55174  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
55175 
55176  /* "WaveTools.py":3214
55177  * cutoffTotal = cutoff,
55178  * rec_direct = rec_d,
55179  * window_params = {"Nwaves":Nwaves ,"Tm":periods[ii],"Window":"costap","Overlap":0.7,"Cutoff":0.1}, # <<<<<<<<<<<<<<
55180  * arrayData = True,
55181  * seriesArray = series,
55182  */
55183  __pyx_t_4 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3214, __pyx_L1_error)
55184  __Pyx_GOTREF(__pyx_t_4);
55185  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Nwaves, __pyx_v_Nwaves) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
55186  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_periods, __pyx_v_ii); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error)
55187  __Pyx_GOTREF(__pyx_t_2);
55188  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Tm, __pyx_t_2) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
55189  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55190  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Window, __pyx_n_s_costap) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
55191  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Overlap, __pyx_float_0_7) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
55192  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_Cutoff, __pyx_float_0_1) < 0) __PYX_ERR(0, 3214, __pyx_L1_error)
55193  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_window_params, __pyx_t_4) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
55194  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
55195 
55196  /* "WaveTools.py":3215
55197  * rec_direct = rec_d,
55198  * window_params = {"Nwaves":Nwaves ,"Tm":periods[ii],"Window":"costap","Overlap":0.7,"Cutoff":0.1},
55199  * arrayData = True, # <<<<<<<<<<<<<<
55200  * seriesArray = series,
55201  * fast = self.fast)
55202  */
55203  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_arrayData, Py_True) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
55204 
55205  /* "WaveTools.py":3216
55206  * window_params = {"Nwaves":Nwaves ,"Tm":periods[ii],"Window":"costap","Overlap":0.7,"Cutoff":0.1},
55207  * arrayData = True,
55208  * seriesArray = series, # <<<<<<<<<<<<<<
55209  * fast = self.fast)
55210  * )
55211  */
55212  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_seriesArray, __pyx_v_series) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
55213 
55214  /* "WaveTools.py":3217
55215  * arrayData = True,
55216  * seriesArray = series,
55217  * fast = self.fast) # <<<<<<<<<<<<<<
55218  * )
55219  *
55220  */
55221  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fast); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3217, __pyx_L1_error)
55222  __Pyx_GOTREF(__pyx_t_4);
55223  if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_fast, __pyx_t_4) < 0) __PYX_ERR(0, 3212, __pyx_L1_error)
55224  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
55225 
55226  /* "WaveTools.py":3203
55227  *
55228  *
55229  * self.TS.append(TimeSeries( # <<<<<<<<<<<<<<
55230  * fname,
55231  * 0,
55232  */
55233  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9WaveTools_TimeSeries), __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3203, __pyx_L1_error)
55234  __Pyx_GOTREF(__pyx_t_4);
55235  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55236  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
55237  __pyx_t_11 = __Pyx_PyObject_Append(__pyx_t_9, __pyx_t_4); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 3203, __pyx_L1_error)
55238  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
55239  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
55240 
55241  /* "WaveTools.py":3184
55242  * self.TS= []
55243  * ii = -1
55244  * for mode in modes: # <<<<<<<<<<<<<<
55245  * logEvent("INFO: Calculating nonlinear corrections for "+mode+" waves. This may take a while")
55246  * ii+=1
55247  */
55248  }
55249  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55250 
55251  /* "WaveTools.py":3152
55252  * Switch for enabling optimised functions
55253  * """
55254  * def __init__(self, # <<<<<<<<<<<<<<
55255  * Tstart,
55256  * Tend,
55257  */
55258 
55259  /* function exit code */
55260  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55261  goto __pyx_L0;
55262  __pyx_L1_error:;
55263  __Pyx_XDECREF(__pyx_t_1);
55264  __Pyx_XDECREF(__pyx_t_2);
55265  __Pyx_XDECREF(__pyx_t_3);
55266  __Pyx_XDECREF(__pyx_t_4);
55267  __Pyx_XDECREF(__pyx_t_6);
55268  __Pyx_XDECREF(__pyx_t_8);
55269  __Pyx_XDECREF(__pyx_t_9);
55270  __Pyx_AddTraceback("WaveTools.RandomNLWavesFast.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
55271  __pyx_r = NULL;
55272  __pyx_L0:;
55273  __Pyx_XDECREF((PyObject *)__pyx_v_aR);
55274  __Pyx_XDECREF((PyObject *)__pyx_v_aRN);
55275  __Pyx_XDECREF(__pyx_v_Tmax);
55276  __Pyx_XDECREF(__pyx_v_modes);
55277  __Pyx_XDECREF(__pyx_v_periods);
55278  __Pyx_XDECREF(__pyx_v_ii);
55279  __Pyx_XDECREF(__pyx_v_mode);
55280  __Pyx_XDECREF(__pyx_v_fname);
55281  __Pyx_XDECREF(__pyx_v_dt);
55282  __Pyx_XDECREF(__pyx_v_series);
55283  __Pyx_XDECREF(__pyx_v_Tstart_temp);
55284  __Pyx_XDECREF(__pyx_v_cutoff);
55285  __Pyx_XDECREF(__pyx_v_Nwaves_tot);
55286  __Pyx_XDECREF(__pyx_v_Nwind);
55287  __Pyx_XDECREF(__pyx_v_Nwaves);
55288  __Pyx_XGIVEREF(__pyx_r);
55289  __Pyx_RefNannyFinishContext();
55290  return __pyx_r;
55291 }
55292 
55293 /* "WaveTools.py":3221
55294  *
55295  *
55296  * def eta(self,x,t): # <<<<<<<<<<<<<<
55297  * """Calculates free surface elevation (RandomNLWavesFast class)
55298  * Parameters
55299  */
55300 
55301 /* Python wrapper */
55302 static PyObject *__pyx_pw_9WaveTools_17RandomNLWavesFast_3eta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55303 static char __pyx_doc_9WaveTools_17RandomNLWavesFast_2eta[] = "Calculates free surface elevation (RandomNLWavesFast class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
55304 static PyMethodDef __pyx_mdef_9WaveTools_17RandomNLWavesFast_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_17RandomNLWavesFast_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_17RandomNLWavesFast_2eta};
55305 static PyObject *__pyx_pw_9WaveTools_17RandomNLWavesFast_3eta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55306  PyObject *__pyx_v_self = 0;
55307  PyObject *__pyx_v_x = 0;
55308  PyObject *__pyx_v_t = 0;
55309  PyObject *__pyx_r = 0;
55310  __Pyx_RefNannyDeclarations
55311  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
55312  {
55313  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_t,0};
55314  PyObject* values[3] = {0,0,0};
55315  if (unlikely(__pyx_kwds)) {
55316  Py_ssize_t kw_args;
55317  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
55318  switch (pos_args) {
55319  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
55320  CYTHON_FALLTHROUGH;
55321  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55322  CYTHON_FALLTHROUGH;
55323  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55324  CYTHON_FALLTHROUGH;
55325  case 0: break;
55326  default: goto __pyx_L5_argtuple_error;
55327  }
55328  kw_args = PyDict_Size(__pyx_kwds);
55329  switch (pos_args) {
55330  case 0:
55331  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
55332  else goto __pyx_L5_argtuple_error;
55333  CYTHON_FALLTHROUGH;
55334  case 1:
55335  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
55336  else {
55337  __Pyx_RaiseArgtupleInvalid("eta", 1, 3, 3, 1); __PYX_ERR(0, 3221, __pyx_L3_error)
55338  }
55339  CYTHON_FALLTHROUGH;
55340  case 2:
55341  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
55342  else {
55343  __Pyx_RaiseArgtupleInvalid("eta", 1, 3, 3, 2); __PYX_ERR(0, 3221, __pyx_L3_error)
55344  }
55345  }
55346  if (unlikely(kw_args > 0)) {
55347  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 3221, __pyx_L3_error)
55348  }
55349  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
55350  goto __pyx_L5_argtuple_error;
55351  } else {
55352  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55353  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55354  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
55355  }
55356  __pyx_v_self = values[0];
55357  __pyx_v_x = values[1];
55358  __pyx_v_t = values[2];
55359  }
55360  goto __pyx_L4_argument_unpacking_done;
55361  __pyx_L5_argtuple_error:;
55362  __Pyx_RaiseArgtupleInvalid("eta", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3221, __pyx_L3_error)
55363  __pyx_L3_error:;
55364  __Pyx_AddTraceback("WaveTools.RandomNLWavesFast.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
55365  __Pyx_RefNannyFinishContext();
55366  return NULL;
55367  __pyx_L4_argument_unpacking_done:;
55368  __pyx_r = __pyx_pf_9WaveTools_17RandomNLWavesFast_2eta(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_t);
55369 
55370  /* function exit code */
55371  __Pyx_RefNannyFinishContext();
55372  return __pyx_r;
55373 }
55374 
55375 static PyObject *__pyx_pf_9WaveTools_17RandomNLWavesFast_2eta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
55376  PyObject *__pyx_v_etaR = NULL;
55377  PyObject *__pyx_r = NULL;
55378  __Pyx_RefNannyDeclarations
55379  PyObject *__pyx_t_1 = NULL;
55380  PyObject *__pyx_t_2 = NULL;
55381  PyObject *__pyx_t_3 = NULL;
55382  int __pyx_t_4;
55383  PyObject *__pyx_t_5 = NULL;
55384  PyObject *__pyx_t_6 = NULL;
55385  __Pyx_RefNannySetupContext("eta", 0);
55386 
55387  /* "WaveTools.py":3236
55388  *
55389  * """
55390  * etaR = self.TS[0].eta(x,t)+ self.TS[1].eta(x,t)+self.TS[2].eta(x,t) # <<<<<<<<<<<<<<
55391  * return etaR
55392  *
55393  */
55394  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55395  __Pyx_GOTREF(__pyx_t_2);
55396  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3236, __pyx_L1_error)
55397  __Pyx_GOTREF(__pyx_t_3);
55398  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55399  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_eta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55400  __Pyx_GOTREF(__pyx_t_2);
55401  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55402  __pyx_t_3 = NULL;
55403  __pyx_t_4 = 0;
55404  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
55405  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
55406  if (likely(__pyx_t_3)) {
55407  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
55408  __Pyx_INCREF(__pyx_t_3);
55409  __Pyx_INCREF(function);
55410  __Pyx_DECREF_SET(__pyx_t_2, function);
55411  __pyx_t_4 = 1;
55412  }
55413  }
55414  #if CYTHON_FAST_PYCALL
55415  if (PyFunction_Check(__pyx_t_2)) {
55416  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55417  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error)
55418  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55419  __Pyx_GOTREF(__pyx_t_1);
55420  } else
55421  #endif
55422  #if CYTHON_FAST_PYCCALL
55423  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
55424  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55425  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error)
55426  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55427  __Pyx_GOTREF(__pyx_t_1);
55428  } else
55429  #endif
55430  {
55431  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3236, __pyx_L1_error)
55432  __Pyx_GOTREF(__pyx_t_5);
55433  if (__pyx_t_3) {
55434  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
55435  }
55436  __Pyx_INCREF(__pyx_v_x);
55437  __Pyx_GIVEREF(__pyx_v_x);
55438  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_x);
55439  __Pyx_INCREF(__pyx_v_t);
55440  __Pyx_GIVEREF(__pyx_v_t);
55441  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_t);
55442  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error)
55443  __Pyx_GOTREF(__pyx_t_1);
55444  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55445  }
55446  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55447  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3236, __pyx_L1_error)
55448  __Pyx_GOTREF(__pyx_t_5);
55449  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3236, __pyx_L1_error)
55450  __Pyx_GOTREF(__pyx_t_3);
55451  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55452  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_eta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3236, __pyx_L1_error)
55453  __Pyx_GOTREF(__pyx_t_5);
55454  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55455  __pyx_t_3 = NULL;
55456  __pyx_t_4 = 0;
55457  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
55458  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
55459  if (likely(__pyx_t_3)) {
55460  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
55461  __Pyx_INCREF(__pyx_t_3);
55462  __Pyx_INCREF(function);
55463  __Pyx_DECREF_SET(__pyx_t_5, function);
55464  __pyx_t_4 = 1;
55465  }
55466  }
55467  #if CYTHON_FAST_PYCALL
55468  if (PyFunction_Check(__pyx_t_5)) {
55469  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55470  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55471  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55472  __Pyx_GOTREF(__pyx_t_2);
55473  } else
55474  #endif
55475  #if CYTHON_FAST_PYCCALL
55476  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
55477  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55478  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55479  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55480  __Pyx_GOTREF(__pyx_t_2);
55481  } else
55482  #endif
55483  {
55484  __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3236, __pyx_L1_error)
55485  __Pyx_GOTREF(__pyx_t_6);
55486  if (__pyx_t_3) {
55487  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
55488  }
55489  __Pyx_INCREF(__pyx_v_x);
55490  __Pyx_GIVEREF(__pyx_v_x);
55491  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_v_x);
55492  __Pyx_INCREF(__pyx_v_t);
55493  __Pyx_GIVEREF(__pyx_v_t);
55494  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_t);
55495  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55496  __Pyx_GOTREF(__pyx_t_2);
55497  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
55498  }
55499  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55500  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3236, __pyx_L1_error)
55501  __Pyx_GOTREF(__pyx_t_5);
55502  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55503  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55504  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error)
55505  __Pyx_GOTREF(__pyx_t_1);
55506  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3236, __pyx_L1_error)
55507  __Pyx_GOTREF(__pyx_t_6);
55508  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55509  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_eta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error)
55510  __Pyx_GOTREF(__pyx_t_1);
55511  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
55512  __pyx_t_6 = NULL;
55513  __pyx_t_4 = 0;
55514  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
55515  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
55516  if (likely(__pyx_t_6)) {
55517  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
55518  __Pyx_INCREF(__pyx_t_6);
55519  __Pyx_INCREF(function);
55520  __Pyx_DECREF_SET(__pyx_t_1, function);
55521  __pyx_t_4 = 1;
55522  }
55523  }
55524  #if CYTHON_FAST_PYCALL
55525  if (PyFunction_Check(__pyx_t_1)) {
55526  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
55527  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55528  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
55529  __Pyx_GOTREF(__pyx_t_2);
55530  } else
55531  #endif
55532  #if CYTHON_FAST_PYCCALL
55533  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
55534  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
55535  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55536  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
55537  __Pyx_GOTREF(__pyx_t_2);
55538  } else
55539  #endif
55540  {
55541  __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3236, __pyx_L1_error)
55542  __Pyx_GOTREF(__pyx_t_3);
55543  if (__pyx_t_6) {
55544  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
55545  }
55546  __Pyx_INCREF(__pyx_v_x);
55547  __Pyx_GIVEREF(__pyx_v_x);
55548  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_x);
55549  __Pyx_INCREF(__pyx_v_t);
55550  __Pyx_GIVEREF(__pyx_v_t);
55551  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_t);
55552  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3236, __pyx_L1_error)
55553  __Pyx_GOTREF(__pyx_t_2);
55554  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55555  }
55556  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55557  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3236, __pyx_L1_error)
55558  __Pyx_GOTREF(__pyx_t_1);
55559  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55560  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55561  __pyx_v_etaR = __pyx_t_1;
55562  __pyx_t_1 = 0;
55563 
55564  /* "WaveTools.py":3237
55565  * """
55566  * etaR = self.TS[0].eta(x,t)+ self.TS[1].eta(x,t)+self.TS[2].eta(x,t)
55567  * return etaR # <<<<<<<<<<<<<<
55568  *
55569  *
55570  */
55571  __Pyx_XDECREF(__pyx_r);
55572  __Pyx_INCREF(__pyx_v_etaR);
55573  __pyx_r = __pyx_v_etaR;
55574  goto __pyx_L0;
55575 
55576  /* "WaveTools.py":3221
55577  *
55578  *
55579  * def eta(self,x,t): # <<<<<<<<<<<<<<
55580  * """Calculates free surface elevation (RandomNLWavesFast class)
55581  * Parameters
55582  */
55583 
55584  /* function exit code */
55585  __pyx_L1_error:;
55586  __Pyx_XDECREF(__pyx_t_1);
55587  __Pyx_XDECREF(__pyx_t_2);
55588  __Pyx_XDECREF(__pyx_t_3);
55589  __Pyx_XDECREF(__pyx_t_5);
55590  __Pyx_XDECREF(__pyx_t_6);
55591  __Pyx_AddTraceback("WaveTools.RandomNLWavesFast.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
55592  __pyx_r = NULL;
55593  __pyx_L0:;
55594  __Pyx_XDECREF(__pyx_v_etaR);
55595  __Pyx_XGIVEREF(__pyx_r);
55596  __Pyx_RefNannyFinishContext();
55597  return __pyx_r;
55598 }
55599 
55600 /* "WaveTools.py":3240
55601  *
55602  *
55603  * def u(self,x,t): # <<<<<<<<<<<<<<
55604  * """Calculates wave velocity vector (RandomNLWavesFast class)
55605  * Parameters
55606  */
55607 
55608 /* Python wrapper */
55609 static PyObject *__pyx_pw_9WaveTools_17RandomNLWavesFast_5u(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55610 static char __pyx_doc_9WaveTools_17RandomNLWavesFast_4u[] = "Calculates wave velocity vector (RandomNLWavesFast class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy.ndarray\n Velocity vector as 1D array\n\n ";
55611 static PyMethodDef __pyx_mdef_9WaveTools_17RandomNLWavesFast_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_17RandomNLWavesFast_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_17RandomNLWavesFast_4u};
55612 static PyObject *__pyx_pw_9WaveTools_17RandomNLWavesFast_5u(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55613  PyObject *__pyx_v_self = 0;
55614  PyObject *__pyx_v_x = 0;
55615  PyObject *__pyx_v_t = 0;
55616  PyObject *__pyx_r = 0;
55617  __Pyx_RefNannyDeclarations
55618  __Pyx_RefNannySetupContext("u (wrapper)", 0);
55619  {
55620  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_t,0};
55621  PyObject* values[3] = {0,0,0};
55622  if (unlikely(__pyx_kwds)) {
55623  Py_ssize_t kw_args;
55624  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
55625  switch (pos_args) {
55626  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
55627  CYTHON_FALLTHROUGH;
55628  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55629  CYTHON_FALLTHROUGH;
55630  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55631  CYTHON_FALLTHROUGH;
55632  case 0: break;
55633  default: goto __pyx_L5_argtuple_error;
55634  }
55635  kw_args = PyDict_Size(__pyx_kwds);
55636  switch (pos_args) {
55637  case 0:
55638  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
55639  else goto __pyx_L5_argtuple_error;
55640  CYTHON_FALLTHROUGH;
55641  case 1:
55642  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
55643  else {
55644  __Pyx_RaiseArgtupleInvalid("u", 1, 3, 3, 1); __PYX_ERR(0, 3240, __pyx_L3_error)
55645  }
55646  CYTHON_FALLTHROUGH;
55647  case 2:
55648  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
55649  else {
55650  __Pyx_RaiseArgtupleInvalid("u", 1, 3, 3, 2); __PYX_ERR(0, 3240, __pyx_L3_error)
55651  }
55652  }
55653  if (unlikely(kw_args > 0)) {
55654  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 3240, __pyx_L3_error)
55655  }
55656  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
55657  goto __pyx_L5_argtuple_error;
55658  } else {
55659  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55660  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55661  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
55662  }
55663  __pyx_v_self = values[0];
55664  __pyx_v_x = values[1];
55665  __pyx_v_t = values[2];
55666  }
55667  goto __pyx_L4_argument_unpacking_done;
55668  __pyx_L5_argtuple_error:;
55669  __Pyx_RaiseArgtupleInvalid("u", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3240, __pyx_L3_error)
55670  __pyx_L3_error:;
55671  __Pyx_AddTraceback("WaveTools.RandomNLWavesFast.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
55672  __Pyx_RefNannyFinishContext();
55673  return NULL;
55674  __pyx_L4_argument_unpacking_done:;
55675  __pyx_r = __pyx_pf_9WaveTools_17RandomNLWavesFast_4u(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_t);
55676 
55677  /* function exit code */
55678  __Pyx_RefNannyFinishContext();
55679  return __pyx_r;
55680 }
55681 
55682 static PyObject *__pyx_pf_9WaveTools_17RandomNLWavesFast_4u(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
55683  PyObject *__pyx_v_uR = NULL;
55684  PyObject *__pyx_r = NULL;
55685  __Pyx_RefNannyDeclarations
55686  PyObject *__pyx_t_1 = NULL;
55687  PyObject *__pyx_t_2 = NULL;
55688  PyObject *__pyx_t_3 = NULL;
55689  int __pyx_t_4;
55690  PyObject *__pyx_t_5 = NULL;
55691  PyObject *__pyx_t_6 = NULL;
55692  __Pyx_RefNannySetupContext("u", 0);
55693 
55694  /* "WaveTools.py":3255
55695  *
55696  * """
55697  * uR = self.TS[0].u(x,t)+ self.TS[1].u(x,t)+self.TS[2].u(x,t) # <<<<<<<<<<<<<<
55698  * return uR
55699  *
55700  */
55701  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55702  __Pyx_GOTREF(__pyx_t_2);
55703  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3255, __pyx_L1_error)
55704  __Pyx_GOTREF(__pyx_t_3);
55705  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55706  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_u); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55707  __Pyx_GOTREF(__pyx_t_2);
55708  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55709  __pyx_t_3 = NULL;
55710  __pyx_t_4 = 0;
55711  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
55712  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
55713  if (likely(__pyx_t_3)) {
55714  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
55715  __Pyx_INCREF(__pyx_t_3);
55716  __Pyx_INCREF(function);
55717  __Pyx_DECREF_SET(__pyx_t_2, function);
55718  __pyx_t_4 = 1;
55719  }
55720  }
55721  #if CYTHON_FAST_PYCALL
55722  if (PyFunction_Check(__pyx_t_2)) {
55723  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55724  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error)
55725  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55726  __Pyx_GOTREF(__pyx_t_1);
55727  } else
55728  #endif
55729  #if CYTHON_FAST_PYCCALL
55730  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
55731  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55732  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error)
55733  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55734  __Pyx_GOTREF(__pyx_t_1);
55735  } else
55736  #endif
55737  {
55738  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3255, __pyx_L1_error)
55739  __Pyx_GOTREF(__pyx_t_5);
55740  if (__pyx_t_3) {
55741  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
55742  }
55743  __Pyx_INCREF(__pyx_v_x);
55744  __Pyx_GIVEREF(__pyx_v_x);
55745  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_x);
55746  __Pyx_INCREF(__pyx_v_t);
55747  __Pyx_GIVEREF(__pyx_v_t);
55748  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_t);
55749  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error)
55750  __Pyx_GOTREF(__pyx_t_1);
55751  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55752  }
55753  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55754  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3255, __pyx_L1_error)
55755  __Pyx_GOTREF(__pyx_t_5);
55756  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3255, __pyx_L1_error)
55757  __Pyx_GOTREF(__pyx_t_3);
55758  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55759  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_u); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3255, __pyx_L1_error)
55760  __Pyx_GOTREF(__pyx_t_5);
55761  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55762  __pyx_t_3 = NULL;
55763  __pyx_t_4 = 0;
55764  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
55765  __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
55766  if (likely(__pyx_t_3)) {
55767  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
55768  __Pyx_INCREF(__pyx_t_3);
55769  __Pyx_INCREF(function);
55770  __Pyx_DECREF_SET(__pyx_t_5, function);
55771  __pyx_t_4 = 1;
55772  }
55773  }
55774  #if CYTHON_FAST_PYCALL
55775  if (PyFunction_Check(__pyx_t_5)) {
55776  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55777  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55778  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55779  __Pyx_GOTREF(__pyx_t_2);
55780  } else
55781  #endif
55782  #if CYTHON_FAST_PYCCALL
55783  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
55784  PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_x, __pyx_v_t};
55785  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55786  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
55787  __Pyx_GOTREF(__pyx_t_2);
55788  } else
55789  #endif
55790  {
55791  __pyx_t_6 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3255, __pyx_L1_error)
55792  __Pyx_GOTREF(__pyx_t_6);
55793  if (__pyx_t_3) {
55794  __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
55795  }
55796  __Pyx_INCREF(__pyx_v_x);
55797  __Pyx_GIVEREF(__pyx_v_x);
55798  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_4, __pyx_v_x);
55799  __Pyx_INCREF(__pyx_v_t);
55800  __Pyx_GIVEREF(__pyx_v_t);
55801  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_4, __pyx_v_t);
55802  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55803  __Pyx_GOTREF(__pyx_t_2);
55804  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
55805  }
55806  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55807  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3255, __pyx_L1_error)
55808  __Pyx_GOTREF(__pyx_t_5);
55809  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55810  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55811  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_TS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error)
55812  __Pyx_GOTREF(__pyx_t_1);
55813  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3255, __pyx_L1_error)
55814  __Pyx_GOTREF(__pyx_t_6);
55815  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55816  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error)
55817  __Pyx_GOTREF(__pyx_t_1);
55818  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
55819  __pyx_t_6 = NULL;
55820  __pyx_t_4 = 0;
55821  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
55822  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
55823  if (likely(__pyx_t_6)) {
55824  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
55825  __Pyx_INCREF(__pyx_t_6);
55826  __Pyx_INCREF(function);
55827  __Pyx_DECREF_SET(__pyx_t_1, function);
55828  __pyx_t_4 = 1;
55829  }
55830  }
55831  #if CYTHON_FAST_PYCALL
55832  if (PyFunction_Check(__pyx_t_1)) {
55833  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
55834  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55835  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
55836  __Pyx_GOTREF(__pyx_t_2);
55837  } else
55838  #endif
55839  #if CYTHON_FAST_PYCCALL
55840  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
55841  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
55842  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55843  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
55844  __Pyx_GOTREF(__pyx_t_2);
55845  } else
55846  #endif
55847  {
55848  __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3255, __pyx_L1_error)
55849  __Pyx_GOTREF(__pyx_t_3);
55850  if (__pyx_t_6) {
55851  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
55852  }
55853  __Pyx_INCREF(__pyx_v_x);
55854  __Pyx_GIVEREF(__pyx_v_x);
55855  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_4, __pyx_v_x);
55856  __Pyx_INCREF(__pyx_v_t);
55857  __Pyx_GIVEREF(__pyx_v_t);
55858  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_t);
55859  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
55860  __Pyx_GOTREF(__pyx_t_2);
55861  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55862  }
55863  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55864  __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3255, __pyx_L1_error)
55865  __Pyx_GOTREF(__pyx_t_1);
55866  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
55867  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55868  __pyx_v_uR = __pyx_t_1;
55869  __pyx_t_1 = 0;
55870 
55871  /* "WaveTools.py":3256
55872  * """
55873  * uR = self.TS[0].u(x,t)+ self.TS[1].u(x,t)+self.TS[2].u(x,t)
55874  * return uR # <<<<<<<<<<<<<<
55875  *
55876  * class CombineWaves(object):
55877  */
55878  __Pyx_XDECREF(__pyx_r);
55879  __Pyx_INCREF(__pyx_v_uR);
55880  __pyx_r = __pyx_v_uR;
55881  goto __pyx_L0;
55882 
55883  /* "WaveTools.py":3240
55884  *
55885  *
55886  * def u(self,x,t): # <<<<<<<<<<<<<<
55887  * """Calculates wave velocity vector (RandomNLWavesFast class)
55888  * Parameters
55889  */
55890 
55891  /* function exit code */
55892  __pyx_L1_error:;
55893  __Pyx_XDECREF(__pyx_t_1);
55894  __Pyx_XDECREF(__pyx_t_2);
55895  __Pyx_XDECREF(__pyx_t_3);
55896  __Pyx_XDECREF(__pyx_t_5);
55897  __Pyx_XDECREF(__pyx_t_6);
55898  __Pyx_AddTraceback("WaveTools.RandomNLWavesFast.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
55899  __pyx_r = NULL;
55900  __pyx_L0:;
55901  __Pyx_XDECREF(__pyx_v_uR);
55902  __Pyx_XGIVEREF(__pyx_r);
55903  __Pyx_RefNannyFinishContext();
55904  return __pyx_r;
55905 }
55906 
55907 /* "WaveTools.py":3267
55908  * List of wave classes
55909  * """
55910  * def __init__(self,waveList): # <<<<<<<<<<<<<<
55911  * try:
55912  * for condition in waveList:
55913  */
55914 
55915 /* Python wrapper */
55916 static PyObject *__pyx_pw_9WaveTools_12CombineWaves_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55917 static PyMethodDef __pyx_mdef_9WaveTools_12CombineWaves_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12CombineWaves_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
55918 static PyObject *__pyx_pw_9WaveTools_12CombineWaves_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55919  PyObject *__pyx_v_self = 0;
55920  PyObject *__pyx_v_waveList = 0;
55921  PyObject *__pyx_r = 0;
55922  __Pyx_RefNannyDeclarations
55923  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
55924  {
55925  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_waveList,0};
55926  PyObject* values[2] = {0,0};
55927  if (unlikely(__pyx_kwds)) {
55928  Py_ssize_t kw_args;
55929  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
55930  switch (pos_args) {
55931  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55932  CYTHON_FALLTHROUGH;
55933  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55934  CYTHON_FALLTHROUGH;
55935  case 0: break;
55936  default: goto __pyx_L5_argtuple_error;
55937  }
55938  kw_args = PyDict_Size(__pyx_kwds);
55939  switch (pos_args) {
55940  case 0:
55941  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
55942  else goto __pyx_L5_argtuple_error;
55943  CYTHON_FALLTHROUGH;
55944  case 1:
55945  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_waveList)) != 0)) kw_args--;
55946  else {
55947  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3267, __pyx_L3_error)
55948  }
55949  }
55950  if (unlikely(kw_args > 0)) {
55951  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3267, __pyx_L3_error)
55952  }
55953  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
55954  goto __pyx_L5_argtuple_error;
55955  } else {
55956  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55957  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55958  }
55959  __pyx_v_self = values[0];
55960  __pyx_v_waveList = values[1];
55961  }
55962  goto __pyx_L4_argument_unpacking_done;
55963  __pyx_L5_argtuple_error:;
55964  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3267, __pyx_L3_error)
55965  __pyx_L3_error:;
55966  __Pyx_AddTraceback("WaveTools.CombineWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
55967  __Pyx_RefNannyFinishContext();
55968  return NULL;
55969  __pyx_L4_argument_unpacking_done:;
55970  __pyx_r = __pyx_pf_9WaveTools_12CombineWaves___init__(__pyx_self, __pyx_v_self, __pyx_v_waveList);
55971 
55972  /* function exit code */
55973  __Pyx_RefNannyFinishContext();
55974  return __pyx_r;
55975 }
55976 
55977 static PyObject *__pyx_pf_9WaveTools_12CombineWaves___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_waveList) {
55978  PyObject *__pyx_v_condition = NULL;
55979  CYTHON_UNUSED PyObject *__pyx_v_etaCheck = NULL;
55980  CYTHON_UNUSED PyObject *__pyx_v_uCheck = NULL;
55981  PyObject *__pyx_r = NULL;
55982  __Pyx_RefNannyDeclarations
55983  PyObject *__pyx_t_1 = NULL;
55984  PyObject *__pyx_t_2 = NULL;
55985  PyObject *__pyx_t_3 = NULL;
55986  PyObject *__pyx_t_4 = NULL;
55987  Py_ssize_t __pyx_t_5;
55988  PyObject *(*__pyx_t_6)(PyObject *);
55989  PyObject *__pyx_t_7 = NULL;
55990  PyObject *__pyx_t_8 = NULL;
55991  PyObject *__pyx_t_9 = NULL;
55992  PyObject *__pyx_t_10 = NULL;
55993  PyObject *__pyx_t_11 = NULL;
55994  __Pyx_RefNannySetupContext("__init__", 0);
55995 
55996  /* "WaveTools.py":3268
55997  * """
55998  * def __init__(self,waveList):
55999  * try: # <<<<<<<<<<<<<<
56000  * for condition in waveList:
56001  * etaCheck = condition.eta
56002  */
56003  {
56004  __Pyx_PyThreadState_declare
56005  __Pyx_PyThreadState_assign
56006  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
56007  __Pyx_XGOTREF(__pyx_t_1);
56008  __Pyx_XGOTREF(__pyx_t_2);
56009  __Pyx_XGOTREF(__pyx_t_3);
56010  /*try:*/ {
56011 
56012  /* "WaveTools.py":3269
56013  * def __init__(self,waveList):
56014  * try:
56015  * for condition in waveList: # <<<<<<<<<<<<<<
56016  * etaCheck = condition.eta
56017  * except:
56018  */
56019  if (likely(PyList_CheckExact(__pyx_v_waveList)) || PyTuple_CheckExact(__pyx_v_waveList)) {
56020  __pyx_t_4 = __pyx_v_waveList; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
56021  __pyx_t_6 = NULL;
56022  } else {
56023  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_waveList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3269, __pyx_L3_error)
56024  __Pyx_GOTREF(__pyx_t_4);
56025  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3269, __pyx_L3_error)
56026  }
56027  for (;;) {
56028  if (likely(!__pyx_t_6)) {
56029  if (likely(PyList_CheckExact(__pyx_t_4))) {
56030  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
56031  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56032  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3269, __pyx_L3_error)
56033  #else
56034  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3269, __pyx_L3_error)
56035  __Pyx_GOTREF(__pyx_t_7);
56036  #endif
56037  } else {
56038  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
56039  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56040  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3269, __pyx_L3_error)
56041  #else
56042  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3269, __pyx_L3_error)
56043  __Pyx_GOTREF(__pyx_t_7);
56044  #endif
56045  }
56046  } else {
56047  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
56048  if (unlikely(!__pyx_t_7)) {
56049  PyObject* exc_type = PyErr_Occurred();
56050  if (exc_type) {
56051  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
56052  else __PYX_ERR(0, 3269, __pyx_L3_error)
56053  }
56054  break;
56055  }
56056  __Pyx_GOTREF(__pyx_t_7);
56057  }
56058  __Pyx_XDECREF_SET(__pyx_v_condition, __pyx_t_7);
56059  __pyx_t_7 = 0;
56060 
56061  /* "WaveTools.py":3270
56062  * try:
56063  * for condition in waveList:
56064  * etaCheck = condition.eta # <<<<<<<<<<<<<<
56065  * except:
56066  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function")
56067  */
56068  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_condition, __pyx_n_s_eta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3270, __pyx_L3_error)
56069  __Pyx_GOTREF(__pyx_t_7);
56070  __Pyx_XDECREF_SET(__pyx_v_etaCheck, __pyx_t_7);
56071  __pyx_t_7 = 0;
56072 
56073  /* "WaveTools.py":3269
56074  * def __init__(self,waveList):
56075  * try:
56076  * for condition in waveList: # <<<<<<<<<<<<<<
56077  * etaCheck = condition.eta
56078  * except:
56079  */
56080  }
56081  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
56082 
56083  /* "WaveTools.py":3268
56084  * """
56085  * def __init__(self,waveList):
56086  * try: # <<<<<<<<<<<<<<
56087  * for condition in waveList:
56088  * etaCheck = condition.eta
56089  */
56090  }
56091  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
56092  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
56093  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
56094  goto __pyx_L8_try_end;
56095  __pyx_L3_error:;
56096  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
56097  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
56098 
56099  /* "WaveTools.py":3271
56100  * for condition in waveList:
56101  * etaCheck = condition.eta
56102  * except: # <<<<<<<<<<<<<<
56103  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function")
56104  * sys.exit(1)
56105  */
56106  /*except:*/ {
56107  __Pyx_AddTraceback("WaveTools.CombineWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
56108  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 3271, __pyx_L5_except_error)
56109  __Pyx_GOTREF(__pyx_t_4);
56110  __Pyx_GOTREF(__pyx_t_7);
56111  __Pyx_GOTREF(__pyx_t_8);
56112 
56113  /* "WaveTools.py":3272
56114  * etaCheck = condition.eta
56115  * except:
56116  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function") # <<<<<<<<<<<<<<
56117  * sys.exit(1)
56118  * try:
56119  */
56120  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3272, __pyx_L5_except_error)
56121  __Pyx_GOTREF(__pyx_t_10);
56122  __pyx_t_11 = NULL;
56123  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
56124  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
56125  if (likely(__pyx_t_11)) {
56126  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
56127  __Pyx_INCREF(__pyx_t_11);
56128  __Pyx_INCREF(function);
56129  __Pyx_DECREF_SET(__pyx_t_10, function);
56130  }
56131  }
56132  __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_kp_s_ERROR_Each_input_list_entry_shou) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_kp_s_ERROR_Each_input_list_entry_shou);
56133  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
56134  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3272, __pyx_L5_except_error)
56135  __Pyx_GOTREF(__pyx_t_9);
56136  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
56137  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
56138 
56139  /* "WaveTools.py":3273
56140  * except:
56141  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function")
56142  * sys.exit(1) # <<<<<<<<<<<<<<
56143  * try:
56144  * for condition in waveList:
56145  */
56146  __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_sys); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3273, __pyx_L5_except_error)
56147  __Pyx_GOTREF(__pyx_t_10);
56148  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_exit); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3273, __pyx_L5_except_error)
56149  __Pyx_GOTREF(__pyx_t_11);
56150  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
56151  __pyx_t_10 = NULL;
56152  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
56153  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
56154  if (likely(__pyx_t_10)) {
56155  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
56156  __Pyx_INCREF(__pyx_t_10);
56157  __Pyx_INCREF(function);
56158  __Pyx_DECREF_SET(__pyx_t_11, function);
56159  }
56160  }
56161  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_int_1);
56162  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
56163  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3273, __pyx_L5_except_error)
56164  __Pyx_GOTREF(__pyx_t_9);
56165  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
56166  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
56167  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
56168  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
56169  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
56170  goto __pyx_L4_exception_handled;
56171  }
56172  __pyx_L5_except_error:;
56173 
56174  /* "WaveTools.py":3268
56175  * """
56176  * def __init__(self,waveList):
56177  * try: # <<<<<<<<<<<<<<
56178  * for condition in waveList:
56179  * etaCheck = condition.eta
56180  */
56181  __Pyx_XGIVEREF(__pyx_t_1);
56182  __Pyx_XGIVEREF(__pyx_t_2);
56183  __Pyx_XGIVEREF(__pyx_t_3);
56184  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
56185  goto __pyx_L1_error;
56186  __pyx_L4_exception_handled:;
56187  __Pyx_XGIVEREF(__pyx_t_1);
56188  __Pyx_XGIVEREF(__pyx_t_2);
56189  __Pyx_XGIVEREF(__pyx_t_3);
56190  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
56191  __pyx_L8_try_end:;
56192  }
56193 
56194  /* "WaveTools.py":3274
56195  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function")
56196  * sys.exit(1)
56197  * try: # <<<<<<<<<<<<<<
56198  * for condition in waveList:
56199  * uCheck = condition.u
56200  */
56201  {
56202  __Pyx_PyThreadState_declare
56203  __Pyx_PyThreadState_assign
56204  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
56205  __Pyx_XGOTREF(__pyx_t_3);
56206  __Pyx_XGOTREF(__pyx_t_2);
56207  __Pyx_XGOTREF(__pyx_t_1);
56208  /*try:*/ {
56209 
56210  /* "WaveTools.py":3275
56211  * sys.exit(1)
56212  * try:
56213  * for condition in waveList: # <<<<<<<<<<<<<<
56214  * uCheck = condition.u
56215  * except:
56216  */
56217  if (likely(PyList_CheckExact(__pyx_v_waveList)) || PyTuple_CheckExact(__pyx_v_waveList)) {
56218  __pyx_t_8 = __pyx_v_waveList; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0;
56219  __pyx_t_6 = NULL;
56220  } else {
56221  __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_waveList); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3275, __pyx_L13_error)
56222  __Pyx_GOTREF(__pyx_t_8);
56223  __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3275, __pyx_L13_error)
56224  }
56225  for (;;) {
56226  if (likely(!__pyx_t_6)) {
56227  if (likely(PyList_CheckExact(__pyx_t_8))) {
56228  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break;
56229  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56230  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3275, __pyx_L13_error)
56231  #else
56232  __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3275, __pyx_L13_error)
56233  __Pyx_GOTREF(__pyx_t_7);
56234  #endif
56235  } else {
56236  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
56237  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56238  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 3275, __pyx_L13_error)
56239  #else
56240  __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3275, __pyx_L13_error)
56241  __Pyx_GOTREF(__pyx_t_7);
56242  #endif
56243  }
56244  } else {
56245  __pyx_t_7 = __pyx_t_6(__pyx_t_8);
56246  if (unlikely(!__pyx_t_7)) {
56247  PyObject* exc_type = PyErr_Occurred();
56248  if (exc_type) {
56249  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
56250  else __PYX_ERR(0, 3275, __pyx_L13_error)
56251  }
56252  break;
56253  }
56254  __Pyx_GOTREF(__pyx_t_7);
56255  }
56256  __Pyx_XDECREF_SET(__pyx_v_condition, __pyx_t_7);
56257  __pyx_t_7 = 0;
56258 
56259  /* "WaveTools.py":3276
56260  * try:
56261  * for condition in waveList:
56262  * uCheck = condition.u # <<<<<<<<<<<<<<
56263  * except:
56264  * logEvent("ERROR!: Each input list entry should be a waveTools function with a u function")
56265  */
56266  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_condition, __pyx_n_s_u); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3276, __pyx_L13_error)
56267  __Pyx_GOTREF(__pyx_t_7);
56268  __Pyx_XDECREF_SET(__pyx_v_uCheck, __pyx_t_7);
56269  __pyx_t_7 = 0;
56270 
56271  /* "WaveTools.py":3275
56272  * sys.exit(1)
56273  * try:
56274  * for condition in waveList: # <<<<<<<<<<<<<<
56275  * uCheck = condition.u
56276  * except:
56277  */
56278  }
56279  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
56280 
56281  /* "WaveTools.py":3274
56282  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function")
56283  * sys.exit(1)
56284  * try: # <<<<<<<<<<<<<<
56285  * for condition in waveList:
56286  * uCheck = condition.u
56287  */
56288  }
56289  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
56290  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
56291  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
56292  goto __pyx_L18_try_end;
56293  __pyx_L13_error:;
56294  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
56295  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
56296  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
56297  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
56298  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
56299  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
56300 
56301  /* "WaveTools.py":3277
56302  * for condition in waveList:
56303  * uCheck = condition.u
56304  * except: # <<<<<<<<<<<<<<
56305  * logEvent("ERROR!: Each input list entry should be a waveTools function with a u function")
56306  * sys.exit(1)
56307  */
56308  /*except:*/ {
56309  __Pyx_AddTraceback("WaveTools.CombineWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
56310  if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_4) < 0) __PYX_ERR(0, 3277, __pyx_L15_except_error)
56311  __Pyx_GOTREF(__pyx_t_8);
56312  __Pyx_GOTREF(__pyx_t_7);
56313  __Pyx_GOTREF(__pyx_t_4);
56314 
56315  /* "WaveTools.py":3278
56316  * uCheck = condition.u
56317  * except:
56318  * logEvent("ERROR!: Each input list entry should be a waveTools function with a u function") # <<<<<<<<<<<<<<
56319  * sys.exit(1)
56320  * self.waveList = waveList
56321  */
56322  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3278, __pyx_L15_except_error)
56323  __Pyx_GOTREF(__pyx_t_11);
56324  __pyx_t_10 = NULL;
56325  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
56326  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
56327  if (likely(__pyx_t_10)) {
56328  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
56329  __Pyx_INCREF(__pyx_t_10);
56330  __Pyx_INCREF(function);
56331  __Pyx_DECREF_SET(__pyx_t_11, function);
56332  }
56333  }
56334  __pyx_t_9 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_kp_s_ERROR_Each_input_list_entry_shou_2) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_kp_s_ERROR_Each_input_list_entry_shou_2);
56335  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
56336  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3278, __pyx_L15_except_error)
56337  __Pyx_GOTREF(__pyx_t_9);
56338  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
56339  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
56340 
56341  /* "WaveTools.py":3279
56342  * except:
56343  * logEvent("ERROR!: Each input list entry should be a waveTools function with a u function")
56344  * sys.exit(1) # <<<<<<<<<<<<<<
56345  * self.waveList = waveList
56346  * self.mwl = waveList[0].mwl
56347  */
56348  __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sys); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3279, __pyx_L15_except_error)
56349  __Pyx_GOTREF(__pyx_t_11);
56350  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3279, __pyx_L15_except_error)
56351  __Pyx_GOTREF(__pyx_t_10);
56352  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
56353  __pyx_t_11 = NULL;
56354  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
56355  __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
56356  if (likely(__pyx_t_11)) {
56357  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
56358  __Pyx_INCREF(__pyx_t_11);
56359  __Pyx_INCREF(function);
56360  __Pyx_DECREF_SET(__pyx_t_10, function);
56361  }
56362  }
56363  __pyx_t_9 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_int_1);
56364  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
56365  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3279, __pyx_L15_except_error)
56366  __Pyx_GOTREF(__pyx_t_9);
56367  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
56368  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
56369  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
56370  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
56371  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
56372  goto __pyx_L14_exception_handled;
56373  }
56374  __pyx_L15_except_error:;
56375 
56376  /* "WaveTools.py":3274
56377  * logEvent("ERROR!: Each input list entry should be a waveTools function with an eta function")
56378  * sys.exit(1)
56379  * try: # <<<<<<<<<<<<<<
56380  * for condition in waveList:
56381  * uCheck = condition.u
56382  */
56383  __Pyx_XGIVEREF(__pyx_t_3);
56384  __Pyx_XGIVEREF(__pyx_t_2);
56385  __Pyx_XGIVEREF(__pyx_t_1);
56386  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
56387  goto __pyx_L1_error;
56388  __pyx_L14_exception_handled:;
56389  __Pyx_XGIVEREF(__pyx_t_3);
56390  __Pyx_XGIVEREF(__pyx_t_2);
56391  __Pyx_XGIVEREF(__pyx_t_1);
56392  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
56393  __pyx_L18_try_end:;
56394  }
56395 
56396  /* "WaveTools.py":3280
56397  * logEvent("ERROR!: Each input list entry should be a waveTools function with a u function")
56398  * sys.exit(1)
56399  * self.waveList = waveList # <<<<<<<<<<<<<<
56400  * self.mwl = waveList[0].mwl
56401  * def eta(self,x,t):
56402  */
56403  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_waveList, __pyx_v_waveList) < 0) __PYX_ERR(0, 3280, __pyx_L1_error)
56404 
56405  /* "WaveTools.py":3281
56406  * sys.exit(1)
56407  * self.waveList = waveList
56408  * self.mwl = waveList[0].mwl # <<<<<<<<<<<<<<
56409  * def eta(self,x,t):
56410  * """
56411  */
56412  __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_waveList, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3281, __pyx_L1_error)
56413  __Pyx_GOTREF(__pyx_t_4);
56414  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_mwl); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3281, __pyx_L1_error)
56415  __Pyx_GOTREF(__pyx_t_7);
56416  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
56417  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mwl, __pyx_t_7) < 0) __PYX_ERR(0, 3281, __pyx_L1_error)
56418  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
56419 
56420  /* "WaveTools.py":3267
56421  * List of wave classes
56422  * """
56423  * def __init__(self,waveList): # <<<<<<<<<<<<<<
56424  * try:
56425  * for condition in waveList:
56426  */
56427 
56428  /* function exit code */
56429  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56430  goto __pyx_L0;
56431  __pyx_L1_error:;
56432  __Pyx_XDECREF(__pyx_t_4);
56433  __Pyx_XDECREF(__pyx_t_7);
56434  __Pyx_XDECREF(__pyx_t_8);
56435  __Pyx_XDECREF(__pyx_t_9);
56436  __Pyx_XDECREF(__pyx_t_10);
56437  __Pyx_XDECREF(__pyx_t_11);
56438  __Pyx_AddTraceback("WaveTools.CombineWaves.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
56439  __pyx_r = NULL;
56440  __pyx_L0:;
56441  __Pyx_XDECREF(__pyx_v_condition);
56442  __Pyx_XDECREF(__pyx_v_etaCheck);
56443  __Pyx_XDECREF(__pyx_v_uCheck);
56444  __Pyx_XGIVEREF(__pyx_r);
56445  __Pyx_RefNannyFinishContext();
56446  return __pyx_r;
56447 }
56448 
56449 /* "WaveTools.py":3282
56450  * self.waveList = waveList
56451  * self.mwl = waveList[0].mwl
56452  * def eta(self,x,t): # <<<<<<<<<<<<<<
56453  * """
56454  * Calculates free surface elevation (combineWaves class)
56455  */
56456 
56457 /* Python wrapper */
56458 static PyObject *__pyx_pw_9WaveTools_12CombineWaves_3eta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
56459 static char __pyx_doc_9WaveTools_12CombineWaves_2eta[] = "\n Calculates free surface elevation (combineWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n float\n Free-surface elevation as a float\n\n ";
56460 static PyMethodDef __pyx_mdef_9WaveTools_12CombineWaves_3eta = {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12CombineWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_12CombineWaves_2eta};
56461 static PyObject *__pyx_pw_9WaveTools_12CombineWaves_3eta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
56462  PyObject *__pyx_v_self = 0;
56463  PyObject *__pyx_v_x = 0;
56464  PyObject *__pyx_v_t = 0;
56465  PyObject *__pyx_r = 0;
56466  __Pyx_RefNannyDeclarations
56467  __Pyx_RefNannySetupContext("eta (wrapper)", 0);
56468  {
56469  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_t,0};
56470  PyObject* values[3] = {0,0,0};
56471  if (unlikely(__pyx_kwds)) {
56472  Py_ssize_t kw_args;
56473  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
56474  switch (pos_args) {
56475  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
56476  CYTHON_FALLTHROUGH;
56477  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
56478  CYTHON_FALLTHROUGH;
56479  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
56480  CYTHON_FALLTHROUGH;
56481  case 0: break;
56482  default: goto __pyx_L5_argtuple_error;
56483  }
56484  kw_args = PyDict_Size(__pyx_kwds);
56485  switch (pos_args) {
56486  case 0:
56487  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
56488  else goto __pyx_L5_argtuple_error;
56489  CYTHON_FALLTHROUGH;
56490  case 1:
56491  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
56492  else {
56493  __Pyx_RaiseArgtupleInvalid("eta", 1, 3, 3, 1); __PYX_ERR(0, 3282, __pyx_L3_error)
56494  }
56495  CYTHON_FALLTHROUGH;
56496  case 2:
56497  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
56498  else {
56499  __Pyx_RaiseArgtupleInvalid("eta", 1, 3, 3, 2); __PYX_ERR(0, 3282, __pyx_L3_error)
56500  }
56501  }
56502  if (unlikely(kw_args > 0)) {
56503  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "eta") < 0)) __PYX_ERR(0, 3282, __pyx_L3_error)
56504  }
56505  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
56506  goto __pyx_L5_argtuple_error;
56507  } else {
56508  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
56509  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
56510  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
56511  }
56512  __pyx_v_self = values[0];
56513  __pyx_v_x = values[1];
56514  __pyx_v_t = values[2];
56515  }
56516  goto __pyx_L4_argument_unpacking_done;
56517  __pyx_L5_argtuple_error:;
56518  __Pyx_RaiseArgtupleInvalid("eta", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3282, __pyx_L3_error)
56519  __pyx_L3_error:;
56520  __Pyx_AddTraceback("WaveTools.CombineWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
56521  __Pyx_RefNannyFinishContext();
56522  return NULL;
56523  __pyx_L4_argument_unpacking_done:;
56524  __pyx_r = __pyx_pf_9WaveTools_12CombineWaves_2eta(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_t);
56525 
56526  /* function exit code */
56527  __Pyx_RefNannyFinishContext();
56528  return __pyx_r;
56529 }
56530 
56531 static PyObject *__pyx_pf_9WaveTools_12CombineWaves_2eta(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
56532  PyObject *__pyx_v_eta = NULL;
56533  PyObject *__pyx_v_cond = NULL;
56534  PyObject *__pyx_r = NULL;
56535  __Pyx_RefNannyDeclarations
56536  PyObject *__pyx_t_1 = NULL;
56537  PyObject *__pyx_t_2 = NULL;
56538  Py_ssize_t __pyx_t_3;
56539  PyObject *(*__pyx_t_4)(PyObject *);
56540  PyObject *__pyx_t_5 = NULL;
56541  PyObject *__pyx_t_6 = NULL;
56542  int __pyx_t_7;
56543  PyObject *__pyx_t_8 = NULL;
56544  __Pyx_RefNannySetupContext("eta", 0);
56545 
56546  /* "WaveTools.py":3298
56547  *
56548  * """
56549  * eta = 0. # <<<<<<<<<<<<<<
56550  * for cond in self.waveList:
56551  * eta += cond.eta(x,t)
56552  */
56553  __Pyx_INCREF(__pyx_float_0_);
56554  __pyx_v_eta = __pyx_float_0_;
56555 
56556  /* "WaveTools.py":3299
56557  * """
56558  * eta = 0.
56559  * for cond in self.waveList: # <<<<<<<<<<<<<<
56560  * eta += cond.eta(x,t)
56561  * return eta
56562  */
56563  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_waveList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
56564  __Pyx_GOTREF(__pyx_t_1);
56565  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
56566  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
56567  __pyx_t_4 = NULL;
56568  } else {
56569  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3299, __pyx_L1_error)
56570  __Pyx_GOTREF(__pyx_t_2);
56571  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3299, __pyx_L1_error)
56572  }
56573  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56574  for (;;) {
56575  if (likely(!__pyx_t_4)) {
56576  if (likely(PyList_CheckExact(__pyx_t_2))) {
56577  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
56578  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56579  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3299, __pyx_L1_error)
56580  #else
56581  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
56582  __Pyx_GOTREF(__pyx_t_1);
56583  #endif
56584  } else {
56585  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
56586  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56587  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 3299, __pyx_L1_error)
56588  #else
56589  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3299, __pyx_L1_error)
56590  __Pyx_GOTREF(__pyx_t_1);
56591  #endif
56592  }
56593  } else {
56594  __pyx_t_1 = __pyx_t_4(__pyx_t_2);
56595  if (unlikely(!__pyx_t_1)) {
56596  PyObject* exc_type = PyErr_Occurred();
56597  if (exc_type) {
56598  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
56599  else __PYX_ERR(0, 3299, __pyx_L1_error)
56600  }
56601  break;
56602  }
56603  __Pyx_GOTREF(__pyx_t_1);
56604  }
56605  __Pyx_XDECREF_SET(__pyx_v_cond, __pyx_t_1);
56606  __pyx_t_1 = 0;
56607 
56608  /* "WaveTools.py":3300
56609  * eta = 0.
56610  * for cond in self.waveList:
56611  * eta += cond.eta(x,t) # <<<<<<<<<<<<<<
56612  * return eta
56613  *
56614  */
56615  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cond, __pyx_n_s_eta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3300, __pyx_L1_error)
56616  __Pyx_GOTREF(__pyx_t_5);
56617  __pyx_t_6 = NULL;
56618  __pyx_t_7 = 0;
56619  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
56620  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
56621  if (likely(__pyx_t_6)) {
56622  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
56623  __Pyx_INCREF(__pyx_t_6);
56624  __Pyx_INCREF(function);
56625  __Pyx_DECREF_SET(__pyx_t_5, function);
56626  __pyx_t_7 = 1;
56627  }
56628  }
56629  #if CYTHON_FAST_PYCALL
56630  if (PyFunction_Check(__pyx_t_5)) {
56631  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
56632  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3300, __pyx_L1_error)
56633  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
56634  __Pyx_GOTREF(__pyx_t_1);
56635  } else
56636  #endif
56637  #if CYTHON_FAST_PYCCALL
56638  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
56639  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
56640  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3300, __pyx_L1_error)
56641  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
56642  __Pyx_GOTREF(__pyx_t_1);
56643  } else
56644  #endif
56645  {
56646  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3300, __pyx_L1_error)
56647  __Pyx_GOTREF(__pyx_t_8);
56648  if (__pyx_t_6) {
56649  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
56650  }
56651  __Pyx_INCREF(__pyx_v_x);
56652  __Pyx_GIVEREF(__pyx_v_x);
56653  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_x);
56654  __Pyx_INCREF(__pyx_v_t);
56655  __Pyx_GIVEREF(__pyx_v_t);
56656  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_t);
56657  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3300, __pyx_L1_error)
56658  __Pyx_GOTREF(__pyx_t_1);
56659  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
56660  }
56661  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
56662  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_eta, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3300, __pyx_L1_error)
56663  __Pyx_GOTREF(__pyx_t_5);
56664  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56665  __Pyx_DECREF_SET(__pyx_v_eta, __pyx_t_5);
56666  __pyx_t_5 = 0;
56667 
56668  /* "WaveTools.py":3299
56669  * """
56670  * eta = 0.
56671  * for cond in self.waveList: # <<<<<<<<<<<<<<
56672  * eta += cond.eta(x,t)
56673  * return eta
56674  */
56675  }
56676  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56677 
56678  /* "WaveTools.py":3301
56679  * for cond in self.waveList:
56680  * eta += cond.eta(x,t)
56681  * return eta # <<<<<<<<<<<<<<
56682  *
56683  * def u(self,x,t):
56684  */
56685  __Pyx_XDECREF(__pyx_r);
56686  __Pyx_INCREF(__pyx_v_eta);
56687  __pyx_r = __pyx_v_eta;
56688  goto __pyx_L0;
56689 
56690  /* "WaveTools.py":3282
56691  * self.waveList = waveList
56692  * self.mwl = waveList[0].mwl
56693  * def eta(self,x,t): # <<<<<<<<<<<<<<
56694  * """
56695  * Calculates free surface elevation (combineWaves class)
56696  */
56697 
56698  /* function exit code */
56699  __pyx_L1_error:;
56700  __Pyx_XDECREF(__pyx_t_1);
56701  __Pyx_XDECREF(__pyx_t_2);
56702  __Pyx_XDECREF(__pyx_t_5);
56703  __Pyx_XDECREF(__pyx_t_6);
56704  __Pyx_XDECREF(__pyx_t_8);
56705  __Pyx_AddTraceback("WaveTools.CombineWaves.eta", __pyx_clineno, __pyx_lineno, __pyx_filename);
56706  __pyx_r = NULL;
56707  __pyx_L0:;
56708  __Pyx_XDECREF(__pyx_v_eta);
56709  __Pyx_XDECREF(__pyx_v_cond);
56710  __Pyx_XGIVEREF(__pyx_r);
56711  __Pyx_RefNannyFinishContext();
56712  return __pyx_r;
56713 }
56714 
56715 /* "WaveTools.py":3303
56716  * return eta
56717  *
56718  * def u(self,x,t): # <<<<<<<<<<<<<<
56719  * """
56720  * Calculates wave particle velocity (combineWaves class)
56721  */
56722 
56723 /* Python wrapper */
56724 static PyObject *__pyx_pw_9WaveTools_12CombineWaves_5u(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
56725 static char __pyx_doc_9WaveTools_12CombineWaves_4u[] = "\n Calculates wave particle velocity (combineWaves class)\n Parameters\n ----------\n x : numpy.ndarray\n Position vector\n t : float\n Time variable\n\n Returns\n --------\n numpy array\n Velocity as 1D numpy array\n\n ";
56726 static PyMethodDef __pyx_mdef_9WaveTools_12CombineWaves_5u = {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12CombineWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_12CombineWaves_4u};
56727 static PyObject *__pyx_pw_9WaveTools_12CombineWaves_5u(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
56728  PyObject *__pyx_v_self = 0;
56729  PyObject *__pyx_v_x = 0;
56730  PyObject *__pyx_v_t = 0;
56731  PyObject *__pyx_r = 0;
56732  __Pyx_RefNannyDeclarations
56733  __Pyx_RefNannySetupContext("u (wrapper)", 0);
56734  {
56735  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_t,0};
56736  PyObject* values[3] = {0,0,0};
56737  if (unlikely(__pyx_kwds)) {
56738  Py_ssize_t kw_args;
56739  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
56740  switch (pos_args) {
56741  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
56742  CYTHON_FALLTHROUGH;
56743  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
56744  CYTHON_FALLTHROUGH;
56745  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
56746  CYTHON_FALLTHROUGH;
56747  case 0: break;
56748  default: goto __pyx_L5_argtuple_error;
56749  }
56750  kw_args = PyDict_Size(__pyx_kwds);
56751  switch (pos_args) {
56752  case 0:
56753  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
56754  else goto __pyx_L5_argtuple_error;
56755  CYTHON_FALLTHROUGH;
56756  case 1:
56757  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
56758  else {
56759  __Pyx_RaiseArgtupleInvalid("u", 1, 3, 3, 1); __PYX_ERR(0, 3303, __pyx_L3_error)
56760  }
56761  CYTHON_FALLTHROUGH;
56762  case 2:
56763  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
56764  else {
56765  __Pyx_RaiseArgtupleInvalid("u", 1, 3, 3, 2); __PYX_ERR(0, 3303, __pyx_L3_error)
56766  }
56767  }
56768  if (unlikely(kw_args > 0)) {
56769  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "u") < 0)) __PYX_ERR(0, 3303, __pyx_L3_error)
56770  }
56771  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
56772  goto __pyx_L5_argtuple_error;
56773  } else {
56774  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
56775  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
56776  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
56777  }
56778  __pyx_v_self = values[0];
56779  __pyx_v_x = values[1];
56780  __pyx_v_t = values[2];
56781  }
56782  goto __pyx_L4_argument_unpacking_done;
56783  __pyx_L5_argtuple_error:;
56784  __Pyx_RaiseArgtupleInvalid("u", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3303, __pyx_L3_error)
56785  __pyx_L3_error:;
56786  __Pyx_AddTraceback("WaveTools.CombineWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
56787  __Pyx_RefNannyFinishContext();
56788  return NULL;
56789  __pyx_L4_argument_unpacking_done:;
56790  __pyx_r = __pyx_pf_9WaveTools_12CombineWaves_4u(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_t);
56791 
56792  /* function exit code */
56793  __Pyx_RefNannyFinishContext();
56794  return __pyx_r;
56795 }
56796 
56797 static PyObject *__pyx_pf_9WaveTools_12CombineWaves_4u(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_t) {
56798  PyObject *__pyx_v_u = NULL;
56799  PyObject *__pyx_v_cond = NULL;
56800  PyObject *__pyx_r = NULL;
56801  __Pyx_RefNannyDeclarations
56802  PyObject *__pyx_t_1 = NULL;
56803  PyObject *__pyx_t_2 = NULL;
56804  PyObject *__pyx_t_3 = NULL;
56805  Py_ssize_t __pyx_t_4;
56806  PyObject *(*__pyx_t_5)(PyObject *);
56807  PyObject *__pyx_t_6 = NULL;
56808  int __pyx_t_7;
56809  PyObject *__pyx_t_8 = NULL;
56810  __Pyx_RefNannySetupContext("u", 0);
56811 
56812  /* "WaveTools.py":3319
56813  *
56814  * """
56815  * u = np.zeros(3,) # <<<<<<<<<<<<<<
56816  * for cond in self.waveList:
56817  * u += cond.u(x,t)
56818  */
56819  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3319, __pyx_L1_error)
56820  __Pyx_GOTREF(__pyx_t_2);
56821  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3319, __pyx_L1_error)
56822  __Pyx_GOTREF(__pyx_t_3);
56823  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56824  __pyx_t_2 = NULL;
56825  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
56826  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
56827  if (likely(__pyx_t_2)) {
56828  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
56829  __Pyx_INCREF(__pyx_t_2);
56830  __Pyx_INCREF(function);
56831  __Pyx_DECREF_SET(__pyx_t_3, function);
56832  }
56833  }
56834  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_int_3) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_int_3);
56835  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
56836  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3319, __pyx_L1_error)
56837  __Pyx_GOTREF(__pyx_t_1);
56838  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56839  __pyx_v_u = __pyx_t_1;
56840  __pyx_t_1 = 0;
56841 
56842  /* "WaveTools.py":3320
56843  * """
56844  * u = np.zeros(3,)
56845  * for cond in self.waveList: # <<<<<<<<<<<<<<
56846  * u += cond.u(x,t)
56847  * return u
56848  */
56849  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_waveList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3320, __pyx_L1_error)
56850  __Pyx_GOTREF(__pyx_t_1);
56851  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
56852  __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
56853  __pyx_t_5 = NULL;
56854  } else {
56855  __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3320, __pyx_L1_error)
56856  __Pyx_GOTREF(__pyx_t_3);
56857  __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3320, __pyx_L1_error)
56858  }
56859  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56860  for (;;) {
56861  if (likely(!__pyx_t_5)) {
56862  if (likely(PyList_CheckExact(__pyx_t_3))) {
56863  if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
56864  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56865  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3320, __pyx_L1_error)
56866  #else
56867  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3320, __pyx_L1_error)
56868  __Pyx_GOTREF(__pyx_t_1);
56869  #endif
56870  } else {
56871  if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
56872  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
56873  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 3320, __pyx_L1_error)
56874  #else
56875  __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3320, __pyx_L1_error)
56876  __Pyx_GOTREF(__pyx_t_1);
56877  #endif
56878  }
56879  } else {
56880  __pyx_t_1 = __pyx_t_5(__pyx_t_3);
56881  if (unlikely(!__pyx_t_1)) {
56882  PyObject* exc_type = PyErr_Occurred();
56883  if (exc_type) {
56884  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
56885  else __PYX_ERR(0, 3320, __pyx_L1_error)
56886  }
56887  break;
56888  }
56889  __Pyx_GOTREF(__pyx_t_1);
56890  }
56891  __Pyx_XDECREF_SET(__pyx_v_cond, __pyx_t_1);
56892  __pyx_t_1 = 0;
56893 
56894  /* "WaveTools.py":3321
56895  * u = np.zeros(3,)
56896  * for cond in self.waveList:
56897  * u += cond.u(x,t) # <<<<<<<<<<<<<<
56898  * return u
56899  *
56900  */
56901  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cond, __pyx_n_s_u); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3321, __pyx_L1_error)
56902  __Pyx_GOTREF(__pyx_t_2);
56903  __pyx_t_6 = NULL;
56904  __pyx_t_7 = 0;
56905  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
56906  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
56907  if (likely(__pyx_t_6)) {
56908  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
56909  __Pyx_INCREF(__pyx_t_6);
56910  __Pyx_INCREF(function);
56911  __Pyx_DECREF_SET(__pyx_t_2, function);
56912  __pyx_t_7 = 1;
56913  }
56914  }
56915  #if CYTHON_FAST_PYCALL
56916  if (PyFunction_Check(__pyx_t_2)) {
56917  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
56918  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3321, __pyx_L1_error)
56919  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
56920  __Pyx_GOTREF(__pyx_t_1);
56921  } else
56922  #endif
56923  #if CYTHON_FAST_PYCCALL
56924  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
56925  PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_x, __pyx_v_t};
56926  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3321, __pyx_L1_error)
56927  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
56928  __Pyx_GOTREF(__pyx_t_1);
56929  } else
56930  #endif
56931  {
56932  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3321, __pyx_L1_error)
56933  __Pyx_GOTREF(__pyx_t_8);
56934  if (__pyx_t_6) {
56935  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
56936  }
56937  __Pyx_INCREF(__pyx_v_x);
56938  __Pyx_GIVEREF(__pyx_v_x);
56939  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_x);
56940  __Pyx_INCREF(__pyx_v_t);
56941  __Pyx_GIVEREF(__pyx_v_t);
56942  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_t);
56943  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3321, __pyx_L1_error)
56944  __Pyx_GOTREF(__pyx_t_1);
56945  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
56946  }
56947  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56948  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_u, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3321, __pyx_L1_error)
56949  __Pyx_GOTREF(__pyx_t_2);
56950  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56951  __Pyx_DECREF_SET(__pyx_v_u, __pyx_t_2);
56952  __pyx_t_2 = 0;
56953 
56954  /* "WaveTools.py":3320
56955  * """
56956  * u = np.zeros(3,)
56957  * for cond in self.waveList: # <<<<<<<<<<<<<<
56958  * u += cond.u(x,t)
56959  * return u
56960  */
56961  }
56962  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56963 
56964  /* "WaveTools.py":3322
56965  * for cond in self.waveList:
56966  * u += cond.u(x,t)
56967  * return u # <<<<<<<<<<<<<<
56968  *
56969  */
56970  __Pyx_XDECREF(__pyx_r);
56971  __Pyx_INCREF(__pyx_v_u);
56972  __pyx_r = __pyx_v_u;
56973  goto __pyx_L0;
56974 
56975  /* "WaveTools.py":3303
56976  * return eta
56977  *
56978  * def u(self,x,t): # <<<<<<<<<<<<<<
56979  * """
56980  * Calculates wave particle velocity (combineWaves class)
56981  */
56982 
56983  /* function exit code */
56984  __pyx_L1_error:;
56985  __Pyx_XDECREF(__pyx_t_1);
56986  __Pyx_XDECREF(__pyx_t_2);
56987  __Pyx_XDECREF(__pyx_t_3);
56988  __Pyx_XDECREF(__pyx_t_6);
56989  __Pyx_XDECREF(__pyx_t_8);
56990  __Pyx_AddTraceback("WaveTools.CombineWaves.u", __pyx_clineno, __pyx_lineno, __pyx_filename);
56991  __pyx_r = NULL;
56992  __pyx_L0:;
56993  __Pyx_XDECREF(__pyx_v_u);
56994  __Pyx_XDECREF(__pyx_v_cond);
56995  __Pyx_XGIVEREF(__pyx_r);
56996  __Pyx_RefNannyFinishContext();
56997  return __pyx_r;
56998 }
56999 
57000 /* "(tree fragment)":1
57001  * def __pyx_unpickle_SteadyCurrent(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
57002  * cdef object __pyx_PickleError
57003  * cdef object __pyx_result
57004  */
57005 
57006 /* Python wrapper */
57007 static PyObject *__pyx_pw_9WaveTools_51__pyx_unpickle_SteadyCurrent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
57008 static PyMethodDef __pyx_mdef_9WaveTools_51__pyx_unpickle_SteadyCurrent = {"__pyx_unpickle_SteadyCurrent", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_51__pyx_unpickle_SteadyCurrent, METH_VARARGS|METH_KEYWORDS, 0};
57009 static PyObject *__pyx_pw_9WaveTools_51__pyx_unpickle_SteadyCurrent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
57010  PyObject *__pyx_v___pyx_type = 0;
57011  long __pyx_v___pyx_checksum;
57012  PyObject *__pyx_v___pyx_state = 0;
57013  PyObject *__pyx_r = 0;
57014  __Pyx_RefNannyDeclarations
57015  __Pyx_RefNannySetupContext("__pyx_unpickle_SteadyCurrent (wrapper)", 0);
57016  {
57017  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
57018  PyObject* values[3] = {0,0,0};
57019  if (unlikely(__pyx_kwds)) {
57020  Py_ssize_t kw_args;
57021  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
57022  switch (pos_args) {
57023  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
57024  CYTHON_FALLTHROUGH;
57025  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
57026  CYTHON_FALLTHROUGH;
57027  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
57028  CYTHON_FALLTHROUGH;
57029  case 0: break;
57030  default: goto __pyx_L5_argtuple_error;
57031  }
57032  kw_args = PyDict_Size(__pyx_kwds);
57033  switch (pos_args) {
57034  case 0:
57035  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
57036  else goto __pyx_L5_argtuple_error;
57037  CYTHON_FALLTHROUGH;
57038  case 1:
57039  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
57040  else {
57041  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SteadyCurrent", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
57042  }
57043  CYTHON_FALLTHROUGH;
57044  case 2:
57045  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
57046  else {
57047  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SteadyCurrent", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
57048  }
57049  }
57050  if (unlikely(kw_args > 0)) {
57051  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SteadyCurrent") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
57052  }
57053  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
57054  goto __pyx_L5_argtuple_error;
57055  } else {
57056  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
57057  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
57058  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
57059  }
57060  __pyx_v___pyx_type = values[0];
57061  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
57062  __pyx_v___pyx_state = values[2];
57063  }
57064  goto __pyx_L4_argument_unpacking_done;
57065  __pyx_L5_argtuple_error:;
57066  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SteadyCurrent", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
57067  __pyx_L3_error:;
57068  __Pyx_AddTraceback("WaveTools.__pyx_unpickle_SteadyCurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
57069  __Pyx_RefNannyFinishContext();
57070  return NULL;
57071  __pyx_L4_argument_unpacking_done:;
57072  __pyx_r = __pyx_pf_9WaveTools_50__pyx_unpickle_SteadyCurrent(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
57073 
57074  /* function exit code */
57075  __Pyx_RefNannyFinishContext();
57076  return __pyx_r;
57077 }
57078 
57079 static PyObject *__pyx_pf_9WaveTools_50__pyx_unpickle_SteadyCurrent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
57080  PyObject *__pyx_v___pyx_PickleError = 0;
57081  PyObject *__pyx_v___pyx_result = 0;
57082  PyObject *__pyx_r = NULL;
57083  __Pyx_RefNannyDeclarations
57084  int __pyx_t_1;
57085  PyObject *__pyx_t_2 = NULL;
57086  PyObject *__pyx_t_3 = NULL;
57087  PyObject *__pyx_t_4 = NULL;
57088  PyObject *__pyx_t_5 = NULL;
57089  int __pyx_t_6;
57090  __Pyx_RefNannySetupContext("__pyx_unpickle_SteadyCurrent", 0);
57091 
57092  /* "(tree fragment)":4
57093  * cdef object __pyx_PickleError
57094  * cdef object __pyx_result
57095  * if __pyx_checksum != 0xe2264c7: # <<<<<<<<<<<<<<
57096  * from pickle import PickleError as __pyx_PickleError
57097  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum)
57098  */
57099  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xe2264c7) != 0);
57100  if (__pyx_t_1) {
57101 
57102  /* "(tree fragment)":5
57103  * cdef object __pyx_result
57104  * if __pyx_checksum != 0xe2264c7:
57105  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
57106  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum)
57107  * __pyx_result = SteadyCurrent.__new__(__pyx_type)
57108  */
57109  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
57110  __Pyx_GOTREF(__pyx_t_2);
57111  __Pyx_INCREF(__pyx_n_s_PickleError);
57112  __Pyx_GIVEREF(__pyx_n_s_PickleError);
57113  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
57114  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
57115  __Pyx_GOTREF(__pyx_t_3);
57116  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57117  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
57118  __Pyx_GOTREF(__pyx_t_2);
57119  __Pyx_INCREF(__pyx_t_2);
57120  __pyx_v___pyx_PickleError = __pyx_t_2;
57121  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57122  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57123 
57124  /* "(tree fragment)":6
57125  * if __pyx_checksum != 0xe2264c7:
57126  * from pickle import PickleError as __pyx_PickleError
57127  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum) # <<<<<<<<<<<<<<
57128  * __pyx_result = SteadyCurrent.__new__(__pyx_type)
57129  * if __pyx_state is not None:
57130  */
57131  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
57132  __Pyx_GOTREF(__pyx_t_2);
57133  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xe2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
57134  __Pyx_GOTREF(__pyx_t_4);
57135  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57136  __Pyx_INCREF(__pyx_v___pyx_PickleError);
57137  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
57138  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
57139  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
57140  if (likely(__pyx_t_5)) {
57141  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
57142  __Pyx_INCREF(__pyx_t_5);
57143  __Pyx_INCREF(function);
57144  __Pyx_DECREF_SET(__pyx_t_2, function);
57145  }
57146  }
57147  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
57148  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
57149  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57150  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
57151  __Pyx_GOTREF(__pyx_t_3);
57152  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57153  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
57154  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57155  __PYX_ERR(1, 6, __pyx_L1_error)
57156 
57157  /* "(tree fragment)":4
57158  * cdef object __pyx_PickleError
57159  * cdef object __pyx_result
57160  * if __pyx_checksum != 0xe2264c7: # <<<<<<<<<<<<<<
57161  * from pickle import PickleError as __pyx_PickleError
57162  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum)
57163  */
57164  }
57165 
57166  /* "(tree fragment)":7
57167  * from pickle import PickleError as __pyx_PickleError
57168  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum)
57169  * __pyx_result = SteadyCurrent.__new__(__pyx_type) # <<<<<<<<<<<<<<
57170  * if __pyx_state is not None:
57171  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
57172  */
57173  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9WaveTools_SteadyCurrent), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
57174  __Pyx_GOTREF(__pyx_t_2);
57175  __pyx_t_4 = NULL;
57176  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
57177  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
57178  if (likely(__pyx_t_4)) {
57179  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
57180  __Pyx_INCREF(__pyx_t_4);
57181  __Pyx_INCREF(function);
57182  __Pyx_DECREF_SET(__pyx_t_2, function);
57183  }
57184  }
57185  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
57186  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
57187  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
57188  __Pyx_GOTREF(__pyx_t_3);
57189  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57190  __pyx_v___pyx_result = __pyx_t_3;
57191  __pyx_t_3 = 0;
57192 
57193  /* "(tree fragment)":8
57194  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum)
57195  * __pyx_result = SteadyCurrent.__new__(__pyx_type)
57196  * if __pyx_state is not None: # <<<<<<<<<<<<<<
57197  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
57198  * return __pyx_result
57199  */
57200  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
57201  __pyx_t_6 = (__pyx_t_1 != 0);
57202  if (__pyx_t_6) {
57203 
57204  /* "(tree fragment)":9
57205  * __pyx_result = SteadyCurrent.__new__(__pyx_type)
57206  * if __pyx_state is not None:
57207  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
57208  * return __pyx_result
57209  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state):
57210  */
57211  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
57212  __pyx_t_3 = __pyx_f_9WaveTools___pyx_unpickle_SteadyCurrent__set_state(((struct __pyx_obj_9WaveTools_SteadyCurrent *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
57213  __Pyx_GOTREF(__pyx_t_3);
57214  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57215 
57216  /* "(tree fragment)":8
57217  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xe2264c7 = (U, mwl, ramp))" % __pyx_checksum)
57218  * __pyx_result = SteadyCurrent.__new__(__pyx_type)
57219  * if __pyx_state is not None: # <<<<<<<<<<<<<<
57220  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
57221  * return __pyx_result
57222  */
57223  }
57224 
57225  /* "(tree fragment)":10
57226  * if __pyx_state is not None:
57227  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
57228  * return __pyx_result # <<<<<<<<<<<<<<
57229  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state):
57230  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
57231  */
57232  __Pyx_XDECREF(__pyx_r);
57233  __Pyx_INCREF(__pyx_v___pyx_result);
57234  __pyx_r = __pyx_v___pyx_result;
57235  goto __pyx_L0;
57236 
57237  /* "(tree fragment)":1
57238  * def __pyx_unpickle_SteadyCurrent(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
57239  * cdef object __pyx_PickleError
57240  * cdef object __pyx_result
57241  */
57242 
57243  /* function exit code */
57244  __pyx_L1_error:;
57245  __Pyx_XDECREF(__pyx_t_2);
57246  __Pyx_XDECREF(__pyx_t_3);
57247  __Pyx_XDECREF(__pyx_t_4);
57248  __Pyx_XDECREF(__pyx_t_5);
57249  __Pyx_AddTraceback("WaveTools.__pyx_unpickle_SteadyCurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
57250  __pyx_r = NULL;
57251  __pyx_L0:;
57252  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
57253  __Pyx_XDECREF(__pyx_v___pyx_result);
57254  __Pyx_XGIVEREF(__pyx_r);
57255  __Pyx_RefNannyFinishContext();
57256  return __pyx_r;
57257 }
57258 
57259 /* "(tree fragment)":11
57260  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
57261  * return __pyx_result
57262  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
57263  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
57264  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
57265  */
57266 
57267 static PyObject *__pyx_f_9WaveTools___pyx_unpickle_SteadyCurrent__set_state(struct __pyx_obj_9WaveTools_SteadyCurrent *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
57268  PyObject *__pyx_r = NULL;
57269  __Pyx_RefNannyDeclarations
57270  PyObject *__pyx_t_1 = NULL;
57271  double __pyx_t_2;
57272  int __pyx_t_3;
57273  Py_ssize_t __pyx_t_4;
57274  int __pyx_t_5;
57275  int __pyx_t_6;
57276  PyObject *__pyx_t_7 = NULL;
57277  PyObject *__pyx_t_8 = NULL;
57278  PyObject *__pyx_t_9 = NULL;
57279  __Pyx_RefNannySetupContext("__pyx_unpickle_SteadyCurrent__set_state", 0);
57280 
57281  /* "(tree fragment)":12
57282  * return __pyx_result
57283  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state):
57284  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2] # <<<<<<<<<<<<<<
57285  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
57286  * __pyx_result.__dict__.update(__pyx_state[3])
57287  */
57288  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57289  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57290  __PYX_ERR(1, 12, __pyx_L1_error)
57291  }
57292  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57293  __Pyx_GOTREF(__pyx_t_1);
57294  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
57295  __Pyx_GIVEREF(__pyx_t_1);
57296  __Pyx_GOTREF(__pyx_v___pyx_result->U);
57297  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->U));
57298  __pyx_v___pyx_result->U = ((PyArrayObject *)__pyx_t_1);
57299  __pyx_t_1 = 0;
57300  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57301  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57302  __PYX_ERR(1, 12, __pyx_L1_error)
57303  }
57304  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57305  __Pyx_GOTREF(__pyx_t_1);
57306  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57307  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57308  __pyx_v___pyx_result->mwl = __pyx_t_2;
57309  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57310  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57311  __PYX_ERR(1, 12, __pyx_L1_error)
57312  }
57313  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57314  __Pyx_GOTREF(__pyx_t_1);
57315  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57316  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57317  __pyx_v___pyx_result->ramp = __pyx_t_2;
57318 
57319  /* "(tree fragment)":13
57320  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state):
57321  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
57322  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
57323  * __pyx_result.__dict__.update(__pyx_state[3])
57324  */
57325  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57326  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
57327  __PYX_ERR(1, 13, __pyx_L1_error)
57328  }
57329  __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
57330  __pyx_t_5 = ((__pyx_t_4 > 3) != 0);
57331  if (__pyx_t_5) {
57332  } else {
57333  __pyx_t_3 = __pyx_t_5;
57334  goto __pyx_L4_bool_binop_done;
57335  }
57336  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
57337  __pyx_t_6 = (__pyx_t_5 != 0);
57338  __pyx_t_3 = __pyx_t_6;
57339  __pyx_L4_bool_binop_done:;
57340  if (__pyx_t_3) {
57341 
57342  /* "(tree fragment)":14
57343  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
57344  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
57345  * __pyx_result.__dict__.update(__pyx_state[3]) # <<<<<<<<<<<<<<
57346  */
57347  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
57348  __Pyx_GOTREF(__pyx_t_7);
57349  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
57350  __Pyx_GOTREF(__pyx_t_8);
57351  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
57352  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57353  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57354  __PYX_ERR(1, 14, __pyx_L1_error)
57355  }
57356  __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
57357  __Pyx_GOTREF(__pyx_t_7);
57358  __pyx_t_9 = NULL;
57359  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
57360  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
57361  if (likely(__pyx_t_9)) {
57362  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
57363  __Pyx_INCREF(__pyx_t_9);
57364  __Pyx_INCREF(function);
57365  __Pyx_DECREF_SET(__pyx_t_8, function);
57366  }
57367  }
57368  __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
57369  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
57370  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
57371  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
57372  __Pyx_GOTREF(__pyx_t_1);
57373  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
57374  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57375 
57376  /* "(tree fragment)":13
57377  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state):
57378  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
57379  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
57380  * __pyx_result.__dict__.update(__pyx_state[3])
57381  */
57382  }
57383 
57384  /* "(tree fragment)":11
57385  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
57386  * return __pyx_result
57387  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
57388  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
57389  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
57390  */
57391 
57392  /* function exit code */
57393  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57394  goto __pyx_L0;
57395  __pyx_L1_error:;
57396  __Pyx_XDECREF(__pyx_t_1);
57397  __Pyx_XDECREF(__pyx_t_7);
57398  __Pyx_XDECREF(__pyx_t_8);
57399  __Pyx_XDECREF(__pyx_t_9);
57400  __Pyx_AddTraceback("WaveTools.__pyx_unpickle_SteadyCurrent__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
57401  __pyx_r = 0;
57402  __pyx_L0:;
57403  __Pyx_XGIVEREF(__pyx_r);
57404  __Pyx_RefNannyFinishContext();
57405  return __pyx_r;
57406 }
57407 
57408 /* "(tree fragment)":1
57409  * def __pyx_unpickle_SolitaryWave(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
57410  * cdef object __pyx_PickleError
57411  * cdef object __pyx_result
57412  */
57413 
57414 /* Python wrapper */
57415 static PyObject *__pyx_pw_9WaveTools_53__pyx_unpickle_SolitaryWave(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
57416 static PyMethodDef __pyx_mdef_9WaveTools_53__pyx_unpickle_SolitaryWave = {"__pyx_unpickle_SolitaryWave", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_53__pyx_unpickle_SolitaryWave, METH_VARARGS|METH_KEYWORDS, 0};
57417 static PyObject *__pyx_pw_9WaveTools_53__pyx_unpickle_SolitaryWave(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
57418  PyObject *__pyx_v___pyx_type = 0;
57419  long __pyx_v___pyx_checksum;
57420  PyObject *__pyx_v___pyx_state = 0;
57421  PyObject *__pyx_r = 0;
57422  __Pyx_RefNannyDeclarations
57423  __Pyx_RefNannySetupContext("__pyx_unpickle_SolitaryWave (wrapper)", 0);
57424  {
57425  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
57426  PyObject* values[3] = {0,0,0};
57427  if (unlikely(__pyx_kwds)) {
57428  Py_ssize_t kw_args;
57429  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
57430  switch (pos_args) {
57431  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
57432  CYTHON_FALLTHROUGH;
57433  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
57434  CYTHON_FALLTHROUGH;
57435  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
57436  CYTHON_FALLTHROUGH;
57437  case 0: break;
57438  default: goto __pyx_L5_argtuple_error;
57439  }
57440  kw_args = PyDict_Size(__pyx_kwds);
57441  switch (pos_args) {
57442  case 0:
57443  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
57444  else goto __pyx_L5_argtuple_error;
57445  CYTHON_FALLTHROUGH;
57446  case 1:
57447  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
57448  else {
57449  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SolitaryWave", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
57450  }
57451  CYTHON_FALLTHROUGH;
57452  case 2:
57453  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
57454  else {
57455  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SolitaryWave", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
57456  }
57457  }
57458  if (unlikely(kw_args > 0)) {
57459  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_SolitaryWave") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
57460  }
57461  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
57462  goto __pyx_L5_argtuple_error;
57463  } else {
57464  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
57465  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
57466  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
57467  }
57468  __pyx_v___pyx_type = values[0];
57469  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
57470  __pyx_v___pyx_state = values[2];
57471  }
57472  goto __pyx_L4_argument_unpacking_done;
57473  __pyx_L5_argtuple_error:;
57474  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SolitaryWave", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
57475  __pyx_L3_error:;
57476  __Pyx_AddTraceback("WaveTools.__pyx_unpickle_SolitaryWave", __pyx_clineno, __pyx_lineno, __pyx_filename);
57477  __Pyx_RefNannyFinishContext();
57478  return NULL;
57479  __pyx_L4_argument_unpacking_done:;
57480  __pyx_r = __pyx_pf_9WaveTools_52__pyx_unpickle_SolitaryWave(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
57481 
57482  /* function exit code */
57483  __Pyx_RefNannyFinishContext();
57484  return __pyx_r;
57485 }
57486 
57487 static PyObject *__pyx_pf_9WaveTools_52__pyx_unpickle_SolitaryWave(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
57488  PyObject *__pyx_v___pyx_PickleError = 0;
57489  PyObject *__pyx_v___pyx_result = 0;
57490  PyObject *__pyx_r = NULL;
57491  __Pyx_RefNannyDeclarations
57492  int __pyx_t_1;
57493  PyObject *__pyx_t_2 = NULL;
57494  PyObject *__pyx_t_3 = NULL;
57495  PyObject *__pyx_t_4 = NULL;
57496  PyObject *__pyx_t_5 = NULL;
57497  int __pyx_t_6;
57498  __Pyx_RefNannySetupContext("__pyx_unpickle_SolitaryWave", 0);
57499 
57500  /* "(tree fragment)":4
57501  * cdef object __pyx_PickleError
57502  * cdef object __pyx_result
57503  * if __pyx_checksum != 0x9a37670: # <<<<<<<<<<<<<<
57504  * from pickle import PickleError as __pyx_PickleError
57505  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum)
57506  */
57507  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9a37670) != 0);
57508  if (__pyx_t_1) {
57509 
57510  /* "(tree fragment)":5
57511  * cdef object __pyx_result
57512  * if __pyx_checksum != 0x9a37670:
57513  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
57514  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum)
57515  * __pyx_result = SolitaryWave.__new__(__pyx_type)
57516  */
57517  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
57518  __Pyx_GOTREF(__pyx_t_2);
57519  __Pyx_INCREF(__pyx_n_s_PickleError);
57520  __Pyx_GIVEREF(__pyx_n_s_PickleError);
57521  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
57522  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
57523  __Pyx_GOTREF(__pyx_t_3);
57524  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57525  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
57526  __Pyx_GOTREF(__pyx_t_2);
57527  __Pyx_INCREF(__pyx_t_2);
57528  __pyx_v___pyx_PickleError = __pyx_t_2;
57529  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57530  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57531 
57532  /* "(tree fragment)":6
57533  * if __pyx_checksum != 0x9a37670:
57534  * from pickle import PickleError as __pyx_PickleError
57535  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum) # <<<<<<<<<<<<<<
57536  * __pyx_result = SolitaryWave.__new__(__pyx_type)
57537  * if __pyx_state is not None:
57538  */
57539  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
57540  __Pyx_GOTREF(__pyx_t_2);
57541  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
57542  __Pyx_GOTREF(__pyx_t_4);
57543  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57544  __Pyx_INCREF(__pyx_v___pyx_PickleError);
57545  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
57546  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
57547  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
57548  if (likely(__pyx_t_5)) {
57549  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
57550  __Pyx_INCREF(__pyx_t_5);
57551  __Pyx_INCREF(function);
57552  __Pyx_DECREF_SET(__pyx_t_2, function);
57553  }
57554  }
57555  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
57556  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
57557  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57558  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
57559  __Pyx_GOTREF(__pyx_t_3);
57560  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57561  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
57562  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57563  __PYX_ERR(1, 6, __pyx_L1_error)
57564 
57565  /* "(tree fragment)":4
57566  * cdef object __pyx_PickleError
57567  * cdef object __pyx_result
57568  * if __pyx_checksum != 0x9a37670: # <<<<<<<<<<<<<<
57569  * from pickle import PickleError as __pyx_PickleError
57570  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum)
57571  */
57572  }
57573 
57574  /* "(tree fragment)":7
57575  * from pickle import PickleError as __pyx_PickleError
57576  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum)
57577  * __pyx_result = SolitaryWave.__new__(__pyx_type) # <<<<<<<<<<<<<<
57578  * if __pyx_state is not None:
57579  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state)
57580  */
57581  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9WaveTools_SolitaryWave), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
57582  __Pyx_GOTREF(__pyx_t_2);
57583  __pyx_t_4 = NULL;
57584  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
57585  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
57586  if (likely(__pyx_t_4)) {
57587  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
57588  __Pyx_INCREF(__pyx_t_4);
57589  __Pyx_INCREF(function);
57590  __Pyx_DECREF_SET(__pyx_t_2, function);
57591  }
57592  }
57593  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
57594  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
57595  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
57596  __Pyx_GOTREF(__pyx_t_3);
57597  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57598  __pyx_v___pyx_result = __pyx_t_3;
57599  __pyx_t_3 = 0;
57600 
57601  /* "(tree fragment)":8
57602  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum)
57603  * __pyx_result = SolitaryWave.__new__(__pyx_type)
57604  * if __pyx_state is not None: # <<<<<<<<<<<<<<
57605  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state)
57606  * return __pyx_result
57607  */
57608  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
57609  __pyx_t_6 = (__pyx_t_1 != 0);
57610  if (__pyx_t_6) {
57611 
57612  /* "(tree fragment)":9
57613  * __pyx_result = SolitaryWave.__new__(__pyx_type)
57614  * if __pyx_state is not None:
57615  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
57616  * return __pyx_result
57617  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state):
57618  */
57619  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
57620  __pyx_t_3 = __pyx_f_9WaveTools___pyx_unpickle_SolitaryWave__set_state(((struct __pyx_obj_9WaveTools_SolitaryWave *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
57621  __Pyx_GOTREF(__pyx_t_3);
57622  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57623 
57624  /* "(tree fragment)":8
57625  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x9a37670 = (H, K, c, d2, d3, depth, fast, g, gAbs, mwl, trans, vDir, waveDir))" % __pyx_checksum)
57626  * __pyx_result = SolitaryWave.__new__(__pyx_type)
57627  * if __pyx_state is not None: # <<<<<<<<<<<<<<
57628  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state)
57629  * return __pyx_result
57630  */
57631  }
57632 
57633  /* "(tree fragment)":10
57634  * if __pyx_state is not None:
57635  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state)
57636  * return __pyx_result # <<<<<<<<<<<<<<
57637  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state):
57638  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12]
57639  */
57640  __Pyx_XDECREF(__pyx_r);
57641  __Pyx_INCREF(__pyx_v___pyx_result);
57642  __pyx_r = __pyx_v___pyx_result;
57643  goto __pyx_L0;
57644 
57645  /* "(tree fragment)":1
57646  * def __pyx_unpickle_SolitaryWave(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
57647  * cdef object __pyx_PickleError
57648  * cdef object __pyx_result
57649  */
57650 
57651  /* function exit code */
57652  __pyx_L1_error:;
57653  __Pyx_XDECREF(__pyx_t_2);
57654  __Pyx_XDECREF(__pyx_t_3);
57655  __Pyx_XDECREF(__pyx_t_4);
57656  __Pyx_XDECREF(__pyx_t_5);
57657  __Pyx_AddTraceback("WaveTools.__pyx_unpickle_SolitaryWave", __pyx_clineno, __pyx_lineno, __pyx_filename);
57658  __pyx_r = NULL;
57659  __pyx_L0:;
57660  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
57661  __Pyx_XDECREF(__pyx_v___pyx_result);
57662  __Pyx_XGIVEREF(__pyx_r);
57663  __Pyx_RefNannyFinishContext();
57664  return __pyx_r;
57665 }
57666 
57667 /* "(tree fragment)":11
57668  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state)
57669  * return __pyx_result
57670  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
57671  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12]
57672  * if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
57673  */
57674 
57675 static PyObject *__pyx_f_9WaveTools___pyx_unpickle_SolitaryWave__set_state(struct __pyx_obj_9WaveTools_SolitaryWave *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
57676  PyObject *__pyx_r = NULL;
57677  __Pyx_RefNannyDeclarations
57678  PyObject *__pyx_t_1 = NULL;
57679  double __pyx_t_2;
57680  bool __pyx_t_3;
57681  int __pyx_t_4;
57682  Py_ssize_t __pyx_t_5;
57683  int __pyx_t_6;
57684  int __pyx_t_7;
57685  PyObject *__pyx_t_8 = NULL;
57686  PyObject *__pyx_t_9 = NULL;
57687  PyObject *__pyx_t_10 = NULL;
57688  __Pyx_RefNannySetupContext("__pyx_unpickle_SolitaryWave__set_state", 0);
57689 
57690  /* "(tree fragment)":12
57691  * return __pyx_result
57692  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state):
57693  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12] # <<<<<<<<<<<<<<
57694  * if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
57695  * __pyx_result.__dict__.update(__pyx_state[13])
57696  */
57697  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57698  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57699  __PYX_ERR(1, 12, __pyx_L1_error)
57700  }
57701  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57702  __Pyx_GOTREF(__pyx_t_1);
57703  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57704  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57705  __pyx_v___pyx_result->H = __pyx_t_2;
57706  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57707  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57708  __PYX_ERR(1, 12, __pyx_L1_error)
57709  }
57710  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57711  __Pyx_GOTREF(__pyx_t_1);
57712  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57713  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57714  __pyx_v___pyx_result->K = __pyx_t_2;
57715  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57716  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57717  __PYX_ERR(1, 12, __pyx_L1_error)
57718  }
57719  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57720  __Pyx_GOTREF(__pyx_t_1);
57721  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57722  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57723  __pyx_v___pyx_result->c = __pyx_t_2;
57724  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57725  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57726  __PYX_ERR(1, 12, __pyx_L1_error)
57727  }
57728  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57729  __Pyx_GOTREF(__pyx_t_1);
57730  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57731  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57732  __pyx_v___pyx_result->d2 = __pyx_t_2;
57733  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57734  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57735  __PYX_ERR(1, 12, __pyx_L1_error)
57736  }
57737  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57738  __Pyx_GOTREF(__pyx_t_1);
57739  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57740  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57741  __pyx_v___pyx_result->d3 = __pyx_t_2;
57742  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57743  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57744  __PYX_ERR(1, 12, __pyx_L1_error)
57745  }
57746  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57747  __Pyx_GOTREF(__pyx_t_1);
57748  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57749  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57750  __pyx_v___pyx_result->depth = __pyx_t_2;
57751  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57752  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57753  __PYX_ERR(1, 12, __pyx_L1_error)
57754  }
57755  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57756  __Pyx_GOTREF(__pyx_t_1);
57757  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57758  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57759  __pyx_v___pyx_result->fast = __pyx_t_3;
57760  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57761  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57762  __PYX_ERR(1, 12, __pyx_L1_error)
57763  }
57764  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57765  __Pyx_GOTREF(__pyx_t_1);
57766  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
57767  __Pyx_GIVEREF(__pyx_t_1);
57768  __Pyx_GOTREF(__pyx_v___pyx_result->g);
57769  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->g));
57770  __pyx_v___pyx_result->g = ((PyArrayObject *)__pyx_t_1);
57771  __pyx_t_1 = 0;
57772  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57773  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57774  __PYX_ERR(1, 12, __pyx_L1_error)
57775  }
57776  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57777  __Pyx_GOTREF(__pyx_t_1);
57778  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57779  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57780  __pyx_v___pyx_result->gAbs = __pyx_t_2;
57781  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57782  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57783  __PYX_ERR(1, 12, __pyx_L1_error)
57784  }
57785  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57786  __Pyx_GOTREF(__pyx_t_1);
57787  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
57788  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57789  __pyx_v___pyx_result->mwl = __pyx_t_2;
57790  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57791  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57792  __PYX_ERR(1, 12, __pyx_L1_error)
57793  }
57794  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57795  __Pyx_GOTREF(__pyx_t_1);
57796  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
57797  __Pyx_GIVEREF(__pyx_t_1);
57798  __Pyx_GOTREF(__pyx_v___pyx_result->trans);
57799  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->trans));
57800  __pyx_v___pyx_result->trans = ((PyArrayObject *)__pyx_t_1);
57801  __pyx_t_1 = 0;
57802  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57803  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57804  __PYX_ERR(1, 12, __pyx_L1_error)
57805  }
57806  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57807  __Pyx_GOTREF(__pyx_t_1);
57808  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
57809  __Pyx_GIVEREF(__pyx_t_1);
57810  __Pyx_GOTREF(__pyx_v___pyx_result->vDir);
57811  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->vDir));
57812  __pyx_v___pyx_result->vDir = ((PyArrayObject *)__pyx_t_1);
57813  __pyx_t_1 = 0;
57814  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57815  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57816  __PYX_ERR(1, 12, __pyx_L1_error)
57817  }
57818  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
57819  __Pyx_GOTREF(__pyx_t_1);
57820  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
57821  __Pyx_GIVEREF(__pyx_t_1);
57822  __Pyx_GOTREF(__pyx_v___pyx_result->waveDir);
57823  __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->waveDir));
57824  __pyx_v___pyx_result->waveDir = ((PyArrayObject *)__pyx_t_1);
57825  __pyx_t_1 = 0;
57826 
57827  /* "(tree fragment)":13
57828  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state):
57829  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12]
57830  * if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
57831  * __pyx_result.__dict__.update(__pyx_state[13])
57832  */
57833  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57834  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
57835  __PYX_ERR(1, 13, __pyx_L1_error)
57836  }
57837  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
57838  __pyx_t_6 = ((__pyx_t_5 > 13) != 0);
57839  if (__pyx_t_6) {
57840  } else {
57841  __pyx_t_4 = __pyx_t_6;
57842  goto __pyx_L4_bool_binop_done;
57843  }
57844  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
57845  __pyx_t_7 = (__pyx_t_6 != 0);
57846  __pyx_t_4 = __pyx_t_7;
57847  __pyx_L4_bool_binop_done:;
57848  if (__pyx_t_4) {
57849 
57850  /* "(tree fragment)":14
57851  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12]
57852  * if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
57853  * __pyx_result.__dict__.update(__pyx_state[13]) # <<<<<<<<<<<<<<
57854  */
57855  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
57856  __Pyx_GOTREF(__pyx_t_8);
57857  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
57858  __Pyx_GOTREF(__pyx_t_9);
57859  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
57860  if (unlikely(__pyx_v___pyx_state == Py_None)) {
57861  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
57862  __PYX_ERR(1, 14, __pyx_L1_error)
57863  }
57864  __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
57865  __Pyx_GOTREF(__pyx_t_8);
57866  __pyx_t_10 = NULL;
57867  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
57868  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
57869  if (likely(__pyx_t_10)) {
57870  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
57871  __Pyx_INCREF(__pyx_t_10);
57872  __Pyx_INCREF(function);
57873  __Pyx_DECREF_SET(__pyx_t_9, function);
57874  }
57875  }
57876  __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8);
57877  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
57878  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
57879  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
57880  __Pyx_GOTREF(__pyx_t_1);
57881  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
57882  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57883 
57884  /* "(tree fragment)":13
57885  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state):
57886  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12]
57887  * if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
57888  * __pyx_result.__dict__.update(__pyx_state[13])
57889  */
57890  }
57891 
57892  /* "(tree fragment)":11
57893  * __pyx_unpickle_SolitaryWave__set_state(<SolitaryWave> __pyx_result, __pyx_state)
57894  * return __pyx_result
57895  * cdef __pyx_unpickle_SolitaryWave__set_state(SolitaryWave __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
57896  * __pyx_result.H = __pyx_state[0]; __pyx_result.K = __pyx_state[1]; __pyx_result.c = __pyx_state[2]; __pyx_result.d2 = __pyx_state[3]; __pyx_result.d3 = __pyx_state[4]; __pyx_result.depth = __pyx_state[5]; __pyx_result.fast = __pyx_state[6]; __pyx_result.g = __pyx_state[7]; __pyx_result.gAbs = __pyx_state[8]; __pyx_result.mwl = __pyx_state[9]; __pyx_result.trans = __pyx_state[10]; __pyx_result.vDir = __pyx_state[11]; __pyx_result.waveDir = __pyx_state[12]
57897  * if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
57898  */
57899 
57900  /* function exit code */
57901  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57902  goto __pyx_L0;
57903  __pyx_L1_error:;
57904  __Pyx_XDECREF(__pyx_t_1);
57905  __Pyx_XDECREF(__pyx_t_8);
57906  __Pyx_XDECREF(__pyx_t_9);
57907  __Pyx_XDECREF(__pyx_t_10);
57908  __Pyx_AddTraceback("WaveTools.__pyx_unpickle_SolitaryWave__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
57909  __pyx_r = 0;
57910  __pyx_L0:;
57911  __Pyx_XGIVEREF(__pyx_r);
57912  __Pyx_RefNannyFinishContext();
57913  return __pyx_r;
57914 }
57915 
57916 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
57917  * # experimental exception made for __getbuffer__ and __releasebuffer__
57918  * # -- the details of this may change.
57919  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
57920  * # This implementation of getbuffer is geared towards Cython
57921  * # requirements, and does not yet fulfill the PEP.
57922  */
57923 
57924 /* Python wrapper */
57925 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
57926 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
57927  int __pyx_r;
57928  __Pyx_RefNannyDeclarations
57929  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
57930  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
57931 
57932  /* function exit code */
57933  __Pyx_RefNannyFinishContext();
57934  return __pyx_r;
57935 }
57936 
57937 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
57938  int __pyx_v_i;
57939  int __pyx_v_ndim;
57940  int __pyx_v_endian_detector;
57941  int __pyx_v_little_endian;
57942  int __pyx_v_t;
57943  char *__pyx_v_f;
57944  PyArray_Descr *__pyx_v_descr = 0;
57945  int __pyx_v_offset;
57946  int __pyx_r;
57947  __Pyx_RefNannyDeclarations
57948  int __pyx_t_1;
57949  int __pyx_t_2;
57950  PyObject *__pyx_t_3 = NULL;
57951  int __pyx_t_4;
57952  int __pyx_t_5;
57953  int __pyx_t_6;
57954  PyArray_Descr *__pyx_t_7;
57955  PyObject *__pyx_t_8 = NULL;
57956  char *__pyx_t_9;
57957  if (__pyx_v_info == NULL) {
57958  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
57959  return -1;
57960  }
57961  __Pyx_RefNannySetupContext("__getbuffer__", 0);
57962  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
57963  __Pyx_GIVEREF(__pyx_v_info->obj);
57964 
57965  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
57966  *
57967  * cdef int i, ndim
57968  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
57969  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
57970  *
57971  */
57972  __pyx_v_endian_detector = 1;
57973 
57974  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
57975  * cdef int i, ndim
57976  * cdef int endian_detector = 1
57977  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
57978  *
57979  * ndim = PyArray_NDIM(self)
57980  */
57981  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
57982 
57983  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
57984  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
57985  *
57986  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
57987  *
57988  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
57989  */
57990  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
57991 
57992  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
57993  * ndim = PyArray_NDIM(self)
57994  *
57995  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
57996  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
57997  * raise ValueError(u"ndarray is not C contiguous")
57998  */
57999  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
58000  if (__pyx_t_2) {
58001  } else {
58002  __pyx_t_1 = __pyx_t_2;
58003  goto __pyx_L4_bool_binop_done;
58004  }
58005 
58006  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
58007  *
58008  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
58009  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
58010  * raise ValueError(u"ndarray is not C contiguous")
58011  *
58012  */
58013  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
58014  __pyx_t_1 = __pyx_t_2;
58015  __pyx_L4_bool_binop_done:;
58016 
58017  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
58018  * ndim = PyArray_NDIM(self)
58019  *
58020  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
58021  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
58022  * raise ValueError(u"ndarray is not C contiguous")
58023  */
58024  if (unlikely(__pyx_t_1)) {
58025 
58026  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
58027  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
58028  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
58029  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
58030  *
58031  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
58032  */
58033  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 272, __pyx_L1_error)
58034  __Pyx_GOTREF(__pyx_t_3);
58035  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58036  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
58037  __PYX_ERR(3, 272, __pyx_L1_error)
58038 
58039  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
58040  * ndim = PyArray_NDIM(self)
58041  *
58042  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
58043  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
58044  * raise ValueError(u"ndarray is not C contiguous")
58045  */
58046  }
58047 
58048  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
58049  * raise ValueError(u"ndarray is not C contiguous")
58050  *
58051  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
58052  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
58053  * raise ValueError(u"ndarray is not Fortran contiguous")
58054  */
58055  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
58056  if (__pyx_t_2) {
58057  } else {
58058  __pyx_t_1 = __pyx_t_2;
58059  goto __pyx_L7_bool_binop_done;
58060  }
58061 
58062  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
58063  *
58064  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
58065  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
58066  * raise ValueError(u"ndarray is not Fortran contiguous")
58067  *
58068  */
58069  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
58070  __pyx_t_1 = __pyx_t_2;
58071  __pyx_L7_bool_binop_done:;
58072 
58073  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
58074  * raise ValueError(u"ndarray is not C contiguous")
58075  *
58076  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
58077  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
58078  * raise ValueError(u"ndarray is not Fortran contiguous")
58079  */
58080  if (unlikely(__pyx_t_1)) {
58081 
58082  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
58083  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
58084  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
58085  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
58086  *
58087  * info.buf = PyArray_DATA(self)
58088  */
58089  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 276, __pyx_L1_error)
58090  __Pyx_GOTREF(__pyx_t_3);
58091  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58092  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
58093  __PYX_ERR(3, 276, __pyx_L1_error)
58094 
58095  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
58096  * raise ValueError(u"ndarray is not C contiguous")
58097  *
58098  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
58099  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
58100  * raise ValueError(u"ndarray is not Fortran contiguous")
58101  */
58102  }
58103 
58104  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
58105  * raise ValueError(u"ndarray is not Fortran contiguous")
58106  *
58107  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
58108  * info.ndim = ndim
58109  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
58110  */
58111  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
58112 
58113  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
58114  *
58115  * info.buf = PyArray_DATA(self)
58116  * info.ndim = ndim # <<<<<<<<<<<<<<
58117  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
58118  * # Allocate new buffer for strides and shape info.
58119  */
58120  __pyx_v_info->ndim = __pyx_v_ndim;
58121 
58122  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
58123  * info.buf = PyArray_DATA(self)
58124  * info.ndim = ndim
58125  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
58126  * # Allocate new buffer for strides and shape info.
58127  * # This is allocated as one block, strides first.
58128  */
58129  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
58130  if (__pyx_t_1) {
58131 
58132  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
58133  * # Allocate new buffer for strides and shape info.
58134  * # This is allocated as one block, strides first.
58135  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
58136  * info.shape = info.strides + ndim
58137  * for i in range(ndim):
58138  */
58139  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
58140 
58141  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
58142  * # This is allocated as one block, strides first.
58143  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
58144  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
58145  * for i in range(ndim):
58146  * info.strides[i] = PyArray_STRIDES(self)[i]
58147  */
58148  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
58149 
58150  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":285
58151  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
58152  * info.shape = info.strides + ndim
58153  * for i in range(ndim): # <<<<<<<<<<<<<<
58154  * info.strides[i] = PyArray_STRIDES(self)[i]
58155  * info.shape[i] = PyArray_DIMS(self)[i]
58156  */
58157  __pyx_t_4 = __pyx_v_ndim;
58158  __pyx_t_5 = __pyx_t_4;
58159  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
58160  __pyx_v_i = __pyx_t_6;
58161 
58162  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
58163  * info.shape = info.strides + ndim
58164  * for i in range(ndim):
58165  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
58166  * info.shape[i] = PyArray_DIMS(self)[i]
58167  * else:
58168  */
58169  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
58170 
58171  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
58172  * for i in range(ndim):
58173  * info.strides[i] = PyArray_STRIDES(self)[i]
58174  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
58175  * else:
58176  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
58177  */
58178  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
58179  }
58180 
58181  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
58182  * info.buf = PyArray_DATA(self)
58183  * info.ndim = ndim
58184  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
58185  * # Allocate new buffer for strides and shape info.
58186  * # This is allocated as one block, strides first.
58187  */
58188  goto __pyx_L9;
58189  }
58190 
58191  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
58192  * info.shape[i] = PyArray_DIMS(self)[i]
58193  * else:
58194  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
58195  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
58196  * info.suboffsets = NULL
58197  */
58198  /*else*/ {
58199  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
58200 
58201  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":290
58202  * else:
58203  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
58204  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
58205  * info.suboffsets = NULL
58206  * info.itemsize = PyArray_ITEMSIZE(self)
58207  */
58208  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
58209  }
58210  __pyx_L9:;
58211 
58212  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":291
58213  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
58214  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
58215  * info.suboffsets = NULL # <<<<<<<<<<<<<<
58216  * info.itemsize = PyArray_ITEMSIZE(self)
58217  * info.readonly = not PyArray_ISWRITEABLE(self)
58218  */
58219  __pyx_v_info->suboffsets = NULL;
58220 
58221  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
58222  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
58223  * info.suboffsets = NULL
58224  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
58225  * info.readonly = not PyArray_ISWRITEABLE(self)
58226  *
58227  */
58228  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
58229 
58230  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":293
58231  * info.suboffsets = NULL
58232  * info.itemsize = PyArray_ITEMSIZE(self)
58233  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
58234  *
58235  * cdef int t
58236  */
58237  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
58238 
58239  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
58240  *
58241  * cdef int t
58242  * cdef char* f = NULL # <<<<<<<<<<<<<<
58243  * cdef dtype descr = <dtype>PyArray_DESCR(self)
58244  * cdef int offset
58245  */
58246  __pyx_v_f = NULL;
58247 
58248  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
58249  * cdef int t
58250  * cdef char* f = NULL
58251  * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
58252  * cdef int offset
58253  *
58254  */
58255  __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
58256  __pyx_t_3 = ((PyObject *)__pyx_t_7);
58257  __Pyx_INCREF(__pyx_t_3);
58258  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
58259  __pyx_t_3 = 0;
58260 
58261  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":300
58262  * cdef int offset
58263  *
58264  * info.obj = self # <<<<<<<<<<<<<<
58265  *
58266  * if not PyDataType_HASFIELDS(descr):
58267  */
58268  __Pyx_INCREF(((PyObject *)__pyx_v_self));
58269  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
58270  __Pyx_GOTREF(__pyx_v_info->obj);
58271  __Pyx_DECREF(__pyx_v_info->obj);
58272  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
58273 
58274  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
58275  * info.obj = self
58276  *
58277  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
58278  * t = descr.type_num
58279  * if ((descr.byteorder == c'>' and little_endian) or
58280  */
58281  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
58282  if (__pyx_t_1) {
58283 
58284  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":303
58285  *
58286  * if not PyDataType_HASFIELDS(descr):
58287  * t = descr.type_num # <<<<<<<<<<<<<<
58288  * if ((descr.byteorder == c'>' and little_endian) or
58289  * (descr.byteorder == c'<' and not little_endian)):
58290  */
58291  __pyx_t_4 = __pyx_v_descr->type_num;
58292  __pyx_v_t = __pyx_t_4;
58293 
58294  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
58295  * if not PyDataType_HASFIELDS(descr):
58296  * t = descr.type_num
58297  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
58298  * (descr.byteorder == c'<' and not little_endian)):
58299  * raise ValueError(u"Non-native byte order not supported")
58300  */
58301  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
58302  if (!__pyx_t_2) {
58303  goto __pyx_L15_next_or;
58304  } else {
58305  }
58306  __pyx_t_2 = (__pyx_v_little_endian != 0);
58307  if (!__pyx_t_2) {
58308  } else {
58309  __pyx_t_1 = __pyx_t_2;
58310  goto __pyx_L14_bool_binop_done;
58311  }
58312  __pyx_L15_next_or:;
58313 
58314  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":305
58315  * t = descr.type_num
58316  * if ((descr.byteorder == c'>' and little_endian) or
58317  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
58318  * raise ValueError(u"Non-native byte order not supported")
58319  * if t == NPY_BYTE: f = "b"
58320  */
58321  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
58322  if (__pyx_t_2) {
58323  } else {
58324  __pyx_t_1 = __pyx_t_2;
58325  goto __pyx_L14_bool_binop_done;
58326  }
58327  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
58328  __pyx_t_1 = __pyx_t_2;
58329  __pyx_L14_bool_binop_done:;
58330 
58331  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
58332  * if not PyDataType_HASFIELDS(descr):
58333  * t = descr.type_num
58334  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
58335  * (descr.byteorder == c'<' and not little_endian)):
58336  * raise ValueError(u"Non-native byte order not supported")
58337  */
58338  if (unlikely(__pyx_t_1)) {
58339 
58340  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
58341  * if ((descr.byteorder == c'>' and little_endian) or
58342  * (descr.byteorder == c'<' and not little_endian)):
58343  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
58344  * if t == NPY_BYTE: f = "b"
58345  * elif t == NPY_UBYTE: f = "B"
58346  */
58347  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 306, __pyx_L1_error)
58348  __Pyx_GOTREF(__pyx_t_3);
58349  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58350  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
58351  __PYX_ERR(3, 306, __pyx_L1_error)
58352 
58353  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":304
58354  * if not PyDataType_HASFIELDS(descr):
58355  * t = descr.type_num
58356  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
58357  * (descr.byteorder == c'<' and not little_endian)):
58358  * raise ValueError(u"Non-native byte order not supported")
58359  */
58360  }
58361 
58362  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":307
58363  * (descr.byteorder == c'<' and not little_endian)):
58364  * raise ValueError(u"Non-native byte order not supported")
58365  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
58366  * elif t == NPY_UBYTE: f = "B"
58367  * elif t == NPY_SHORT: f = "h"
58368  */
58369  switch (__pyx_v_t) {
58370  case NPY_BYTE:
58371  __pyx_v_f = ((char *)"b");
58372  break;
58373  case NPY_UBYTE:
58374 
58375  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":308
58376  * raise ValueError(u"Non-native byte order not supported")
58377  * if t == NPY_BYTE: f = "b"
58378  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
58379  * elif t == NPY_SHORT: f = "h"
58380  * elif t == NPY_USHORT: f = "H"
58381  */
58382  __pyx_v_f = ((char *)"B");
58383  break;
58384  case NPY_SHORT:
58385 
58386  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":309
58387  * if t == NPY_BYTE: f = "b"
58388  * elif t == NPY_UBYTE: f = "B"
58389  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
58390  * elif t == NPY_USHORT: f = "H"
58391  * elif t == NPY_INT: f = "i"
58392  */
58393  __pyx_v_f = ((char *)"h");
58394  break;
58395  case NPY_USHORT:
58396 
58397  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":310
58398  * elif t == NPY_UBYTE: f = "B"
58399  * elif t == NPY_SHORT: f = "h"
58400  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
58401  * elif t == NPY_INT: f = "i"
58402  * elif t == NPY_UINT: f = "I"
58403  */
58404  __pyx_v_f = ((char *)"H");
58405  break;
58406  case NPY_INT:
58407 
58408  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":311
58409  * elif t == NPY_SHORT: f = "h"
58410  * elif t == NPY_USHORT: f = "H"
58411  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
58412  * elif t == NPY_UINT: f = "I"
58413  * elif t == NPY_LONG: f = "l"
58414  */
58415  __pyx_v_f = ((char *)"i");
58416  break;
58417  case NPY_UINT:
58418 
58419  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":312
58420  * elif t == NPY_USHORT: f = "H"
58421  * elif t == NPY_INT: f = "i"
58422  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
58423  * elif t == NPY_LONG: f = "l"
58424  * elif t == NPY_ULONG: f = "L"
58425  */
58426  __pyx_v_f = ((char *)"I");
58427  break;
58428  case NPY_LONG:
58429 
58430  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":313
58431  * elif t == NPY_INT: f = "i"
58432  * elif t == NPY_UINT: f = "I"
58433  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
58434  * elif t == NPY_ULONG: f = "L"
58435  * elif t == NPY_LONGLONG: f = "q"
58436  */
58437  __pyx_v_f = ((char *)"l");
58438  break;
58439  case NPY_ULONG:
58440 
58441  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":314
58442  * elif t == NPY_UINT: f = "I"
58443  * elif t == NPY_LONG: f = "l"
58444  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
58445  * elif t == NPY_LONGLONG: f = "q"
58446  * elif t == NPY_ULONGLONG: f = "Q"
58447  */
58448  __pyx_v_f = ((char *)"L");
58449  break;
58450  case NPY_LONGLONG:
58451 
58452  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":315
58453  * elif t == NPY_LONG: f = "l"
58454  * elif t == NPY_ULONG: f = "L"
58455  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
58456  * elif t == NPY_ULONGLONG: f = "Q"
58457  * elif t == NPY_FLOAT: f = "f"
58458  */
58459  __pyx_v_f = ((char *)"q");
58460  break;
58461  case NPY_ULONGLONG:
58462 
58463  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":316
58464  * elif t == NPY_ULONG: f = "L"
58465  * elif t == NPY_LONGLONG: f = "q"
58466  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
58467  * elif t == NPY_FLOAT: f = "f"
58468  * elif t == NPY_DOUBLE: f = "d"
58469  */
58470  __pyx_v_f = ((char *)"Q");
58471  break;
58472  case NPY_FLOAT:
58473 
58474  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":317
58475  * elif t == NPY_LONGLONG: f = "q"
58476  * elif t == NPY_ULONGLONG: f = "Q"
58477  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
58478  * elif t == NPY_DOUBLE: f = "d"
58479  * elif t == NPY_LONGDOUBLE: f = "g"
58480  */
58481  __pyx_v_f = ((char *)"f");
58482  break;
58483  case NPY_DOUBLE:
58484 
58485  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":318
58486  * elif t == NPY_ULONGLONG: f = "Q"
58487  * elif t == NPY_FLOAT: f = "f"
58488  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
58489  * elif t == NPY_LONGDOUBLE: f = "g"
58490  * elif t == NPY_CFLOAT: f = "Zf"
58491  */
58492  __pyx_v_f = ((char *)"d");
58493  break;
58494  case NPY_LONGDOUBLE:
58495 
58496  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":319
58497  * elif t == NPY_FLOAT: f = "f"
58498  * elif t == NPY_DOUBLE: f = "d"
58499  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
58500  * elif t == NPY_CFLOAT: f = "Zf"
58501  * elif t == NPY_CDOUBLE: f = "Zd"
58502  */
58503  __pyx_v_f = ((char *)"g");
58504  break;
58505  case NPY_CFLOAT:
58506 
58507  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":320
58508  * elif t == NPY_DOUBLE: f = "d"
58509  * elif t == NPY_LONGDOUBLE: f = "g"
58510  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
58511  * elif t == NPY_CDOUBLE: f = "Zd"
58512  * elif t == NPY_CLONGDOUBLE: f = "Zg"
58513  */
58514  __pyx_v_f = ((char *)"Zf");
58515  break;
58516  case NPY_CDOUBLE:
58517 
58518  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":321
58519  * elif t == NPY_LONGDOUBLE: f = "g"
58520  * elif t == NPY_CFLOAT: f = "Zf"
58521  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
58522  * elif t == NPY_CLONGDOUBLE: f = "Zg"
58523  * elif t == NPY_OBJECT: f = "O"
58524  */
58525  __pyx_v_f = ((char *)"Zd");
58526  break;
58527  case NPY_CLONGDOUBLE:
58528 
58529  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":322
58530  * elif t == NPY_CFLOAT: f = "Zf"
58531  * elif t == NPY_CDOUBLE: f = "Zd"
58532  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
58533  * elif t == NPY_OBJECT: f = "O"
58534  * else:
58535  */
58536  __pyx_v_f = ((char *)"Zg");
58537  break;
58538  case NPY_OBJECT:
58539 
58540  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":323
58541  * elif t == NPY_CDOUBLE: f = "Zd"
58542  * elif t == NPY_CLONGDOUBLE: f = "Zg"
58543  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
58544  * else:
58545  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
58546  */
58547  __pyx_v_f = ((char *)"O");
58548  break;
58549  default:
58550 
58551  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":325
58552  * elif t == NPY_OBJECT: f = "O"
58553  * else:
58554  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
58555  * info.format = f
58556  * return
58557  */
58558  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
58559  __Pyx_GOTREF(__pyx_t_3);
58560  __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 325, __pyx_L1_error)
58561  __Pyx_GOTREF(__pyx_t_8);
58562  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
58563  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __pyx_L1_error)
58564  __Pyx_GOTREF(__pyx_t_3);
58565  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
58566  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
58567  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
58568  __PYX_ERR(3, 325, __pyx_L1_error)
58569  break;
58570  }
58571 
58572  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":326
58573  * else:
58574  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
58575  * info.format = f # <<<<<<<<<<<<<<
58576  * return
58577  * else:
58578  */
58579  __pyx_v_info->format = __pyx_v_f;
58580 
58581  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":327
58582  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
58583  * info.format = f
58584  * return # <<<<<<<<<<<<<<
58585  * else:
58586  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
58587  */
58588  __pyx_r = 0;
58589  goto __pyx_L0;
58590 
58591  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":302
58592  * info.obj = self
58593  *
58594  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
58595  * t = descr.type_num
58596  * if ((descr.byteorder == c'>' and little_endian) or
58597  */
58598  }
58599 
58600  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":329
58601  * return
58602  * else:
58603  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
58604  * info.format[0] = c'^' # Native data types, manual alignment
58605  * offset = 0
58606  */
58607  /*else*/ {
58608  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
58609 
58610  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":330
58611  * else:
58612  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
58613  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
58614  * offset = 0
58615  * f = _util_dtypestring(descr, info.format + 1,
58616  */
58617  (__pyx_v_info->format[0]) = '^';
58618 
58619  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":331
58620  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
58621  * info.format[0] = c'^' # Native data types, manual alignment
58622  * offset = 0 # <<<<<<<<<<<<<<
58623  * f = _util_dtypestring(descr, info.format + 1,
58624  * info.format + _buffer_format_string_len,
58625  */
58626  __pyx_v_offset = 0;
58627 
58628  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":332
58629  * info.format[0] = c'^' # Native data types, manual alignment
58630  * offset = 0
58631  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
58632  * info.format + _buffer_format_string_len,
58633  * &offset)
58634  */
58635  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 332, __pyx_L1_error)
58636  __pyx_v_f = __pyx_t_9;
58637 
58638  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":335
58639  * info.format + _buffer_format_string_len,
58640  * &offset)
58641  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
58642  *
58643  * def __releasebuffer__(ndarray self, Py_buffer* info):
58644  */
58645  (__pyx_v_f[0]) = '\x00';
58646  }
58647 
58648  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":258
58649  * # experimental exception made for __getbuffer__ and __releasebuffer__
58650  * # -- the details of this may change.
58651  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
58652  * # This implementation of getbuffer is geared towards Cython
58653  * # requirements, and does not yet fulfill the PEP.
58654  */
58655 
58656  /* function exit code */
58657  __pyx_r = 0;
58658  goto __pyx_L0;
58659  __pyx_L1_error:;
58660  __Pyx_XDECREF(__pyx_t_3);
58661  __Pyx_XDECREF(__pyx_t_8);
58662  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
58663  __pyx_r = -1;
58664  if (__pyx_v_info->obj != NULL) {
58665  __Pyx_GOTREF(__pyx_v_info->obj);
58666  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
58667  }
58668  goto __pyx_L2;
58669  __pyx_L0:;
58670  if (__pyx_v_info->obj == Py_None) {
58671  __Pyx_GOTREF(__pyx_v_info->obj);
58672  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
58673  }
58674  __pyx_L2:;
58675  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
58676  __Pyx_RefNannyFinishContext();
58677  return __pyx_r;
58678 }
58679 
58680 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
58681  * f[0] = c'\0' # Terminate format string
58682  *
58683  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
58684  * if PyArray_HASFIELDS(self):
58685  * PyObject_Free(info.format)
58686  */
58687 
58688 /* Python wrapper */
58689 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
58690 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
58691  __Pyx_RefNannyDeclarations
58692  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
58693  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
58694 
58695  /* function exit code */
58696  __Pyx_RefNannyFinishContext();
58697 }
58698 
58699 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
58700  __Pyx_RefNannyDeclarations
58701  int __pyx_t_1;
58702  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
58703 
58704  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
58705  *
58706  * def __releasebuffer__(ndarray self, Py_buffer* info):
58707  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
58708  * PyObject_Free(info.format)
58709  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
58710  */
58711  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
58712  if (__pyx_t_1) {
58713 
58714  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":339
58715  * def __releasebuffer__(ndarray self, Py_buffer* info):
58716  * if PyArray_HASFIELDS(self):
58717  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
58718  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
58719  * PyObject_Free(info.strides)
58720  */
58721  PyObject_Free(__pyx_v_info->format);
58722 
58723  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":338
58724  *
58725  * def __releasebuffer__(ndarray self, Py_buffer* info):
58726  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
58727  * PyObject_Free(info.format)
58728  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
58729  */
58730  }
58731 
58732  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
58733  * if PyArray_HASFIELDS(self):
58734  * PyObject_Free(info.format)
58735  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
58736  * PyObject_Free(info.strides)
58737  * # info.shape was stored after info.strides in the same block
58738  */
58739  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
58740  if (__pyx_t_1) {
58741 
58742  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":341
58743  * PyObject_Free(info.format)
58744  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
58745  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
58746  * # info.shape was stored after info.strides in the same block
58747  *
58748  */
58749  PyObject_Free(__pyx_v_info->strides);
58750 
58751  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":340
58752  * if PyArray_HASFIELDS(self):
58753  * PyObject_Free(info.format)
58754  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
58755  * PyObject_Free(info.strides)
58756  * # info.shape was stored after info.strides in the same block
58757  */
58758  }
58759 
58760  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":337
58761  * f[0] = c'\0' # Terminate format string
58762  *
58763  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
58764  * if PyArray_HASFIELDS(self):
58765  * PyObject_Free(info.format)
58766  */
58767 
58768  /* function exit code */
58769  __Pyx_RefNannyFinishContext();
58770 }
58771 
58772 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
58773  * ctypedef npy_cdouble complex_t
58774  *
58775  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
58776  * return PyArray_MultiIterNew(1, <void*>a)
58777  *
58778  */
58779 
58780 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
58781  PyObject *__pyx_r = NULL;
58782  __Pyx_RefNannyDeclarations
58783  PyObject *__pyx_t_1 = NULL;
58784  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
58785 
58786  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":822
58787  *
58788  * cdef inline object PyArray_MultiIterNew1(a):
58789  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
58790  *
58791  * cdef inline object PyArray_MultiIterNew2(a, b):
58792  */
58793  __Pyx_XDECREF(__pyx_r);
58794  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 822, __pyx_L1_error)
58795  __Pyx_GOTREF(__pyx_t_1);
58796  __pyx_r = __pyx_t_1;
58797  __pyx_t_1 = 0;
58798  goto __pyx_L0;
58799 
58800  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":821
58801  * ctypedef npy_cdouble complex_t
58802  *
58803  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
58804  * return PyArray_MultiIterNew(1, <void*>a)
58805  *
58806  */
58807 
58808  /* function exit code */
58809  __pyx_L1_error:;
58810  __Pyx_XDECREF(__pyx_t_1);
58811  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
58812  __pyx_r = 0;
58813  __pyx_L0:;
58814  __Pyx_XGIVEREF(__pyx_r);
58815  __Pyx_RefNannyFinishContext();
58816  return __pyx_r;
58817 }
58818 
58819 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
58820  * return PyArray_MultiIterNew(1, <void*>a)
58821  *
58822  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
58823  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
58824  *
58825  */
58826 
58827 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
58828  PyObject *__pyx_r = NULL;
58829  __Pyx_RefNannyDeclarations
58830  PyObject *__pyx_t_1 = NULL;
58831  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
58832 
58833  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
58834  *
58835  * cdef inline object PyArray_MultiIterNew2(a, b):
58836  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
58837  *
58838  * cdef inline object PyArray_MultiIterNew3(a, b, c):
58839  */
58840  __Pyx_XDECREF(__pyx_r);
58841  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 825, __pyx_L1_error)
58842  __Pyx_GOTREF(__pyx_t_1);
58843  __pyx_r = __pyx_t_1;
58844  __pyx_t_1 = 0;
58845  goto __pyx_L0;
58846 
58847  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
58848  * return PyArray_MultiIterNew(1, <void*>a)
58849  *
58850  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
58851  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
58852  *
58853  */
58854 
58855  /* function exit code */
58856  __pyx_L1_error:;
58857  __Pyx_XDECREF(__pyx_t_1);
58858  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
58859  __pyx_r = 0;
58860  __pyx_L0:;
58861  __Pyx_XGIVEREF(__pyx_r);
58862  __Pyx_RefNannyFinishContext();
58863  return __pyx_r;
58864 }
58865 
58866 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
58867  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
58868  *
58869  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
58870  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
58871  *
58872  */
58873 
58874 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
58875  PyObject *__pyx_r = NULL;
58876  __Pyx_RefNannyDeclarations
58877  PyObject *__pyx_t_1 = NULL;
58878  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
58879 
58880  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":828
58881  *
58882  * cdef inline object PyArray_MultiIterNew3(a, b, c):
58883  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
58884  *
58885  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
58886  */
58887  __Pyx_XDECREF(__pyx_r);
58888  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 828, __pyx_L1_error)
58889  __Pyx_GOTREF(__pyx_t_1);
58890  __pyx_r = __pyx_t_1;
58891  __pyx_t_1 = 0;
58892  goto __pyx_L0;
58893 
58894  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
58895  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
58896  *
58897  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
58898  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
58899  *
58900  */
58901 
58902  /* function exit code */
58903  __pyx_L1_error:;
58904  __Pyx_XDECREF(__pyx_t_1);
58905  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
58906  __pyx_r = 0;
58907  __pyx_L0:;
58908  __Pyx_XGIVEREF(__pyx_r);
58909  __Pyx_RefNannyFinishContext();
58910  return __pyx_r;
58911 }
58912 
58913 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
58914  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
58915  *
58916  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
58917  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
58918  *
58919  */
58920 
58921 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
58922  PyObject *__pyx_r = NULL;
58923  __Pyx_RefNannyDeclarations
58924  PyObject *__pyx_t_1 = NULL;
58925  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
58926 
58927  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
58928  *
58929  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
58930  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
58931  *
58932  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
58933  */
58934  __Pyx_XDECREF(__pyx_r);
58935  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 831, __pyx_L1_error)
58936  __Pyx_GOTREF(__pyx_t_1);
58937  __pyx_r = __pyx_t_1;
58938  __pyx_t_1 = 0;
58939  goto __pyx_L0;
58940 
58941  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":830
58942  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
58943  *
58944  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
58945  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
58946  *
58947  */
58948 
58949  /* function exit code */
58950  __pyx_L1_error:;
58951  __Pyx_XDECREF(__pyx_t_1);
58952  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
58953  __pyx_r = 0;
58954  __pyx_L0:;
58955  __Pyx_XGIVEREF(__pyx_r);
58956  __Pyx_RefNannyFinishContext();
58957  return __pyx_r;
58958 }
58959 
58960 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
58961  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
58962  *
58963  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
58964  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
58965  *
58966  */
58967 
58968 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
58969  PyObject *__pyx_r = NULL;
58970  __Pyx_RefNannyDeclarations
58971  PyObject *__pyx_t_1 = NULL;
58972  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
58973 
58974  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
58975  *
58976  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
58977  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
58978  *
58979  * cdef inline tuple PyDataType_SHAPE(dtype d):
58980  */
58981  __Pyx_XDECREF(__pyx_r);
58982  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 834, __pyx_L1_error)
58983  __Pyx_GOTREF(__pyx_t_1);
58984  __pyx_r = __pyx_t_1;
58985  __pyx_t_1 = 0;
58986  goto __pyx_L0;
58987 
58988  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
58989  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
58990  *
58991  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
58992  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
58993  *
58994  */
58995 
58996  /* function exit code */
58997  __pyx_L1_error:;
58998  __Pyx_XDECREF(__pyx_t_1);
58999  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
59000  __pyx_r = 0;
59001  __pyx_L0:;
59002  __Pyx_XGIVEREF(__pyx_r);
59003  __Pyx_RefNannyFinishContext();
59004  return __pyx_r;
59005 }
59006 
59007 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
59008  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
59009  *
59010  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
59011  * if PyDataType_HASSUBARRAY(d):
59012  * return <tuple>d.subarray.shape
59013  */
59014 
59015 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
59016  PyObject *__pyx_r = NULL;
59017  __Pyx_RefNannyDeclarations
59018  int __pyx_t_1;
59019  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
59020 
59021  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
59022  *
59023  * cdef inline tuple PyDataType_SHAPE(dtype d):
59024  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
59025  * return <tuple>d.subarray.shape
59026  * else:
59027  */
59028  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
59029  if (__pyx_t_1) {
59030 
59031  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
59032  * cdef inline tuple PyDataType_SHAPE(dtype d):
59033  * if PyDataType_HASSUBARRAY(d):
59034  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
59035  * else:
59036  * return ()
59037  */
59038  __Pyx_XDECREF(__pyx_r);
59039  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
59040  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
59041  goto __pyx_L0;
59042 
59043  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
59044  *
59045  * cdef inline tuple PyDataType_SHAPE(dtype d):
59046  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
59047  * return <tuple>d.subarray.shape
59048  * else:
59049  */
59050  }
59051 
59052  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
59053  * return <tuple>d.subarray.shape
59054  * else:
59055  * return () # <<<<<<<<<<<<<<
59056  *
59057  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
59058  */
59059  /*else*/ {
59060  __Pyx_XDECREF(__pyx_r);
59061  __Pyx_INCREF(__pyx_empty_tuple);
59062  __pyx_r = __pyx_empty_tuple;
59063  goto __pyx_L0;
59064  }
59065 
59066  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":836
59067  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
59068  *
59069  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
59070  * if PyDataType_HASSUBARRAY(d):
59071  * return <tuple>d.subarray.shape
59072  */
59073 
59074  /* function exit code */
59075  __pyx_L0:;
59076  __Pyx_XGIVEREF(__pyx_r);
59077  __Pyx_RefNannyFinishContext();
59078  return __pyx_r;
59079 }
59080 
59081 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
59082  * return ()
59083  *
59084  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
59085  * # Recursive utility function used in __getbuffer__ to get format
59086  * # string. The new location in the format string is returned.
59087  */
59088 
59089 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
59090  PyArray_Descr *__pyx_v_child = 0;
59091  int __pyx_v_endian_detector;
59092  int __pyx_v_little_endian;
59093  PyObject *__pyx_v_fields = 0;
59094  PyObject *__pyx_v_childname = NULL;
59095  PyObject *__pyx_v_new_offset = NULL;
59096  PyObject *__pyx_v_t = NULL;
59097  char *__pyx_r;
59098  __Pyx_RefNannyDeclarations
59099  PyObject *__pyx_t_1 = NULL;
59100  Py_ssize_t __pyx_t_2;
59101  PyObject *__pyx_t_3 = NULL;
59102  PyObject *__pyx_t_4 = NULL;
59103  int __pyx_t_5;
59104  int __pyx_t_6;
59105  int __pyx_t_7;
59106  long __pyx_t_8;
59107  char *__pyx_t_9;
59108  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
59109 
59110  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
59111  *
59112  * cdef dtype child
59113  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
59114  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
59115  * cdef tuple fields
59116  */
59117  __pyx_v_endian_detector = 1;
59118 
59119  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
59120  * cdef dtype child
59121  * cdef int endian_detector = 1
59122  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
59123  * cdef tuple fields
59124  *
59125  */
59126  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
59127 
59128  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
59129  * cdef tuple fields
59130  *
59131  * for childname in descr.names: # <<<<<<<<<<<<<<
59132  * fields = descr.fields[childname]
59133  * child, new_offset = fields
59134  */
59135  if (unlikely(__pyx_v_descr->names == Py_None)) {
59136  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
59137  __PYX_ERR(3, 851, __pyx_L1_error)
59138  }
59139  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
59140  for (;;) {
59141  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
59142  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
59143  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
59144  #else
59145  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
59146  __Pyx_GOTREF(__pyx_t_3);
59147  #endif
59148  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
59149  __pyx_t_3 = 0;
59150 
59151  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
59152  *
59153  * for childname in descr.names:
59154  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
59155  * child, new_offset = fields
59156  *
59157  */
59158  if (unlikely(__pyx_v_descr->fields == Py_None)) {
59159  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
59160  __PYX_ERR(3, 852, __pyx_L1_error)
59161  }
59162  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
59163  __Pyx_GOTREF(__pyx_t_3);
59164  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 852, __pyx_L1_error)
59165  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
59166  __pyx_t_3 = 0;
59167 
59168  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
59169  * for childname in descr.names:
59170  * fields = descr.fields[childname]
59171  * child, new_offset = fields # <<<<<<<<<<<<<<
59172  *
59173  * if (end - f) - <int>(new_offset - offset[0]) < 15:
59174  */
59175  if (likely(__pyx_v_fields != Py_None)) {
59176  PyObject* sequence = __pyx_v_fields;
59177  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
59178  if (unlikely(size != 2)) {
59179  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
59180  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
59181  __PYX_ERR(3, 853, __pyx_L1_error)
59182  }
59183  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
59184  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
59185  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
59186  __Pyx_INCREF(__pyx_t_3);
59187  __Pyx_INCREF(__pyx_t_4);
59188  #else
59189  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
59190  __Pyx_GOTREF(__pyx_t_3);
59191  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
59192  __Pyx_GOTREF(__pyx_t_4);
59193  #endif
59194  } else {
59195  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 853, __pyx_L1_error)
59196  }
59197  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 853, __pyx_L1_error)
59198  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
59199  __pyx_t_3 = 0;
59200  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
59201  __pyx_t_4 = 0;
59202 
59203  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
59204  * child, new_offset = fields
59205  *
59206  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
59207  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
59208  *
59209  */
59210  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
59211  __Pyx_GOTREF(__pyx_t_4);
59212  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
59213  __Pyx_GOTREF(__pyx_t_3);
59214  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59215  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 855, __pyx_L1_error)
59216  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59217  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
59218  if (unlikely(__pyx_t_6)) {
59219 
59220  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
59221  *
59222  * if (end - f) - <int>(new_offset - offset[0]) < 15:
59223  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
59224  *
59225  * if ((child.byteorder == c'>' and little_endian) or
59226  */
59227  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 856, __pyx_L1_error)
59228  __Pyx_GOTREF(__pyx_t_3);
59229  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
59230  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59231  __PYX_ERR(3, 856, __pyx_L1_error)
59232 
59233  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
59234  * child, new_offset = fields
59235  *
59236  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
59237  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
59238  *
59239  */
59240  }
59241 
59242  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
59243  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
59244  *
59245  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
59246  * (child.byteorder == c'<' and not little_endian)):
59247  * raise ValueError(u"Non-native byte order not supported")
59248  */
59249  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
59250  if (!__pyx_t_7) {
59251  goto __pyx_L8_next_or;
59252  } else {
59253  }
59254  __pyx_t_7 = (__pyx_v_little_endian != 0);
59255  if (!__pyx_t_7) {
59256  } else {
59257  __pyx_t_6 = __pyx_t_7;
59258  goto __pyx_L7_bool_binop_done;
59259  }
59260  __pyx_L8_next_or:;
59261 
59262  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":859
59263  *
59264  * if ((child.byteorder == c'>' and little_endian) or
59265  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
59266  * raise ValueError(u"Non-native byte order not supported")
59267  * # One could encode it in the format string and have Cython
59268  */
59269  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
59270  if (__pyx_t_7) {
59271  } else {
59272  __pyx_t_6 = __pyx_t_7;
59273  goto __pyx_L7_bool_binop_done;
59274  }
59275  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
59276  __pyx_t_6 = __pyx_t_7;
59277  __pyx_L7_bool_binop_done:;
59278 
59279  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
59280  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
59281  *
59282  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
59283  * (child.byteorder == c'<' and not little_endian)):
59284  * raise ValueError(u"Non-native byte order not supported")
59285  */
59286  if (unlikely(__pyx_t_6)) {
59287 
59288  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
59289  * if ((child.byteorder == c'>' and little_endian) or
59290  * (child.byteorder == c'<' and not little_endian)):
59291  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
59292  * # One could encode it in the format string and have Cython
59293  * # complain instead, BUT: < and > in format strings also imply
59294  */
59295  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 860, __pyx_L1_error)
59296  __Pyx_GOTREF(__pyx_t_3);
59297  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
59298  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59299  __PYX_ERR(3, 860, __pyx_L1_error)
59300 
59301  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":858
59302  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
59303  *
59304  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
59305  * (child.byteorder == c'<' and not little_endian)):
59306  * raise ValueError(u"Non-native byte order not supported")
59307  */
59308  }
59309 
59310  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":870
59311  *
59312  * # Output padding bytes
59313  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
59314  * f[0] = 120 # "x"; pad byte
59315  * f += 1
59316  */
59317  while (1) {
59318  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 870, __pyx_L1_error)
59319  __Pyx_GOTREF(__pyx_t_3);
59320  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 870, __pyx_L1_error)
59321  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59322  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
59323  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59324  if (!__pyx_t_6) break;
59325 
59326  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":871
59327  * # Output padding bytes
59328  * while offset[0] < new_offset:
59329  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
59330  * f += 1
59331  * offset[0] += 1
59332  */
59333  (__pyx_v_f[0]) = 0x78;
59334 
59335  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":872
59336  * while offset[0] < new_offset:
59337  * f[0] = 120 # "x"; pad byte
59338  * f += 1 # <<<<<<<<<<<<<<
59339  * offset[0] += 1
59340  *
59341  */
59342  __pyx_v_f = (__pyx_v_f + 1);
59343 
59344  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":873
59345  * f[0] = 120 # "x"; pad byte
59346  * f += 1
59347  * offset[0] += 1 # <<<<<<<<<<<<<<
59348  *
59349  * offset[0] += child.itemsize
59350  */
59351  __pyx_t_8 = 0;
59352  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
59353  }
59354 
59355  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":875
59356  * offset[0] += 1
59357  *
59358  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
59359  *
59360  * if not PyDataType_HASFIELDS(child):
59361  */
59362  __pyx_t_8 = 0;
59363  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
59364 
59365  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
59366  * offset[0] += child.itemsize
59367  *
59368  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
59369  * t = child.type_num
59370  * if end - f < 5:
59371  */
59372  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
59373  if (__pyx_t_6) {
59374 
59375  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":878
59376  *
59377  * if not PyDataType_HASFIELDS(child):
59378  * t = child.type_num # <<<<<<<<<<<<<<
59379  * if end - f < 5:
59380  * raise RuntimeError(u"Format string allocated too short.")
59381  */
59382  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 878, __pyx_L1_error)
59383  __Pyx_GOTREF(__pyx_t_4);
59384  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
59385  __pyx_t_4 = 0;
59386 
59387  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
59388  * if not PyDataType_HASFIELDS(child):
59389  * t = child.type_num
59390  * if end - f < 5: # <<<<<<<<<<<<<<
59391  * raise RuntimeError(u"Format string allocated too short.")
59392  *
59393  */
59394  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
59395  if (unlikely(__pyx_t_6)) {
59396 
59397  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
59398  * t = child.type_num
59399  * if end - f < 5:
59400  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
59401  *
59402  * # Until ticket #99 is fixed, use integers to avoid warnings
59403  */
59404  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 880, __pyx_L1_error)
59405  __Pyx_GOTREF(__pyx_t_4);
59406  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
59407  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59408  __PYX_ERR(3, 880, __pyx_L1_error)
59409 
59410  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":879
59411  * if not PyDataType_HASFIELDS(child):
59412  * t = child.type_num
59413  * if end - f < 5: # <<<<<<<<<<<<<<
59414  * raise RuntimeError(u"Format string allocated too short.")
59415  *
59416  */
59417  }
59418 
59419  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":883
59420  *
59421  * # Until ticket #99 is fixed, use integers to avoid warnings
59422  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
59423  * elif t == NPY_UBYTE: f[0] = 66 #"B"
59424  * elif t == NPY_SHORT: f[0] = 104 #"h"
59425  */
59426  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 883, __pyx_L1_error)
59427  __Pyx_GOTREF(__pyx_t_4);
59428  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 883, __pyx_L1_error)
59429  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59430  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 883, __pyx_L1_error)
59431  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59432  if (__pyx_t_6) {
59433  (__pyx_v_f[0]) = 98;
59434  goto __pyx_L15;
59435  }
59436 
59437  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":884
59438  * # Until ticket #99 is fixed, use integers to avoid warnings
59439  * if t == NPY_BYTE: f[0] = 98 #"b"
59440  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
59441  * elif t == NPY_SHORT: f[0] = 104 #"h"
59442  * elif t == NPY_USHORT: f[0] = 72 #"H"
59443  */
59444  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 884, __pyx_L1_error)
59445  __Pyx_GOTREF(__pyx_t_3);
59446  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 884, __pyx_L1_error)
59447  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59448  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 884, __pyx_L1_error)
59449  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59450  if (__pyx_t_6) {
59451  (__pyx_v_f[0]) = 66;
59452  goto __pyx_L15;
59453  }
59454 
59455  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":885
59456  * if t == NPY_BYTE: f[0] = 98 #"b"
59457  * elif t == NPY_UBYTE: f[0] = 66 #"B"
59458  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
59459  * elif t == NPY_USHORT: f[0] = 72 #"H"
59460  * elif t == NPY_INT: f[0] = 105 #"i"
59461  */
59462  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 885, __pyx_L1_error)
59463  __Pyx_GOTREF(__pyx_t_4);
59464  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 885, __pyx_L1_error)
59465  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59466  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 885, __pyx_L1_error)
59467  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59468  if (__pyx_t_6) {
59469  (__pyx_v_f[0]) = 0x68;
59470  goto __pyx_L15;
59471  }
59472 
59473  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":886
59474  * elif t == NPY_UBYTE: f[0] = 66 #"B"
59475  * elif t == NPY_SHORT: f[0] = 104 #"h"
59476  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
59477  * elif t == NPY_INT: f[0] = 105 #"i"
59478  * elif t == NPY_UINT: f[0] = 73 #"I"
59479  */
59480  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 886, __pyx_L1_error)
59481  __Pyx_GOTREF(__pyx_t_3);
59482  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 886, __pyx_L1_error)
59483  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59484  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 886, __pyx_L1_error)
59485  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59486  if (__pyx_t_6) {
59487  (__pyx_v_f[0]) = 72;
59488  goto __pyx_L15;
59489  }
59490 
59491  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":887
59492  * elif t == NPY_SHORT: f[0] = 104 #"h"
59493  * elif t == NPY_USHORT: f[0] = 72 #"H"
59494  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
59495  * elif t == NPY_UINT: f[0] = 73 #"I"
59496  * elif t == NPY_LONG: f[0] = 108 #"l"
59497  */
59498  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 887, __pyx_L1_error)
59499  __Pyx_GOTREF(__pyx_t_4);
59500  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 887, __pyx_L1_error)
59501  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59502  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 887, __pyx_L1_error)
59503  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59504  if (__pyx_t_6) {
59505  (__pyx_v_f[0]) = 0x69;
59506  goto __pyx_L15;
59507  }
59508 
59509  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":888
59510  * elif t == NPY_USHORT: f[0] = 72 #"H"
59511  * elif t == NPY_INT: f[0] = 105 #"i"
59512  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
59513  * elif t == NPY_LONG: f[0] = 108 #"l"
59514  * elif t == NPY_ULONG: f[0] = 76 #"L"
59515  */
59516  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 888, __pyx_L1_error)
59517  __Pyx_GOTREF(__pyx_t_3);
59518  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 888, __pyx_L1_error)
59519  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59520  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 888, __pyx_L1_error)
59521  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59522  if (__pyx_t_6) {
59523  (__pyx_v_f[0]) = 73;
59524  goto __pyx_L15;
59525  }
59526 
59527  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":889
59528  * elif t == NPY_INT: f[0] = 105 #"i"
59529  * elif t == NPY_UINT: f[0] = 73 #"I"
59530  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
59531  * elif t == NPY_ULONG: f[0] = 76 #"L"
59532  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
59533  */
59534  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
59535  __Pyx_GOTREF(__pyx_t_4);
59536  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 889, __pyx_L1_error)
59537  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59538  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 889, __pyx_L1_error)
59539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59540  if (__pyx_t_6) {
59541  (__pyx_v_f[0]) = 0x6C;
59542  goto __pyx_L15;
59543  }
59544 
59545  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":890
59546  * elif t == NPY_UINT: f[0] = 73 #"I"
59547  * elif t == NPY_LONG: f[0] = 108 #"l"
59548  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
59549  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
59550  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
59551  */
59552  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 890, __pyx_L1_error)
59553  __Pyx_GOTREF(__pyx_t_3);
59554  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 890, __pyx_L1_error)
59555  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59556  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 890, __pyx_L1_error)
59557  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59558  if (__pyx_t_6) {
59559  (__pyx_v_f[0]) = 76;
59560  goto __pyx_L15;
59561  }
59562 
59563  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":891
59564  * elif t == NPY_LONG: f[0] = 108 #"l"
59565  * elif t == NPY_ULONG: f[0] = 76 #"L"
59566  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
59567  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
59568  * elif t == NPY_FLOAT: f[0] = 102 #"f"
59569  */
59570  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
59571  __Pyx_GOTREF(__pyx_t_4);
59572  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
59573  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59574  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
59575  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59576  if (__pyx_t_6) {
59577  (__pyx_v_f[0]) = 0x71;
59578  goto __pyx_L15;
59579  }
59580 
59581  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":892
59582  * elif t == NPY_ULONG: f[0] = 76 #"L"
59583  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
59584  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
59585  * elif t == NPY_FLOAT: f[0] = 102 #"f"
59586  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
59587  */
59588  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
59589  __Pyx_GOTREF(__pyx_t_3);
59590  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
59591  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59592  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 892, __pyx_L1_error)
59593  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59594  if (__pyx_t_6) {
59595  (__pyx_v_f[0]) = 81;
59596  goto __pyx_L15;
59597  }
59598 
59599  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":893
59600  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
59601  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
59602  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
59603  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
59604  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
59605  */
59606  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 893, __pyx_L1_error)
59607  __Pyx_GOTREF(__pyx_t_4);
59608  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 893, __pyx_L1_error)
59609  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59610  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 893, __pyx_L1_error)
59611  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59612  if (__pyx_t_6) {
59613  (__pyx_v_f[0]) = 0x66;
59614  goto __pyx_L15;
59615  }
59616 
59617  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":894
59618  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
59619  * elif t == NPY_FLOAT: f[0] = 102 #"f"
59620  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
59621  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
59622  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
59623  */
59624  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 894, __pyx_L1_error)
59625  __Pyx_GOTREF(__pyx_t_3);
59626  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 894, __pyx_L1_error)
59627  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59628  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 894, __pyx_L1_error)
59629  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59630  if (__pyx_t_6) {
59631  (__pyx_v_f[0]) = 0x64;
59632  goto __pyx_L15;
59633  }
59634 
59635  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":895
59636  * elif t == NPY_FLOAT: f[0] = 102 #"f"
59637  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
59638  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
59639  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
59640  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
59641  */
59642  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 895, __pyx_L1_error)
59643  __Pyx_GOTREF(__pyx_t_4);
59644  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 895, __pyx_L1_error)
59645  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59646  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
59647  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59648  if (__pyx_t_6) {
59649  (__pyx_v_f[0]) = 0x67;
59650  goto __pyx_L15;
59651  }
59652 
59653  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":896
59654  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
59655  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
59656  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
59657  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
59658  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
59659  */
59660  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 896, __pyx_L1_error)
59661  __Pyx_GOTREF(__pyx_t_3);
59662  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 896, __pyx_L1_error)
59663  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59664  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 896, __pyx_L1_error)
59665  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59666  if (__pyx_t_6) {
59667  (__pyx_v_f[0]) = 90;
59668  (__pyx_v_f[1]) = 0x66;
59669  __pyx_v_f = (__pyx_v_f + 1);
59670  goto __pyx_L15;
59671  }
59672 
59673  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":897
59674  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
59675  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
59676  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
59677  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
59678  * elif t == NPY_OBJECT: f[0] = 79 #"O"
59679  */
59680  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 897, __pyx_L1_error)
59681  __Pyx_GOTREF(__pyx_t_4);
59682  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 897, __pyx_L1_error)
59683  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59684  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 897, __pyx_L1_error)
59685  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59686  if (__pyx_t_6) {
59687  (__pyx_v_f[0]) = 90;
59688  (__pyx_v_f[1]) = 0x64;
59689  __pyx_v_f = (__pyx_v_f + 1);
59690  goto __pyx_L15;
59691  }
59692 
59693  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":898
59694  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
59695  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
59696  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
59697  * elif t == NPY_OBJECT: f[0] = 79 #"O"
59698  * else:
59699  */
59700  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 898, __pyx_L1_error)
59701  __Pyx_GOTREF(__pyx_t_3);
59702  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 898, __pyx_L1_error)
59703  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59704  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 898, __pyx_L1_error)
59705  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59706  if (__pyx_t_6) {
59707  (__pyx_v_f[0]) = 90;
59708  (__pyx_v_f[1]) = 0x67;
59709  __pyx_v_f = (__pyx_v_f + 1);
59710  goto __pyx_L15;
59711  }
59712 
59713  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":899
59714  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
59715  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
59716  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
59717  * else:
59718  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
59719  */
59720  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 899, __pyx_L1_error)
59721  __Pyx_GOTREF(__pyx_t_4);
59722  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 899, __pyx_L1_error)
59723  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59724  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 899, __pyx_L1_error)
59725  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59726  if (likely(__pyx_t_6)) {
59727  (__pyx_v_f[0]) = 79;
59728  goto __pyx_L15;
59729  }
59730 
59731  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":901
59732  * elif t == NPY_OBJECT: f[0] = 79 #"O"
59733  * else:
59734  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
59735  * f += 1
59736  * else:
59737  */
59738  /*else*/ {
59739  __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 901, __pyx_L1_error)
59740  __Pyx_GOTREF(__pyx_t_3);
59741  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 901, __pyx_L1_error)
59742  __Pyx_GOTREF(__pyx_t_4);
59743  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59744  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
59745  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59746  __PYX_ERR(3, 901, __pyx_L1_error)
59747  }
59748  __pyx_L15:;
59749 
59750  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":902
59751  * else:
59752  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
59753  * f += 1 # <<<<<<<<<<<<<<
59754  * else:
59755  * # Cython ignores struct boundary information ("T{...}"),
59756  */
59757  __pyx_v_f = (__pyx_v_f + 1);
59758 
59759  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":877
59760  * offset[0] += child.itemsize
59761  *
59762  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
59763  * t = child.type_num
59764  * if end - f < 5:
59765  */
59766  goto __pyx_L13;
59767  }
59768 
59769  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":906
59770  * # Cython ignores struct boundary information ("T{...}"),
59771  * # so don't output it
59772  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
59773  * return f
59774  *
59775  */
59776  /*else*/ {
59777  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 906, __pyx_L1_error)
59778  __pyx_v_f = __pyx_t_9;
59779  }
59780  __pyx_L13:;
59781 
59782  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
59783  * cdef tuple fields
59784  *
59785  * for childname in descr.names: # <<<<<<<<<<<<<<
59786  * fields = descr.fields[childname]
59787  * child, new_offset = fields
59788  */
59789  }
59790  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59791 
59792  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":907
59793  * # so don't output it
59794  * f = _util_dtypestring(child, f, end, offset)
59795  * return f # <<<<<<<<<<<<<<
59796  *
59797  *
59798  */
59799  __pyx_r = __pyx_v_f;
59800  goto __pyx_L0;
59801 
59802  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
59803  * return ()
59804  *
59805  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
59806  * # Recursive utility function used in __getbuffer__ to get format
59807  * # string. The new location in the format string is returned.
59808  */
59809 
59810  /* function exit code */
59811  __pyx_L1_error:;
59812  __Pyx_XDECREF(__pyx_t_1);
59813  __Pyx_XDECREF(__pyx_t_3);
59814  __Pyx_XDECREF(__pyx_t_4);
59815  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
59816  __pyx_r = NULL;
59817  __pyx_L0:;
59818  __Pyx_XDECREF((PyObject *)__pyx_v_child);
59819  __Pyx_XDECREF(__pyx_v_fields);
59820  __Pyx_XDECREF(__pyx_v_childname);
59821  __Pyx_XDECREF(__pyx_v_new_offset);
59822  __Pyx_XDECREF(__pyx_v_t);
59823  __Pyx_RefNannyFinishContext();
59824  return __pyx_r;
59825 }
59826 
59827 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
59828  * int _import_umath() except -1
59829  *
59830  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
59831  * Py_INCREF(base) # important to do this before stealing the reference below!
59832  * PyArray_SetBaseObject(arr, base)
59833  */
59834 
59835 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
59836  __Pyx_RefNannyDeclarations
59837  __Pyx_RefNannySetupContext("set_array_base", 0);
59838 
59839  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1023
59840  *
59841  * cdef inline void set_array_base(ndarray arr, object base):
59842  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
59843  * PyArray_SetBaseObject(arr, base)
59844  *
59845  */
59846  Py_INCREF(__pyx_v_base);
59847 
59848  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1024
59849  * cdef inline void set_array_base(ndarray arr, object base):
59850  * Py_INCREF(base) # important to do this before stealing the reference below!
59851  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
59852  *
59853  * cdef inline object get_array_base(ndarray arr):
59854  */
59855  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
59856 
59857  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1022
59858  * int _import_umath() except -1
59859  *
59860  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
59861  * Py_INCREF(base) # important to do this before stealing the reference below!
59862  * PyArray_SetBaseObject(arr, base)
59863  */
59864 
59865  /* function exit code */
59866  __Pyx_RefNannyFinishContext();
59867 }
59868 
59869 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
59870  * PyArray_SetBaseObject(arr, base)
59871  *
59872  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
59873  * base = PyArray_BASE(arr)
59874  * if base is NULL:
59875  */
59876 
59877 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
59878  PyObject *__pyx_v_base;
59879  PyObject *__pyx_r = NULL;
59880  __Pyx_RefNannyDeclarations
59881  int __pyx_t_1;
59882  __Pyx_RefNannySetupContext("get_array_base", 0);
59883 
59884  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1027
59885  *
59886  * cdef inline object get_array_base(ndarray arr):
59887  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
59888  * if base is NULL:
59889  * return None
59890  */
59891  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
59892 
59893  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
59894  * cdef inline object get_array_base(ndarray arr):
59895  * base = PyArray_BASE(arr)
59896  * if base is NULL: # <<<<<<<<<<<<<<
59897  * return None
59898  * return <object>base
59899  */
59900  __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
59901  if (__pyx_t_1) {
59902 
59903  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1029
59904  * base = PyArray_BASE(arr)
59905  * if base is NULL:
59906  * return None # <<<<<<<<<<<<<<
59907  * return <object>base
59908  *
59909  */
59910  __Pyx_XDECREF(__pyx_r);
59911  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59912  goto __pyx_L0;
59913 
59914  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1028
59915  * cdef inline object get_array_base(ndarray arr):
59916  * base = PyArray_BASE(arr)
59917  * if base is NULL: # <<<<<<<<<<<<<<
59918  * return None
59919  * return <object>base
59920  */
59921  }
59922 
59923  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1030
59924  * if base is NULL:
59925  * return None
59926  * return <object>base # <<<<<<<<<<<<<<
59927  *
59928  * # Versions of the import_* functions which are more suitable for
59929  */
59930  __Pyx_XDECREF(__pyx_r);
59931  __Pyx_INCREF(((PyObject *)__pyx_v_base));
59932  __pyx_r = ((PyObject *)__pyx_v_base);
59933  goto __pyx_L0;
59934 
59935  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1026
59936  * PyArray_SetBaseObject(arr, base)
59937  *
59938  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
59939  * base = PyArray_BASE(arr)
59940  * if base is NULL:
59941  */
59942 
59943  /* function exit code */
59944  __pyx_L0:;
59945  __Pyx_XGIVEREF(__pyx_r);
59946  __Pyx_RefNannyFinishContext();
59947  return __pyx_r;
59948 }
59949 
59950 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
59951  * # Versions of the import_* functions which are more suitable for
59952  * # Cython code.
59953  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
59954  * try:
59955  * _import_array()
59956  */
59957 
59958 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
59959  int __pyx_r;
59960  __Pyx_RefNannyDeclarations
59961  PyObject *__pyx_t_1 = NULL;
59962  PyObject *__pyx_t_2 = NULL;
59963  PyObject *__pyx_t_3 = NULL;
59964  int __pyx_t_4;
59965  PyObject *__pyx_t_5 = NULL;
59966  PyObject *__pyx_t_6 = NULL;
59967  PyObject *__pyx_t_7 = NULL;
59968  PyObject *__pyx_t_8 = NULL;
59969  __Pyx_RefNannySetupContext("import_array", 0);
59970 
59971  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
59972  * # Cython code.
59973  * cdef inline int import_array() except -1:
59974  * try: # <<<<<<<<<<<<<<
59975  * _import_array()
59976  * except Exception:
59977  */
59978  {
59979  __Pyx_PyThreadState_declare
59980  __Pyx_PyThreadState_assign
59981  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
59982  __Pyx_XGOTREF(__pyx_t_1);
59983  __Pyx_XGOTREF(__pyx_t_2);
59984  __Pyx_XGOTREF(__pyx_t_3);
59985  /*try:*/ {
59986 
59987  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1036
59988  * cdef inline int import_array() except -1:
59989  * try:
59990  * _import_array() # <<<<<<<<<<<<<<
59991  * except Exception:
59992  * raise ImportError("numpy.core.multiarray failed to import")
59993  */
59994  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1036, __pyx_L3_error)
59995 
59996  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
59997  * # Cython code.
59998  * cdef inline int import_array() except -1:
59999  * try: # <<<<<<<<<<<<<<
60000  * _import_array()
60001  * except Exception:
60002  */
60003  }
60004  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
60005  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
60006  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
60007  goto __pyx_L8_try_end;
60008  __pyx_L3_error:;
60009 
60010  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1037
60011  * try:
60012  * _import_array()
60013  * except Exception: # <<<<<<<<<<<<<<
60014  * raise ImportError("numpy.core.multiarray failed to import")
60015  *
60016  */
60017  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
60018  if (__pyx_t_4) {
60019  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
60020  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1037, __pyx_L5_except_error)
60021  __Pyx_GOTREF(__pyx_t_5);
60022  __Pyx_GOTREF(__pyx_t_6);
60023  __Pyx_GOTREF(__pyx_t_7);
60024 
60025  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
60026  * _import_array()
60027  * except Exception:
60028  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
60029  *
60030  * cdef inline int import_umath() except -1:
60031  */
60032  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1038, __pyx_L5_except_error)
60033  __Pyx_GOTREF(__pyx_t_8);
60034  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
60035  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
60036  __PYX_ERR(3, 1038, __pyx_L5_except_error)
60037  }
60038  goto __pyx_L5_except_error;
60039  __pyx_L5_except_error:;
60040 
60041  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1035
60042  * # Cython code.
60043  * cdef inline int import_array() except -1:
60044  * try: # <<<<<<<<<<<<<<
60045  * _import_array()
60046  * except Exception:
60047  */
60048  __Pyx_XGIVEREF(__pyx_t_1);
60049  __Pyx_XGIVEREF(__pyx_t_2);
60050  __Pyx_XGIVEREF(__pyx_t_3);
60051  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
60052  goto __pyx_L1_error;
60053  __pyx_L8_try_end:;
60054  }
60055 
60056  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1034
60057  * # Versions of the import_* functions which are more suitable for
60058  * # Cython code.
60059  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
60060  * try:
60061  * _import_array()
60062  */
60063 
60064  /* function exit code */
60065  __pyx_r = 0;
60066  goto __pyx_L0;
60067  __pyx_L1_error:;
60068  __Pyx_XDECREF(__pyx_t_5);
60069  __Pyx_XDECREF(__pyx_t_6);
60070  __Pyx_XDECREF(__pyx_t_7);
60071  __Pyx_XDECREF(__pyx_t_8);
60072  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
60073  __pyx_r = -1;
60074  __pyx_L0:;
60075  __Pyx_RefNannyFinishContext();
60076  return __pyx_r;
60077 }
60078 
60079 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
60080  * raise ImportError("numpy.core.multiarray failed to import")
60081  *
60082  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
60083  * try:
60084  * _import_umath()
60085  */
60086 
60087 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
60088  int __pyx_r;
60089  __Pyx_RefNannyDeclarations
60090  PyObject *__pyx_t_1 = NULL;
60091  PyObject *__pyx_t_2 = NULL;
60092  PyObject *__pyx_t_3 = NULL;
60093  int __pyx_t_4;
60094  PyObject *__pyx_t_5 = NULL;
60095  PyObject *__pyx_t_6 = NULL;
60096  PyObject *__pyx_t_7 = NULL;
60097  PyObject *__pyx_t_8 = NULL;
60098  __Pyx_RefNannySetupContext("import_umath", 0);
60099 
60100  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
60101  *
60102  * cdef inline int import_umath() except -1:
60103  * try: # <<<<<<<<<<<<<<
60104  * _import_umath()
60105  * except Exception:
60106  */
60107  {
60108  __Pyx_PyThreadState_declare
60109  __Pyx_PyThreadState_assign
60110  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
60111  __Pyx_XGOTREF(__pyx_t_1);
60112  __Pyx_XGOTREF(__pyx_t_2);
60113  __Pyx_XGOTREF(__pyx_t_3);
60114  /*try:*/ {
60115 
60116  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1042
60117  * cdef inline int import_umath() except -1:
60118  * try:
60119  * _import_umath() # <<<<<<<<<<<<<<
60120  * except Exception:
60121  * raise ImportError("numpy.core.umath failed to import")
60122  */
60123  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1042, __pyx_L3_error)
60124 
60125  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
60126  *
60127  * cdef inline int import_umath() except -1:
60128  * try: # <<<<<<<<<<<<<<
60129  * _import_umath()
60130  * except Exception:
60131  */
60132  }
60133  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
60134  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
60135  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
60136  goto __pyx_L8_try_end;
60137  __pyx_L3_error:;
60138 
60139  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1043
60140  * try:
60141  * _import_umath()
60142  * except Exception: # <<<<<<<<<<<<<<
60143  * raise ImportError("numpy.core.umath failed to import")
60144  *
60145  */
60146  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
60147  if (__pyx_t_4) {
60148  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
60149  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1043, __pyx_L5_except_error)
60150  __Pyx_GOTREF(__pyx_t_5);
60151  __Pyx_GOTREF(__pyx_t_6);
60152  __Pyx_GOTREF(__pyx_t_7);
60153 
60154  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
60155  * _import_umath()
60156  * except Exception:
60157  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
60158  *
60159  * cdef inline int import_ufunc() except -1:
60160  */
60161  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1044, __pyx_L5_except_error)
60162  __Pyx_GOTREF(__pyx_t_8);
60163  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
60164  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
60165  __PYX_ERR(3, 1044, __pyx_L5_except_error)
60166  }
60167  goto __pyx_L5_except_error;
60168  __pyx_L5_except_error:;
60169 
60170  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1041
60171  *
60172  * cdef inline int import_umath() except -1:
60173  * try: # <<<<<<<<<<<<<<
60174  * _import_umath()
60175  * except Exception:
60176  */
60177  __Pyx_XGIVEREF(__pyx_t_1);
60178  __Pyx_XGIVEREF(__pyx_t_2);
60179  __Pyx_XGIVEREF(__pyx_t_3);
60180  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
60181  goto __pyx_L1_error;
60182  __pyx_L8_try_end:;
60183  }
60184 
60185  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1040
60186  * raise ImportError("numpy.core.multiarray failed to import")
60187  *
60188  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
60189  * try:
60190  * _import_umath()
60191  */
60192 
60193  /* function exit code */
60194  __pyx_r = 0;
60195  goto __pyx_L0;
60196  __pyx_L1_error:;
60197  __Pyx_XDECREF(__pyx_t_5);
60198  __Pyx_XDECREF(__pyx_t_6);
60199  __Pyx_XDECREF(__pyx_t_7);
60200  __Pyx_XDECREF(__pyx_t_8);
60201  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
60202  __pyx_r = -1;
60203  __pyx_L0:;
60204  __Pyx_RefNannyFinishContext();
60205  return __pyx_r;
60206 }
60207 
60208 /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
60209  * raise ImportError("numpy.core.umath failed to import")
60210  *
60211  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
60212  * try:
60213  * _import_umath()
60214  */
60215 
60216 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
60217  int __pyx_r;
60218  __Pyx_RefNannyDeclarations
60219  PyObject *__pyx_t_1 = NULL;
60220  PyObject *__pyx_t_2 = NULL;
60221  PyObject *__pyx_t_3 = NULL;
60222  int __pyx_t_4;
60223  PyObject *__pyx_t_5 = NULL;
60224  PyObject *__pyx_t_6 = NULL;
60225  PyObject *__pyx_t_7 = NULL;
60226  PyObject *__pyx_t_8 = NULL;
60227  __Pyx_RefNannySetupContext("import_ufunc", 0);
60228 
60229  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
60230  *
60231  * cdef inline int import_ufunc() except -1:
60232  * try: # <<<<<<<<<<<<<<
60233  * _import_umath()
60234  * except Exception:
60235  */
60236  {
60237  __Pyx_PyThreadState_declare
60238  __Pyx_PyThreadState_assign
60239  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
60240  __Pyx_XGOTREF(__pyx_t_1);
60241  __Pyx_XGOTREF(__pyx_t_2);
60242  __Pyx_XGOTREF(__pyx_t_3);
60243  /*try:*/ {
60244 
60245  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1048
60246  * cdef inline int import_ufunc() except -1:
60247  * try:
60248  * _import_umath() # <<<<<<<<<<<<<<
60249  * except Exception:
60250  * raise ImportError("numpy.core.umath failed to import")
60251  */
60252  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1048, __pyx_L3_error)
60253 
60254  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
60255  *
60256  * cdef inline int import_ufunc() except -1:
60257  * try: # <<<<<<<<<<<<<<
60258  * _import_umath()
60259  * except Exception:
60260  */
60261  }
60262  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
60263  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
60264  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
60265  goto __pyx_L8_try_end;
60266  __pyx_L3_error:;
60267 
60268  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1049
60269  * try:
60270  * _import_umath()
60271  * except Exception: # <<<<<<<<<<<<<<
60272  * raise ImportError("numpy.core.umath failed to import")
60273  */
60274  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
60275  if (__pyx_t_4) {
60276  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
60277  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1049, __pyx_L5_except_error)
60278  __Pyx_GOTREF(__pyx_t_5);
60279  __Pyx_GOTREF(__pyx_t_6);
60280  __Pyx_GOTREF(__pyx_t_7);
60281 
60282  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1050
60283  * _import_umath()
60284  * except Exception:
60285  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
60286  */
60287  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1050, __pyx_L5_except_error)
60288  __Pyx_GOTREF(__pyx_t_8);
60289  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
60290  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
60291  __PYX_ERR(3, 1050, __pyx_L5_except_error)
60292  }
60293  goto __pyx_L5_except_error;
60294  __pyx_L5_except_error:;
60295 
60296  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1047
60297  *
60298  * cdef inline int import_ufunc() except -1:
60299  * try: # <<<<<<<<<<<<<<
60300  * _import_umath()
60301  * except Exception:
60302  */
60303  __Pyx_XGIVEREF(__pyx_t_1);
60304  __Pyx_XGIVEREF(__pyx_t_2);
60305  __Pyx_XGIVEREF(__pyx_t_3);
60306  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
60307  goto __pyx_L1_error;
60308  __pyx_L8_try_end:;
60309  }
60310 
60311  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1046
60312  * raise ImportError("numpy.core.umath failed to import")
60313  *
60314  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
60315  * try:
60316  * _import_umath()
60317  */
60318 
60319  /* function exit code */
60320  __pyx_r = 0;
60321  goto __pyx_L0;
60322  __pyx_L1_error:;
60323  __Pyx_XDECREF(__pyx_t_5);
60324  __Pyx_XDECREF(__pyx_t_6);
60325  __Pyx_XDECREF(__pyx_t_7);
60326  __Pyx_XDECREF(__pyx_t_8);
60327  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
60328  __pyx_r = -1;
60329  __pyx_L0:;
60330  __Pyx_RefNannyFinishContext();
60331  return __pyx_r;
60332 }
60333 
60334 /* "carray.to_py":112
60335  *
60336  * @cname("__Pyx_carray_to_py_double")
60337  * cdef inline list __Pyx_carray_to_py_double(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
60338  * cdef size_t i
60339  * cdef object value
60340  */
60341 
60342 static CYTHON_INLINE PyObject *__Pyx_carray_to_py_double(double *__pyx_v_v, Py_ssize_t __pyx_v_length) {
60343  size_t __pyx_v_i;
60344  PyObject *__pyx_v_value = 0;
60345  PyObject *__pyx_v_l = NULL;
60346  PyObject *__pyx_r = NULL;
60347  __Pyx_RefNannyDeclarations
60348  PyObject *__pyx_t_1 = NULL;
60349  PyObject *__pyx_t_2 = NULL;
60350  PyObject *__pyx_t_3 = NULL;
60351  PyObject *__pyx_t_4 = NULL;
60352  Py_ssize_t __pyx_t_5;
60353  PyObject *(*__pyx_t_6)(PyObject *);
60354  size_t __pyx_t_7;
60355  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_double", 0);
60356 
60357  /* "carray.to_py":115
60358  * cdef size_t i
60359  * cdef object value
60360  * l = PyList_New(length) # <<<<<<<<<<<<<<
60361  * for i in range(<size_t>length):
60362  * value = v[i]
60363  */
60364  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error)
60365  __Pyx_GOTREF(__pyx_t_1);
60366  __pyx_v_l = ((PyObject*)__pyx_t_1);
60367  __pyx_t_1 = 0;
60368 
60369  /* "carray.to_py":116
60370  * cdef object value
60371  * l = PyList_New(length)
60372  * for i in range(<size_t>length): # <<<<<<<<<<<<<<
60373  * value = v[i]
60374  * Py_INCREF(value)
60375  */
60376  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error)
60377  __Pyx_GOTREF(__pyx_t_2);
60378  __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_length)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 116, __pyx_L1_error)
60379  __Pyx_GOTREF(__pyx_t_3);
60380  __pyx_t_4 = NULL;
60381  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
60382  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
60383  if (likely(__pyx_t_4)) {
60384  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
60385  __Pyx_INCREF(__pyx_t_4);
60386  __Pyx_INCREF(function);
60387  __Pyx_DECREF_SET(__pyx_t_2, function);
60388  }
60389  }
60390  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
60391  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
60392  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
60393  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error)
60394  __Pyx_GOTREF(__pyx_t_1);
60395  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60396  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
60397  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
60398  __pyx_t_6 = NULL;
60399  } else {
60400  __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 116, __pyx_L1_error)
60401  __Pyx_GOTREF(__pyx_t_2);
60402  __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 116, __pyx_L1_error)
60403  }
60404  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60405  for (;;) {
60406  if (likely(!__pyx_t_6)) {
60407  if (likely(PyList_CheckExact(__pyx_t_2))) {
60408  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
60409  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60410  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 116, __pyx_L1_error)
60411  #else
60412  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error)
60413  __Pyx_GOTREF(__pyx_t_1);
60414  #endif
60415  } else {
60416  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
60417  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60418  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 116, __pyx_L1_error)
60419  #else
60420  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 116, __pyx_L1_error)
60421  __Pyx_GOTREF(__pyx_t_1);
60422  #endif
60423  }
60424  } else {
60425  __pyx_t_1 = __pyx_t_6(__pyx_t_2);
60426  if (unlikely(!__pyx_t_1)) {
60427  PyObject* exc_type = PyErr_Occurred();
60428  if (exc_type) {
60429  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
60430  else __PYX_ERR(1, 116, __pyx_L1_error)
60431  }
60432  break;
60433  }
60434  __Pyx_GOTREF(__pyx_t_1);
60435  }
60436  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 116, __pyx_L1_error)
60437  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60438  __pyx_v_i = __pyx_t_7;
60439 
60440  /* "carray.to_py":117
60441  * l = PyList_New(length)
60442  * for i in range(<size_t>length):
60443  * value = v[i] # <<<<<<<<<<<<<<
60444  * Py_INCREF(value)
60445  * PyList_SET_ITEM(l, i, value)
60446  */
60447  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
60448  __Pyx_GOTREF(__pyx_t_1);
60449  __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
60450  __pyx_t_1 = 0;
60451 
60452  /* "carray.to_py":118
60453  * for i in range(<size_t>length):
60454  * value = v[i]
60455  * Py_INCREF(value) # <<<<<<<<<<<<<<
60456  * PyList_SET_ITEM(l, i, value)
60457  * return l
60458  */
60459  Py_INCREF(__pyx_v_value);
60460 
60461  /* "carray.to_py":119
60462  * value = v[i]
60463  * Py_INCREF(value)
60464  * PyList_SET_ITEM(l, i, value) # <<<<<<<<<<<<<<
60465  * return l
60466  *
60467  */
60468  PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
60469 
60470  /* "carray.to_py":116
60471  * cdef object value
60472  * l = PyList_New(length)
60473  * for i in range(<size_t>length): # <<<<<<<<<<<<<<
60474  * value = v[i]
60475  * Py_INCREF(value)
60476  */
60477  }
60478  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60479 
60480  /* "carray.to_py":120
60481  * Py_INCREF(value)
60482  * PyList_SET_ITEM(l, i, value)
60483  * return l # <<<<<<<<<<<<<<
60484  *
60485  *
60486  */
60487  __Pyx_XDECREF(__pyx_r);
60488  __Pyx_INCREF(__pyx_v_l);
60489  __pyx_r = __pyx_v_l;
60490  goto __pyx_L0;
60491 
60492  /* "carray.to_py":112
60493  *
60494  * @cname("__Pyx_carray_to_py_double")
60495  * cdef inline list __Pyx_carray_to_py_double(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
60496  * cdef size_t i
60497  * cdef object value
60498  */
60499 
60500  /* function exit code */
60501  __pyx_L1_error:;
60502  __Pyx_XDECREF(__pyx_t_1);
60503  __Pyx_XDECREF(__pyx_t_2);
60504  __Pyx_XDECREF(__pyx_t_3);
60505  __Pyx_XDECREF(__pyx_t_4);
60506  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
60507  __pyx_r = 0;
60508  __pyx_L0:;
60509  __Pyx_XDECREF(__pyx_v_value);
60510  __Pyx_XDECREF(__pyx_v_l);
60511  __Pyx_XGIVEREF(__pyx_r);
60512  __Pyx_RefNannyFinishContext();
60513  return __pyx_r;
60514 }
60515 
60516 /* "carray.to_py":124
60517  *
60518  * @cname("__Pyx_carray_to_tuple_double")
60519  * cdef inline tuple __Pyx_carray_to_tuple_double(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
60520  * cdef size_t i
60521  * cdef object value
60522  */
60523 
60524 static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_double(double *__pyx_v_v, Py_ssize_t __pyx_v_length) {
60525  size_t __pyx_v_i;
60526  PyObject *__pyx_v_value = 0;
60527  PyObject *__pyx_v_t = NULL;
60528  PyObject *__pyx_r = NULL;
60529  __Pyx_RefNannyDeclarations
60530  PyObject *__pyx_t_1 = NULL;
60531  PyObject *__pyx_t_2 = NULL;
60532  PyObject *__pyx_t_3 = NULL;
60533  PyObject *__pyx_t_4 = NULL;
60534  Py_ssize_t __pyx_t_5;
60535  PyObject *(*__pyx_t_6)(PyObject *);
60536  size_t __pyx_t_7;
60537  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_double", 0);
60538 
60539  /* "carray.to_py":127
60540  * cdef size_t i
60541  * cdef object value
60542  * t = PyTuple_New(length) # <<<<<<<<<<<<<<
60543  * for i in range(<size_t>length):
60544  * value = v[i]
60545  */
60546  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error)
60547  __Pyx_GOTREF(__pyx_t_1);
60548  __pyx_v_t = ((PyObject*)__pyx_t_1);
60549  __pyx_t_1 = 0;
60550 
60551  /* "carray.to_py":128
60552  * cdef object value
60553  * t = PyTuple_New(length)
60554  * for i in range(<size_t>length): # <<<<<<<<<<<<<<
60555  * value = v[i]
60556  * Py_INCREF(value)
60557  */
60558  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 128, __pyx_L1_error)
60559  __Pyx_GOTREF(__pyx_t_2);
60560  __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_length)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 128, __pyx_L1_error)
60561  __Pyx_GOTREF(__pyx_t_3);
60562  __pyx_t_4 = NULL;
60563  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
60564  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
60565  if (likely(__pyx_t_4)) {
60566  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
60567  __Pyx_INCREF(__pyx_t_4);
60568  __Pyx_INCREF(function);
60569  __Pyx_DECREF_SET(__pyx_t_2, function);
60570  }
60571  }
60572  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
60573  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
60574  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
60575  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error)
60576  __Pyx_GOTREF(__pyx_t_1);
60577  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60578  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
60579  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
60580  __pyx_t_6 = NULL;
60581  } else {
60582  __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 128, __pyx_L1_error)
60583  __Pyx_GOTREF(__pyx_t_2);
60584  __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 128, __pyx_L1_error)
60585  }
60586  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60587  for (;;) {
60588  if (likely(!__pyx_t_6)) {
60589  if (likely(PyList_CheckExact(__pyx_t_2))) {
60590  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
60591  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60592  __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 128, __pyx_L1_error)
60593  #else
60594  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error)
60595  __Pyx_GOTREF(__pyx_t_1);
60596  #endif
60597  } else {
60598  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
60599  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
60600  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 128, __pyx_L1_error)
60601  #else
60602  __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 128, __pyx_L1_error)
60603  __Pyx_GOTREF(__pyx_t_1);
60604  #endif
60605  }
60606  } else {
60607  __pyx_t_1 = __pyx_t_6(__pyx_t_2);
60608  if (unlikely(!__pyx_t_1)) {
60609  PyObject* exc_type = PyErr_Occurred();
60610  if (exc_type) {
60611  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
60612  else __PYX_ERR(1, 128, __pyx_L1_error)
60613  }
60614  break;
60615  }
60616  __Pyx_GOTREF(__pyx_t_1);
60617  }
60618  __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 128, __pyx_L1_error)
60619  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60620  __pyx_v_i = __pyx_t_7;
60621 
60622  /* "carray.to_py":129
60623  * t = PyTuple_New(length)
60624  * for i in range(<size_t>length):
60625  * value = v[i] # <<<<<<<<<<<<<<
60626  * Py_INCREF(value)
60627  * PyTuple_SET_ITEM(t, i, value)
60628  */
60629  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
60630  __Pyx_GOTREF(__pyx_t_1);
60631  __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
60632  __pyx_t_1 = 0;
60633 
60634  /* "carray.to_py":130
60635  * for i in range(<size_t>length):
60636  * value = v[i]
60637  * Py_INCREF(value) # <<<<<<<<<<<<<<
60638  * PyTuple_SET_ITEM(t, i, value)
60639  * return t
60640  */
60641  Py_INCREF(__pyx_v_value);
60642 
60643  /* "carray.to_py":131
60644  * value = v[i]
60645  * Py_INCREF(value)
60646  * PyTuple_SET_ITEM(t, i, value) # <<<<<<<<<<<<<<
60647  * return t
60648  */
60649  PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
60650 
60651  /* "carray.to_py":128
60652  * cdef object value
60653  * t = PyTuple_New(length)
60654  * for i in range(<size_t>length): # <<<<<<<<<<<<<<
60655  * value = v[i]
60656  * Py_INCREF(value)
60657  */
60658  }
60659  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60660 
60661  /* "carray.to_py":132
60662  * Py_INCREF(value)
60663  * PyTuple_SET_ITEM(t, i, value)
60664  * return t # <<<<<<<<<<<<<<
60665  */
60666  __Pyx_XDECREF(__pyx_r);
60667  __Pyx_INCREF(__pyx_v_t);
60668  __pyx_r = __pyx_v_t;
60669  goto __pyx_L0;
60670 
60671  /* "carray.to_py":124
60672  *
60673  * @cname("__Pyx_carray_to_tuple_double")
60674  * cdef inline tuple __Pyx_carray_to_tuple_double(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
60675  * cdef size_t i
60676  * cdef object value
60677  */
60678 
60679  /* function exit code */
60680  __pyx_L1_error:;
60681  __Pyx_XDECREF(__pyx_t_1);
60682  __Pyx_XDECREF(__pyx_t_2);
60683  __Pyx_XDECREF(__pyx_t_3);
60684  __Pyx_XDECREF(__pyx_t_4);
60685  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
60686  __pyx_r = 0;
60687  __pyx_L0:;
60688  __Pyx_XDECREF(__pyx_v_value);
60689  __Pyx_XDECREF(__pyx_v_t);
60690  __Pyx_XGIVEREF(__pyx_r);
60691  __Pyx_RefNannyFinishContext();
60692  return __pyx_r;
60693 }
60694 
60695 static PyObject *__pyx_tp_new_9WaveTools_SteadyCurrent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
60696  struct __pyx_obj_9WaveTools_SteadyCurrent *p;
60697  PyObject *o;
60698  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
60699  o = (*t->tp_alloc)(t, 0);
60700  } else {
60701  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
60702  }
60703  if (unlikely(!o)) return 0;
60704  p = ((struct __pyx_obj_9WaveTools_SteadyCurrent *)o);
60705  p->U = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60706  return o;
60707 }
60708 
60709 static void __pyx_tp_dealloc_9WaveTools_SteadyCurrent(PyObject *o) {
60710  struct __pyx_obj_9WaveTools_SteadyCurrent *p = (struct __pyx_obj_9WaveTools_SteadyCurrent *)o;
60711  #if CYTHON_USE_TP_FINALIZE
60712  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
60713  if (PyObject_CallFinalizerFromDealloc(o)) return;
60714  }
60715  #endif
60716  PyObject_GC_UnTrack(o);
60717  Py_CLEAR(p->U);
60718  (*Py_TYPE(o)->tp_free)(o);
60719 }
60720 
60721 static int __pyx_tp_traverse_9WaveTools_SteadyCurrent(PyObject *o, visitproc v, void *a) {
60722  int e;
60723  struct __pyx_obj_9WaveTools_SteadyCurrent *p = (struct __pyx_obj_9WaveTools_SteadyCurrent *)o;
60724  if (p->U) {
60725  e = (*v)(((PyObject *)p->U), a); if (e) return e;
60726  }
60727  return 0;
60728 }
60729 
60730 static int __pyx_tp_clear_9WaveTools_SteadyCurrent(PyObject *o) {
60731  PyObject* tmp;
60732  struct __pyx_obj_9WaveTools_SteadyCurrent *p = (struct __pyx_obj_9WaveTools_SteadyCurrent *)o;
60733  tmp = ((PyObject*)p->U);
60734  p->U = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60735  Py_XDECREF(tmp);
60736  return 0;
60737 }
60738 
60739 static PyObject *__pyx_getprop_9WaveTools_13SteadyCurrent_mwl(PyObject *o, CYTHON_UNUSED void *x) {
60740  return __pyx_pw_9WaveTools_13SteadyCurrent_3mwl_1__get__(o);
60741 }
60742 
60743 static int __pyx_setprop_9WaveTools_13SteadyCurrent_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
60744  if (v) {
60745  return __pyx_pw_9WaveTools_13SteadyCurrent_3mwl_3__set__(o, v);
60746  }
60747  else {
60748  PyErr_SetString(PyExc_NotImplementedError, "__del__");
60749  return -1;
60750  }
60751 }
60752 
60753 static PyMethodDef __pyx_methods_9WaveTools_SteadyCurrent[] = {
60754  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13SteadyCurrent_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13SteadyCurrent_2eta},
60755  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13SteadyCurrent_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13SteadyCurrent_4u},
60756  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_13SteadyCurrent_7__reduce_cython__, METH_NOARGS, 0},
60757  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_13SteadyCurrent_9__setstate_cython__, METH_O, 0},
60758  {0, 0, 0, 0}
60759 };
60760 
60761 static struct PyGetSetDef __pyx_getsets_9WaveTools_SteadyCurrent[] = {
60762  {(char *)"mwl", __pyx_getprop_9WaveTools_13SteadyCurrent_mwl, __pyx_setprop_9WaveTools_13SteadyCurrent_mwl, (char *)0, 0},
60763  {0, 0, 0, 0, 0}
60764 };
60765 
60766 static PyTypeObject __pyx_type_9WaveTools_SteadyCurrent = {
60767  PyVarObject_HEAD_INIT(0, 0)
60768  "WaveTools.SteadyCurrent", /*tp_name*/
60769  sizeof(struct __pyx_obj_9WaveTools_SteadyCurrent), /*tp_basicsize*/
60770  0, /*tp_itemsize*/
60771  __pyx_tp_dealloc_9WaveTools_SteadyCurrent, /*tp_dealloc*/
60772  0, /*tp_print*/
60773  0, /*tp_getattr*/
60774  0, /*tp_setattr*/
60775  #if PY_MAJOR_VERSION < 3
60776  0, /*tp_compare*/
60777  #endif
60778  #if PY_MAJOR_VERSION >= 3
60779  0, /*tp_as_async*/
60780  #endif
60781  0, /*tp_repr*/
60782  0, /*tp_as_number*/
60783  0, /*tp_as_sequence*/
60784  0, /*tp_as_mapping*/
60785  0, /*tp_hash*/
60786  0, /*tp_call*/
60787  0, /*tp_str*/
60788  0, /*tp_getattro*/
60789  0, /*tp_setattro*/
60790  0, /*tp_as_buffer*/
60791  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
60792  "\n This class is used for generating a steady current\n\n Parameters\n ----------\n U: numpy.ndarray\n Current velocity in vector form\n mwl : float\n Still water level\n rampTime : float\n Ramp time for current\n\n ", /*tp_doc*/
60793  __pyx_tp_traverse_9WaveTools_SteadyCurrent, /*tp_traverse*/
60794  __pyx_tp_clear_9WaveTools_SteadyCurrent, /*tp_clear*/
60795  0, /*tp_richcompare*/
60796  0, /*tp_weaklistoffset*/
60797  0, /*tp_iter*/
60798  0, /*tp_iternext*/
60799  __pyx_methods_9WaveTools_SteadyCurrent, /*tp_methods*/
60800  0, /*tp_members*/
60801  __pyx_getsets_9WaveTools_SteadyCurrent, /*tp_getset*/
60802  0, /*tp_base*/
60803  0, /*tp_dict*/
60804  0, /*tp_descr_get*/
60805  0, /*tp_descr_set*/
60806  0, /*tp_dictoffset*/
60807  __pyx_pw_9WaveTools_13SteadyCurrent_1__init__, /*tp_init*/
60808  0, /*tp_alloc*/
60809  __pyx_tp_new_9WaveTools_SteadyCurrent, /*tp_new*/
60810  0, /*tp_free*/
60811  0, /*tp_is_gc*/
60812  0, /*tp_bases*/
60813  0, /*tp_mro*/
60814  0, /*tp_cache*/
60815  0, /*tp_subclasses*/
60816  0, /*tp_weaklist*/
60817  0, /*tp_del*/
60818  0, /*tp_version_tag*/
60819  #if PY_VERSION_HEX >= 0x030400a1
60820  0, /*tp_finalize*/
60821  #endif
60822 };
60823 
60824 static PyObject *__pyx_tp_new_9WaveTools_SolitaryWave(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
60825  struct __pyx_obj_9WaveTools_SolitaryWave *p;
60826  PyObject *o;
60827  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
60828  o = (*t->tp_alloc)(t, 0);
60829  } else {
60830  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
60831  }
60832  if (unlikely(!o)) return 0;
60833  p = ((struct __pyx_obj_9WaveTools_SolitaryWave *)o);
60834  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60835  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60836  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60837  p->trans = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60838  return o;
60839 }
60840 
60841 static void __pyx_tp_dealloc_9WaveTools_SolitaryWave(PyObject *o) {
60842  struct __pyx_obj_9WaveTools_SolitaryWave *p = (struct __pyx_obj_9WaveTools_SolitaryWave *)o;
60843  #if CYTHON_USE_TP_FINALIZE
60844  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
60845  if (PyObject_CallFinalizerFromDealloc(o)) return;
60846  }
60847  #endif
60848  PyObject_GC_UnTrack(o);
60849  Py_CLEAR(p->g);
60850  Py_CLEAR(p->waveDir);
60851  Py_CLEAR(p->vDir);
60852  Py_CLEAR(p->trans);
60853  (*Py_TYPE(o)->tp_free)(o);
60854 }
60855 
60856 static int __pyx_tp_traverse_9WaveTools_SolitaryWave(PyObject *o, visitproc v, void *a) {
60857  int e;
60858  struct __pyx_obj_9WaveTools_SolitaryWave *p = (struct __pyx_obj_9WaveTools_SolitaryWave *)o;
60859  if (p->g) {
60860  e = (*v)(((PyObject *)p->g), a); if (e) return e;
60861  }
60862  if (p->waveDir) {
60863  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
60864  }
60865  if (p->vDir) {
60866  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
60867  }
60868  if (p->trans) {
60869  e = (*v)(((PyObject *)p->trans), a); if (e) return e;
60870  }
60871  return 0;
60872 }
60873 
60874 static int __pyx_tp_clear_9WaveTools_SolitaryWave(PyObject *o) {
60875  PyObject* tmp;
60876  struct __pyx_obj_9WaveTools_SolitaryWave *p = (struct __pyx_obj_9WaveTools_SolitaryWave *)o;
60877  tmp = ((PyObject*)p->g);
60878  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60879  Py_XDECREF(tmp);
60880  tmp = ((PyObject*)p->waveDir);
60881  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60882  Py_XDECREF(tmp);
60883  tmp = ((PyObject*)p->vDir);
60884  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60885  Py_XDECREF(tmp);
60886  tmp = ((PyObject*)p->trans);
60887  p->trans = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
60888  Py_XDECREF(tmp);
60889  return 0;
60890 }
60891 
60892 static PyObject *__pyx_getprop_9WaveTools_12SolitaryWave_mwl(PyObject *o, CYTHON_UNUSED void *x) {
60893  return __pyx_pw_9WaveTools_12SolitaryWave_3mwl_1__get__(o);
60894 }
60895 
60896 static int __pyx_setprop_9WaveTools_12SolitaryWave_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
60897  if (v) {
60898  return __pyx_pw_9WaveTools_12SolitaryWave_3mwl_3__set__(o, v);
60899  }
60900  else {
60901  PyErr_SetString(PyExc_NotImplementedError, "__del__");
60902  return -1;
60903  }
60904 }
60905 
60906 static PyObject *__pyx_getprop_9WaveTools_12SolitaryWave_c(PyObject *o, CYTHON_UNUSED void *x) {
60907  return __pyx_pw_9WaveTools_12SolitaryWave_1c_1__get__(o);
60908 }
60909 
60910 static int __pyx_setprop_9WaveTools_12SolitaryWave_c(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
60911  if (v) {
60912  return __pyx_pw_9WaveTools_12SolitaryWave_1c_3__set__(o, v);
60913  }
60914  else {
60915  PyErr_SetString(PyExc_NotImplementedError, "__del__");
60916  return -1;
60917  }
60918 }
60919 
60920 static PyMethodDef __pyx_methods_9WaveTools_SolitaryWave[] = {
60921  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12SolitaryWave_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_12SolitaryWave_2eta},
60922  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_12SolitaryWave_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_12SolitaryWave_4u},
60923  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_12SolitaryWave_7__reduce_cython__, METH_NOARGS, 0},
60924  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_12SolitaryWave_9__setstate_cython__, METH_O, 0},
60925  {0, 0, 0, 0}
60926 };
60927 
60928 static struct PyGetSetDef __pyx_getsets_9WaveTools_SolitaryWave[] = {
60929  {(char *)"mwl", __pyx_getprop_9WaveTools_12SolitaryWave_mwl, __pyx_setprop_9WaveTools_12SolitaryWave_mwl, (char *)0, 0},
60930  {(char *)"c", __pyx_getprop_9WaveTools_12SolitaryWave_c, __pyx_setprop_9WaveTools_12SolitaryWave_c, (char *)0, 0},
60931  {0, 0, 0, 0, 0}
60932 };
60933 
60934 static PyTypeObject __pyx_type_9WaveTools_SolitaryWave = {
60935  PyVarObject_HEAD_INIT(0, 0)
60936  "WaveTools.SolitaryWave", /*tp_name*/
60937  sizeof(struct __pyx_obj_9WaveTools_SolitaryWave), /*tp_basicsize*/
60938  0, /*tp_itemsize*/
60939  __pyx_tp_dealloc_9WaveTools_SolitaryWave, /*tp_dealloc*/
60940  0, /*tp_print*/
60941  0, /*tp_getattr*/
60942  0, /*tp_setattr*/
60943  #if PY_MAJOR_VERSION < 3
60944  0, /*tp_compare*/
60945  #endif
60946  #if PY_MAJOR_VERSION >= 3
60947  0, /*tp_as_async*/
60948  #endif
60949  0, /*tp_repr*/
60950  0, /*tp_as_number*/
60951  0, /*tp_as_sequence*/
60952  0, /*tp_as_mapping*/
60953  0, /*tp_hash*/
60954  0, /*tp_call*/
60955  0, /*tp_str*/
60956  0, /*tp_getattro*/
60957  0, /*tp_setattro*/
60958  0, /*tp_as_buffer*/
60959  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
60960  "\n This class is used for generating 1st order solitary wave\n\n Parameters\n ----------\n waveHeight: float\n Regular wave height\n mwl : float\n Still water level\n depth : float\n Water depth\n g : numpy.ndarray\n Gravitational acceleration vector\n waveDir : numpy.ndarray\n Wave direction in vector form\n trans : numpy.ndarray\n Position vector of the peak \n fast : bool\n Switch for optimised functions\n\n ", /*tp_doc*/
60961  __pyx_tp_traverse_9WaveTools_SolitaryWave, /*tp_traverse*/
60962  __pyx_tp_clear_9WaveTools_SolitaryWave, /*tp_clear*/
60963  0, /*tp_richcompare*/
60964  0, /*tp_weaklistoffset*/
60965  0, /*tp_iter*/
60966  0, /*tp_iternext*/
60967  __pyx_methods_9WaveTools_SolitaryWave, /*tp_methods*/
60968  0, /*tp_members*/
60969  __pyx_getsets_9WaveTools_SolitaryWave, /*tp_getset*/
60970  0, /*tp_base*/
60971  0, /*tp_dict*/
60972  0, /*tp_descr_get*/
60973  0, /*tp_descr_set*/
60974  0, /*tp_dictoffset*/
60975  __pyx_pw_9WaveTools_12SolitaryWave_1__init__, /*tp_init*/
60976  0, /*tp_alloc*/
60977  __pyx_tp_new_9WaveTools_SolitaryWave, /*tp_new*/
60978  0, /*tp_free*/
60979  0, /*tp_is_gc*/
60980  0, /*tp_bases*/
60981  0, /*tp_mro*/
60982  0, /*tp_cache*/
60983  0, /*tp_subclasses*/
60984  0, /*tp_weaklist*/
60985  0, /*tp_del*/
60986  0, /*tp_version_tag*/
60987  #if PY_VERSION_HEX >= 0x030400a1
60988  0, /*tp_finalize*/
60989  #endif
60990 };
60991 static struct __pyx_vtabstruct_9WaveTools_MonochromaticWaves __pyx_vtable_9WaveTools_MonochromaticWaves;
60992 
60993 static PyObject *__pyx_tp_new_9WaveTools_MonochromaticWaves(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
60994  struct __pyx_obj_9WaveTools_MonochromaticWaves *p;
60995  PyObject *o;
60996  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
60997  o = (*t->tp_alloc)(t, 0);
60998  } else {
60999  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
61000  }
61001  if (unlikely(!o)) return 0;
61002  p = ((struct __pyx_obj_9WaveTools_MonochromaticWaves *)o);
61003  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_MonochromaticWaves;
61004  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61005  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61006  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61007  p->Ycoeff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61008  p->Bcoeff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61009  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61010  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61011  p->mV = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61012  p->waveType = Py_None; Py_INCREF(Py_None);
61013  return o;
61014 }
61015 
61016 static void __pyx_tp_dealloc_9WaveTools_MonochromaticWaves(PyObject *o) {
61017  struct __pyx_obj_9WaveTools_MonochromaticWaves *p = (struct __pyx_obj_9WaveTools_MonochromaticWaves *)o;
61018  #if CYTHON_USE_TP_FINALIZE
61019  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
61020  if (PyObject_CallFinalizerFromDealloc(o)) return;
61021  }
61022  #endif
61023  PyObject_GC_UnTrack(o);
61024  Py_CLEAR(p->g);
61025  Py_CLEAR(p->waveDir);
61026  Py_CLEAR(p->vDir);
61027  Py_CLEAR(p->Ycoeff);
61028  Py_CLEAR(p->Bcoeff);
61029  Py_CLEAR(p->kDir);
61030  Py_CLEAR(p->tanhF);
61031  Py_CLEAR(p->mV);
61032  Py_CLEAR(p->waveType);
61033  (*Py_TYPE(o)->tp_free)(o);
61034 }
61035 
61036 static int __pyx_tp_traverse_9WaveTools_MonochromaticWaves(PyObject *o, visitproc v, void *a) {
61037  int e;
61038  struct __pyx_obj_9WaveTools_MonochromaticWaves *p = (struct __pyx_obj_9WaveTools_MonochromaticWaves *)o;
61039  if (p->g) {
61040  e = (*v)(((PyObject *)p->g), a); if (e) return e;
61041  }
61042  if (p->waveDir) {
61043  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
61044  }
61045  if (p->vDir) {
61046  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
61047  }
61048  if (p->Ycoeff) {
61049  e = (*v)(((PyObject *)p->Ycoeff), a); if (e) return e;
61050  }
61051  if (p->Bcoeff) {
61052  e = (*v)(((PyObject *)p->Bcoeff), a); if (e) return e;
61053  }
61054  if (p->kDir) {
61055  e = (*v)(((PyObject *)p->kDir), a); if (e) return e;
61056  }
61057  if (p->tanhF) {
61058  e = (*v)(((PyObject *)p->tanhF), a); if (e) return e;
61059  }
61060  if (p->mV) {
61061  e = (*v)(((PyObject *)p->mV), a); if (e) return e;
61062  }
61063  if (p->waveType) {
61064  e = (*v)(p->waveType, a); if (e) return e;
61065  }
61066  return 0;
61067 }
61068 
61069 static int __pyx_tp_clear_9WaveTools_MonochromaticWaves(PyObject *o) {
61070  PyObject* tmp;
61071  struct __pyx_obj_9WaveTools_MonochromaticWaves *p = (struct __pyx_obj_9WaveTools_MonochromaticWaves *)o;
61072  tmp = ((PyObject*)p->g);
61073  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61074  Py_XDECREF(tmp);
61075  tmp = ((PyObject*)p->waveDir);
61076  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61077  Py_XDECREF(tmp);
61078  tmp = ((PyObject*)p->vDir);
61079  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61080  Py_XDECREF(tmp);
61081  tmp = ((PyObject*)p->Ycoeff);
61082  p->Ycoeff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61083  Py_XDECREF(tmp);
61084  tmp = ((PyObject*)p->Bcoeff);
61085  p->Bcoeff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61086  Py_XDECREF(tmp);
61087  tmp = ((PyObject*)p->kDir);
61088  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61089  Py_XDECREF(tmp);
61090  tmp = ((PyObject*)p->tanhF);
61091  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61092  Py_XDECREF(tmp);
61093  tmp = ((PyObject*)p->mV);
61094  p->mV = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61095  Py_XDECREF(tmp);
61096  tmp = ((PyObject*)p->waveType);
61097  p->waveType = Py_None; Py_INCREF(Py_None);
61098  Py_XDECREF(tmp);
61099  return 0;
61100 }
61101 
61102 static PyObject *__pyx_getprop_9WaveTools_18MonochromaticWaves_wavelength(PyObject *o, CYTHON_UNUSED void *x) {
61103  return __pyx_pw_9WaveTools_18MonochromaticWaves_10wavelength_1__get__(o);
61104 }
61105 
61106 static int __pyx_setprop_9WaveTools_18MonochromaticWaves_wavelength(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61107  if (v) {
61108  return __pyx_pw_9WaveTools_18MonochromaticWaves_10wavelength_3__set__(o, v);
61109  }
61110  else {
61111  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61112  return -1;
61113  }
61114 }
61115 
61116 static PyObject *__pyx_getprop_9WaveTools_18MonochromaticWaves_mwl(PyObject *o, CYTHON_UNUSED void *x) {
61117  return __pyx_pw_9WaveTools_18MonochromaticWaves_3mwl_1__get__(o);
61118 }
61119 
61120 static int __pyx_setprop_9WaveTools_18MonochromaticWaves_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61121  if (v) {
61122  return __pyx_pw_9WaveTools_18MonochromaticWaves_3mwl_3__set__(o, v);
61123  }
61124  else {
61125  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61126  return -1;
61127  }
61128 }
61129 
61130 static PyMethodDef __pyx_methods_9WaveTools_MonochromaticWaves[] = {
61131  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_18MonochromaticWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_18MonochromaticWaves_2eta},
61132  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_18MonochromaticWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_18MonochromaticWaves_4u},
61133  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_18MonochromaticWaves_7__reduce_cython__, METH_NOARGS, 0},
61134  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_18MonochromaticWaves_9__setstate_cython__, METH_O, 0},
61135  {0, 0, 0, 0}
61136 };
61137 
61138 static struct PyGetSetDef __pyx_getsets_9WaveTools_MonochromaticWaves[] = {
61139  {(char *)"wavelength", __pyx_getprop_9WaveTools_18MonochromaticWaves_wavelength, __pyx_setprop_9WaveTools_18MonochromaticWaves_wavelength, (char *)0, 0},
61140  {(char *)"mwl", __pyx_getprop_9WaveTools_18MonochromaticWaves_mwl, __pyx_setprop_9WaveTools_18MonochromaticWaves_mwl, (char *)0, 0},
61141  {0, 0, 0, 0, 0}
61142 };
61143 
61144 static PyTypeObject __pyx_type_9WaveTools_MonochromaticWaves = {
61145  PyVarObject_HEAD_INIT(0, 0)
61146  "WaveTools.MonochromaticWaves", /*tp_name*/
61147  sizeof(struct __pyx_obj_9WaveTools_MonochromaticWaves), /*tp_basicsize*/
61148  0, /*tp_itemsize*/
61149  __pyx_tp_dealloc_9WaveTools_MonochromaticWaves, /*tp_dealloc*/
61150  0, /*tp_print*/
61151  0, /*tp_getattr*/
61152  0, /*tp_setattr*/
61153  #if PY_MAJOR_VERSION < 3
61154  0, /*tp_compare*/
61155  #endif
61156  #if PY_MAJOR_VERSION >= 3
61157  0, /*tp_as_async*/
61158  #endif
61159  0, /*tp_repr*/
61160  0, /*tp_as_number*/
61161  0, /*tp_as_sequence*/
61162  0, /*tp_as_mapping*/
61163  0, /*tp_hash*/
61164  0, /*tp_call*/
61165  0, /*tp_str*/
61166  0, /*tp_getattro*/
61167  0, /*tp_setattro*/
61168  0, /*tp_as_buffer*/
61169  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
61170  "\n This class is used for generating regular waves in both linear and nonlinear regimes. See Dean and Dalrymple 1994 for equations.\n\n Parameters\n ----------\n period : float\n Regular wave period\n waveHeight: float\n Regular wave height\n mwl : float\n Still water level\n depth : float\n Water depth\n g : numpy.ndarray\n Gravitational acceleration vector\n waveDir : numpy.ndarray\n Wave direction in vector form\n wavelength : float\n Regular wave length, calculated from linear dispersion if set to None\n waveType : string\n Defines regular wave theory (\"Linear\", \"Fenton\")\n Fenton: uses BCoeffs/YCoeffs provided by user\n autoFenton: bool\n autoFenton=True: uses waveheight, period, depth, and g to\n calculate coeffs\n autoFenton=False: uses BCoeffs/YCoeffs provided by user\n autoFentonOpts: dict\n options for autoFenton. The dictionary must contain the following\n entries (here the default values if autoFentonOpts is None):\n autoFentonOpts = {'mode': 'Period',\n 'current_criterion': 1,\n 'height_steps': 1,\n 'niter': 40,\n 'conv_crit': 1e-05,\n 'points_freesurface': 50,\n 'points_velocity': 16,\n 'points_vertical': 20}\n Ycoeff : numpy.ndarray\n Fenton Fourier coefficients for free-surface elevation \n Bcoeff : numpy.ndarray\n Fenton Fourier coefficients for velocity (set to None for linear wave theory) \n Nf : integer\n Fenton Fourier components for reconstruction (set to 1000, needs to be equal to the size of Bcoeff and Ycoeff) \n meanVelocity : numpy.ndarray""\n Mean velocity for Fenton Fourier approximation \n phi0 : float\n Regular wave phase (0 by default) \n fast : bool\n Switch for optimised functions\n\n ", /*tp_doc*/
61171  __pyx_tp_traverse_9WaveTools_MonochromaticWaves, /*tp_traverse*/
61172  __pyx_tp_clear_9WaveTools_MonochromaticWaves, /*tp_clear*/
61173  0, /*tp_richcompare*/
61174  0, /*tp_weaklistoffset*/
61175  0, /*tp_iter*/
61176  0, /*tp_iternext*/
61177  __pyx_methods_9WaveTools_MonochromaticWaves, /*tp_methods*/
61178  0, /*tp_members*/
61179  __pyx_getsets_9WaveTools_MonochromaticWaves, /*tp_getset*/
61180  0, /*tp_base*/
61181  0, /*tp_dict*/
61182  0, /*tp_descr_get*/
61183  0, /*tp_descr_set*/
61184  0, /*tp_dictoffset*/
61185  __pyx_pw_9WaveTools_18MonochromaticWaves_1__init__, /*tp_init*/
61186  0, /*tp_alloc*/
61187  __pyx_tp_new_9WaveTools_MonochromaticWaves, /*tp_new*/
61188  0, /*tp_free*/
61189  0, /*tp_is_gc*/
61190  0, /*tp_bases*/
61191  0, /*tp_mro*/
61192  0, /*tp_cache*/
61193  0, /*tp_subclasses*/
61194  0, /*tp_weaklist*/
61195  0, /*tp_del*/
61196  0, /*tp_version_tag*/
61197  #if PY_VERSION_HEX >= 0x030400a1
61198  0, /*tp_finalize*/
61199  #endif
61200 };
61201 static struct __pyx_vtabstruct_9WaveTools_NewWave __pyx_vtable_9WaveTools_NewWave;
61202 
61203 static PyObject *__pyx_tp_new_9WaveTools_NewWave(PyTypeObject *t, PyObject *a, PyObject *k) {
61204  struct __pyx_obj_9WaveTools_NewWave *p;
61205  PyObject *o;
61206  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
61207  o = (*t->tp_alloc)(t, 0);
61208  } else {
61209  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
61210  }
61211  if (unlikely(!o)) return 0;
61212  p = ((struct __pyx_obj_9WaveTools_NewWave *)o);
61213  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_NewWave;
61214  p->fi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61215  p->fim = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61216  p->Si_Jm = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61217  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61218  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61219  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61220  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61221  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61222  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61223  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61224  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61225  p->phi = Py_None; Py_INCREF(Py_None);
61226  if (unlikely(__pyx_pw_9WaveTools_7NewWave_1__cinit__(o, a, k) < 0)) goto bad;
61227  return o;
61228  bad:
61229  Py_DECREF(o); o = 0;
61230  return NULL;
61231 }
61232 
61233 static void __pyx_tp_dealloc_9WaveTools_NewWave(PyObject *o) {
61234  struct __pyx_obj_9WaveTools_NewWave *p = (struct __pyx_obj_9WaveTools_NewWave *)o;
61235  #if CYTHON_USE_TP_FINALIZE
61236  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
61237  if (PyObject_CallFinalizerFromDealloc(o)) return;
61238  }
61239  #endif
61240  PyObject_GC_UnTrack(o);
61241  Py_CLEAR(p->fi);
61242  Py_CLEAR(p->fim);
61243  Py_CLEAR(p->Si_Jm);
61244  Py_CLEAR(p->ki);
61245  Py_CLEAR(p->omega);
61246  Py_CLEAR(p->tanhF);
61247  Py_CLEAR(p->g);
61248  Py_CLEAR(p->waveDir);
61249  Py_CLEAR(p->vDir);
61250  Py_CLEAR(p->kDir);
61251  Py_CLEAR(p->ai);
61252  Py_CLEAR(p->phi);
61253  (*Py_TYPE(o)->tp_free)(o);
61254 }
61255 
61256 static int __pyx_tp_traverse_9WaveTools_NewWave(PyObject *o, visitproc v, void *a) {
61257  int e;
61258  struct __pyx_obj_9WaveTools_NewWave *p = (struct __pyx_obj_9WaveTools_NewWave *)o;
61259  if (p->fi) {
61260  e = (*v)(((PyObject *)p->fi), a); if (e) return e;
61261  }
61262  if (p->fim) {
61263  e = (*v)(((PyObject *)p->fim), a); if (e) return e;
61264  }
61265  if (p->Si_Jm) {
61266  e = (*v)(((PyObject *)p->Si_Jm), a); if (e) return e;
61267  }
61268  if (p->ki) {
61269  e = (*v)(((PyObject *)p->ki), a); if (e) return e;
61270  }
61271  if (p->omega) {
61272  e = (*v)(((PyObject *)p->omega), a); if (e) return e;
61273  }
61274  if (p->tanhF) {
61275  e = (*v)(((PyObject *)p->tanhF), a); if (e) return e;
61276  }
61277  if (p->g) {
61278  e = (*v)(((PyObject *)p->g), a); if (e) return e;
61279  }
61280  if (p->waveDir) {
61281  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
61282  }
61283  if (p->vDir) {
61284  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
61285  }
61286  if (p->kDir) {
61287  e = (*v)(((PyObject *)p->kDir), a); if (e) return e;
61288  }
61289  if (p->ai) {
61290  e = (*v)(((PyObject *)p->ai), a); if (e) return e;
61291  }
61292  if (p->phi) {
61293  e = (*v)(p->phi, a); if (e) return e;
61294  }
61295  return 0;
61296 }
61297 
61298 static int __pyx_tp_clear_9WaveTools_NewWave(PyObject *o) {
61299  PyObject* tmp;
61300  struct __pyx_obj_9WaveTools_NewWave *p = (struct __pyx_obj_9WaveTools_NewWave *)o;
61301  tmp = ((PyObject*)p->fi);
61302  p->fi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61303  Py_XDECREF(tmp);
61304  tmp = ((PyObject*)p->fim);
61305  p->fim = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61306  Py_XDECREF(tmp);
61307  tmp = ((PyObject*)p->Si_Jm);
61308  p->Si_Jm = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61309  Py_XDECREF(tmp);
61310  tmp = ((PyObject*)p->ki);
61311  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61312  Py_XDECREF(tmp);
61313  tmp = ((PyObject*)p->omega);
61314  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61315  Py_XDECREF(tmp);
61316  tmp = ((PyObject*)p->tanhF);
61317  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61318  Py_XDECREF(tmp);
61319  tmp = ((PyObject*)p->g);
61320  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61321  Py_XDECREF(tmp);
61322  tmp = ((PyObject*)p->waveDir);
61323  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61324  Py_XDECREF(tmp);
61325  tmp = ((PyObject*)p->vDir);
61326  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61327  Py_XDECREF(tmp);
61328  tmp = ((PyObject*)p->kDir);
61329  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61330  Py_XDECREF(tmp);
61331  tmp = ((PyObject*)p->ai);
61332  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61333  Py_XDECREF(tmp);
61334  tmp = ((PyObject*)p->phi);
61335  p->phi = Py_None; Py_INCREF(Py_None);
61336  Py_XDECREF(tmp);
61337  return 0;
61338 }
61339 
61340 static PyObject *__pyx_getprop_9WaveTools_7NewWave_mwl(PyObject *o, CYTHON_UNUSED void *x) {
61341  return __pyx_pw_9WaveTools_7NewWave_3mwl_1__get__(o);
61342 }
61343 
61344 static int __pyx_setprop_9WaveTools_7NewWave_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61345  if (v) {
61346  return __pyx_pw_9WaveTools_7NewWave_3mwl_3__set__(o, v);
61347  }
61348  else {
61349  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61350  return -1;
61351  }
61352 }
61353 
61354 static PyObject *__pyx_getprop_9WaveTools_7NewWave_depth(PyObject *o, CYTHON_UNUSED void *x) {
61355  return __pyx_pw_9WaveTools_7NewWave_5depth_1__get__(o);
61356 }
61357 
61358 static int __pyx_setprop_9WaveTools_7NewWave_depth(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61359  if (v) {
61360  return __pyx_pw_9WaveTools_7NewWave_5depth_3__set__(o, v);
61361  }
61362  else {
61363  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61364  return -1;
61365  }
61366 }
61367 
61368 static PyObject *__pyx_getprop_9WaveTools_7NewWave_gAbs(PyObject *o, CYTHON_UNUSED void *x) {
61369  return __pyx_pw_9WaveTools_7NewWave_4gAbs_1__get__(o);
61370 }
61371 
61372 static int __pyx_setprop_9WaveTools_7NewWave_gAbs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61373  if (v) {
61374  return __pyx_pw_9WaveTools_7NewWave_4gAbs_3__set__(o, v);
61375  }
61376  else {
61377  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61378  return -1;
61379  }
61380 }
61381 
61382 static PyObject *__pyx_getprop_9WaveTools_7NewWave_Tlag(PyObject *o, CYTHON_UNUSED void *x) {
61383  return __pyx_pw_9WaveTools_7NewWave_4Tlag_1__get__(o);
61384 }
61385 
61386 static int __pyx_setprop_9WaveTools_7NewWave_Tlag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61387  if (v) {
61388  return __pyx_pw_9WaveTools_7NewWave_4Tlag_3__set__(o, v);
61389  }
61390  else {
61391  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61392  return -1;
61393  }
61394 }
61395 
61396 static PyObject *__pyx_getprop_9WaveTools_7NewWave_Hs(PyObject *o, CYTHON_UNUSED void *x) {
61397  return __pyx_pw_9WaveTools_7NewWave_2Hs_1__get__(o);
61398 }
61399 
61400 static int __pyx_setprop_9WaveTools_7NewWave_Hs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61401  if (v) {
61402  return __pyx_pw_9WaveTools_7NewWave_2Hs_3__set__(o, v);
61403  }
61404  else {
61405  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61406  return -1;
61407  }
61408 }
61409 
61410 static PyObject *__pyx_getprop_9WaveTools_7NewWave_Tp(PyObject *o, CYTHON_UNUSED void *x) {
61411  return __pyx_pw_9WaveTools_7NewWave_2Tp_1__get__(o);
61412 }
61413 
61414 static int __pyx_setprop_9WaveTools_7NewWave_Tp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61415  if (v) {
61416  return __pyx_pw_9WaveTools_7NewWave_2Tp_3__set__(o, v);
61417  }
61418  else {
61419  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61420  return -1;
61421  }
61422 }
61423 
61424 static PyObject *__pyx_getprop_9WaveTools_7NewWave_fp(PyObject *o, CYTHON_UNUSED void *x) {
61425  return __pyx_pw_9WaveTools_7NewWave_2fp_1__get__(o);
61426 }
61427 
61428 static int __pyx_setprop_9WaveTools_7NewWave_fp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61429  if (v) {
61430  return __pyx_pw_9WaveTools_7NewWave_2fp_3__set__(o, v);
61431  }
61432  else {
61433  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61434  return -1;
61435  }
61436 }
61437 
61438 static PyObject *__pyx_getprop_9WaveTools_7NewWave_bandFactor(PyObject *o, CYTHON_UNUSED void *x) {
61439  return __pyx_pw_9WaveTools_7NewWave_10bandFactor_1__get__(o);
61440 }
61441 
61442 static int __pyx_setprop_9WaveTools_7NewWave_bandFactor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61443  if (v) {
61444  return __pyx_pw_9WaveTools_7NewWave_10bandFactor_3__set__(o, v);
61445  }
61446  else {
61447  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61448  return -1;
61449  }
61450 }
61451 
61452 static PyObject *__pyx_getprop_9WaveTools_7NewWave_df(PyObject *o, CYTHON_UNUSED void *x) {
61453  return __pyx_pw_9WaveTools_7NewWave_2df_1__get__(o);
61454 }
61455 
61456 static int __pyx_setprop_9WaveTools_7NewWave_df(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61457  if (v) {
61458  return __pyx_pw_9WaveTools_7NewWave_2df_3__set__(o, v);
61459  }
61460  else {
61461  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61462  return -1;
61463  }
61464 }
61465 
61466 static PyObject *__pyx_getprop_9WaveTools_7NewWave_focus(PyObject *o, CYTHON_UNUSED void *x) {
61467  return __pyx_pw_9WaveTools_7NewWave_5focus_1__get__(o);
61468 }
61469 
61470 static int __pyx_setprop_9WaveTools_7NewWave_focus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61471  if (v) {
61472  return __pyx_pw_9WaveTools_7NewWave_5focus_3__set__(o, v);
61473  }
61474  else {
61475  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61476  return -1;
61477  }
61478 }
61479 
61480 static PyObject *__pyx_getprop_9WaveTools_7NewWave_tfocus(PyObject *o, CYTHON_UNUSED void *x) {
61481  return __pyx_pw_9WaveTools_7NewWave_6tfocus_1__get__(o);
61482 }
61483 
61484 static int __pyx_setprop_9WaveTools_7NewWave_tfocus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61485  if (v) {
61486  return __pyx_pw_9WaveTools_7NewWave_6tfocus_3__set__(o, v);
61487  }
61488  else {
61489  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61490  return -1;
61491  }
61492 }
61493 
61494 static PyObject *__pyx_getprop_9WaveTools_7NewWave_N(PyObject *o, CYTHON_UNUSED void *x) {
61495  return __pyx_pw_9WaveTools_7NewWave_1N_1__get__(o);
61496 }
61497 
61498 static int __pyx_setprop_9WaveTools_7NewWave_N(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61499  if (v) {
61500  return __pyx_pw_9WaveTools_7NewWave_1N_3__set__(o, v);
61501  }
61502  else {
61503  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61504  return -1;
61505  }
61506 }
61507 
61508 static PyObject *__pyx_getprop_9WaveTools_7NewWave_fi(PyObject *o, CYTHON_UNUSED void *x) {
61509  return __pyx_pw_9WaveTools_7NewWave_2fi_1__get__(o);
61510 }
61511 
61512 static int __pyx_setprop_9WaveTools_7NewWave_fi(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61513  if (v) {
61514  return __pyx_pw_9WaveTools_7NewWave_2fi_3__set__(o, v);
61515  }
61516  else {
61517  return __pyx_pw_9WaveTools_7NewWave_2fi_5__del__(o);
61518  }
61519 }
61520 
61521 static PyObject *__pyx_getprop_9WaveTools_7NewWave_fim(PyObject *o, CYTHON_UNUSED void *x) {
61522  return __pyx_pw_9WaveTools_7NewWave_3fim_1__get__(o);
61523 }
61524 
61525 static int __pyx_setprop_9WaveTools_7NewWave_fim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61526  if (v) {
61527  return __pyx_pw_9WaveTools_7NewWave_3fim_3__set__(o, v);
61528  }
61529  else {
61530  return __pyx_pw_9WaveTools_7NewWave_3fim_5__del__(o);
61531  }
61532 }
61533 
61534 static PyObject *__pyx_getprop_9WaveTools_7NewWave_Si_Jm(PyObject *o, CYTHON_UNUSED void *x) {
61535  return __pyx_pw_9WaveTools_7NewWave_5Si_Jm_1__get__(o);
61536 }
61537 
61538 static int __pyx_setprop_9WaveTools_7NewWave_Si_Jm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61539  if (v) {
61540  return __pyx_pw_9WaveTools_7NewWave_5Si_Jm_3__set__(o, v);
61541  }
61542  else {
61543  return __pyx_pw_9WaveTools_7NewWave_5Si_Jm_5__del__(o);
61544  }
61545 }
61546 
61547 static PyObject *__pyx_getprop_9WaveTools_7NewWave_ki(PyObject *o, CYTHON_UNUSED void *x) {
61548  return __pyx_pw_9WaveTools_7NewWave_2ki_1__get__(o);
61549 }
61550 
61551 static int __pyx_setprop_9WaveTools_7NewWave_ki(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61552  if (v) {
61553  return __pyx_pw_9WaveTools_7NewWave_2ki_3__set__(o, v);
61554  }
61555  else {
61556  return __pyx_pw_9WaveTools_7NewWave_2ki_5__del__(o);
61557  }
61558 }
61559 
61560 static PyObject *__pyx_getprop_9WaveTools_7NewWave_omega(PyObject *o, CYTHON_UNUSED void *x) {
61561  return __pyx_pw_9WaveTools_7NewWave_5omega_1__get__(o);
61562 }
61563 
61564 static int __pyx_setprop_9WaveTools_7NewWave_omega(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61565  if (v) {
61566  return __pyx_pw_9WaveTools_7NewWave_5omega_3__set__(o, v);
61567  }
61568  else {
61569  return __pyx_pw_9WaveTools_7NewWave_5omega_5__del__(o);
61570  }
61571 }
61572 
61573 static PyObject *__pyx_getprop_9WaveTools_7NewWave_tanhF(PyObject *o, CYTHON_UNUSED void *x) {
61574  return __pyx_pw_9WaveTools_7NewWave_5tanhF_1__get__(o);
61575 }
61576 
61577 static int __pyx_setprop_9WaveTools_7NewWave_tanhF(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61578  if (v) {
61579  return __pyx_pw_9WaveTools_7NewWave_5tanhF_3__set__(o, v);
61580  }
61581  else {
61582  return __pyx_pw_9WaveTools_7NewWave_5tanhF_5__del__(o);
61583  }
61584 }
61585 
61586 static PyObject *__pyx_getprop_9WaveTools_7NewWave_g(PyObject *o, CYTHON_UNUSED void *x) {
61587  return __pyx_pw_9WaveTools_7NewWave_1g_1__get__(o);
61588 }
61589 
61590 static int __pyx_setprop_9WaveTools_7NewWave_g(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61591  if (v) {
61592  return __pyx_pw_9WaveTools_7NewWave_1g_3__set__(o, v);
61593  }
61594  else {
61595  return __pyx_pw_9WaveTools_7NewWave_1g_5__del__(o);
61596  }
61597 }
61598 
61599 static PyObject *__pyx_getprop_9WaveTools_7NewWave_waveDir(PyObject *o, CYTHON_UNUSED void *x) {
61600  return __pyx_pw_9WaveTools_7NewWave_7waveDir_1__get__(o);
61601 }
61602 
61603 static int __pyx_setprop_9WaveTools_7NewWave_waveDir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61604  if (v) {
61605  return __pyx_pw_9WaveTools_7NewWave_7waveDir_3__set__(o, v);
61606  }
61607  else {
61608  return __pyx_pw_9WaveTools_7NewWave_7waveDir_5__del__(o);
61609  }
61610 }
61611 
61612 static PyObject *__pyx_getprop_9WaveTools_7NewWave_vDir(PyObject *o, CYTHON_UNUSED void *x) {
61613  return __pyx_pw_9WaveTools_7NewWave_4vDir_1__get__(o);
61614 }
61615 
61616 static int __pyx_setprop_9WaveTools_7NewWave_vDir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61617  if (v) {
61618  return __pyx_pw_9WaveTools_7NewWave_4vDir_3__set__(o, v);
61619  }
61620  else {
61621  return __pyx_pw_9WaveTools_7NewWave_4vDir_5__del__(o);
61622  }
61623 }
61624 
61625 static PyObject *__pyx_getprop_9WaveTools_7NewWave_kDir(PyObject *o, CYTHON_UNUSED void *x) {
61626  return __pyx_pw_9WaveTools_7NewWave_4kDir_1__get__(o);
61627 }
61628 
61629 static int __pyx_setprop_9WaveTools_7NewWave_kDir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61630  if (v) {
61631  return __pyx_pw_9WaveTools_7NewWave_4kDir_3__set__(o, v);
61632  }
61633  else {
61634  return __pyx_pw_9WaveTools_7NewWave_4kDir_5__del__(o);
61635  }
61636 }
61637 
61638 static PyObject *__pyx_getprop_9WaveTools_7NewWave_ai(PyObject *o, CYTHON_UNUSED void *x) {
61639  return __pyx_pw_9WaveTools_7NewWave_2ai_1__get__(o);
61640 }
61641 
61642 static int __pyx_setprop_9WaveTools_7NewWave_ai(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61643  if (v) {
61644  return __pyx_pw_9WaveTools_7NewWave_2ai_3__set__(o, v);
61645  }
61646  else {
61647  return __pyx_pw_9WaveTools_7NewWave_2ai_5__del__(o);
61648  }
61649 }
61650 
61651 static PyObject *__pyx_getprop_9WaveTools_7NewWave_phi(PyObject *o, CYTHON_UNUSED void *x) {
61652  return __pyx_pw_9WaveTools_7NewWave_3phi_1__get__(o);
61653 }
61654 
61655 static int __pyx_setprop_9WaveTools_7NewWave_phi(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61656  if (v) {
61657  return __pyx_pw_9WaveTools_7NewWave_3phi_3__set__(o, v);
61658  }
61659  else {
61660  return __pyx_pw_9WaveTools_7NewWave_3phi_5__del__(o);
61661  }
61662 }
61663 
61664 static PyMethodDef __pyx_methods_9WaveTools_NewWave[] = {
61665  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7NewWave_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_7NewWave_2eta},
61666  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7NewWave_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_7NewWave_4u},
61667  {"writeEtaSeries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_7NewWave_7writeEtaSeries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_7NewWave_6writeEtaSeries},
61668  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_7NewWave_9__reduce_cython__, METH_NOARGS, 0},
61669  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_7NewWave_11__setstate_cython__, METH_O, 0},
61670  {0, 0, 0, 0}
61671 };
61672 
61673 static struct PyGetSetDef __pyx_getsets_9WaveTools_NewWave[] = {
61674  {(char *)"mwl", __pyx_getprop_9WaveTools_7NewWave_mwl, __pyx_setprop_9WaveTools_7NewWave_mwl, (char *)0, 0},
61675  {(char *)"depth", __pyx_getprop_9WaveTools_7NewWave_depth, __pyx_setprop_9WaveTools_7NewWave_depth, (char *)0, 0},
61676  {(char *)"gAbs", __pyx_getprop_9WaveTools_7NewWave_gAbs, __pyx_setprop_9WaveTools_7NewWave_gAbs, (char *)0, 0},
61677  {(char *)"Tlag", __pyx_getprop_9WaveTools_7NewWave_Tlag, __pyx_setprop_9WaveTools_7NewWave_Tlag, (char *)0, 0},
61678  {(char *)"Hs", __pyx_getprop_9WaveTools_7NewWave_Hs, __pyx_setprop_9WaveTools_7NewWave_Hs, (char *)0, 0},
61679  {(char *)"Tp", __pyx_getprop_9WaveTools_7NewWave_Tp, __pyx_setprop_9WaveTools_7NewWave_Tp, (char *)0, 0},
61680  {(char *)"fp", __pyx_getprop_9WaveTools_7NewWave_fp, __pyx_setprop_9WaveTools_7NewWave_fp, (char *)0, 0},
61681  {(char *)"bandFactor", __pyx_getprop_9WaveTools_7NewWave_bandFactor, __pyx_setprop_9WaveTools_7NewWave_bandFactor, (char *)0, 0},
61682  {(char *)"df", __pyx_getprop_9WaveTools_7NewWave_df, __pyx_setprop_9WaveTools_7NewWave_df, (char *)0, 0},
61683  {(char *)"focus", __pyx_getprop_9WaveTools_7NewWave_focus, __pyx_setprop_9WaveTools_7NewWave_focus, (char *)0, 0},
61684  {(char *)"tfocus", __pyx_getprop_9WaveTools_7NewWave_tfocus, __pyx_setprop_9WaveTools_7NewWave_tfocus, (char *)0, 0},
61685  {(char *)"N", __pyx_getprop_9WaveTools_7NewWave_N, __pyx_setprop_9WaveTools_7NewWave_N, (char *)0, 0},
61686  {(char *)"fi", __pyx_getprop_9WaveTools_7NewWave_fi, __pyx_setprop_9WaveTools_7NewWave_fi, (char *)0, 0},
61687  {(char *)"fim", __pyx_getprop_9WaveTools_7NewWave_fim, __pyx_setprop_9WaveTools_7NewWave_fim, (char *)0, 0},
61688  {(char *)"Si_Jm", __pyx_getprop_9WaveTools_7NewWave_Si_Jm, __pyx_setprop_9WaveTools_7NewWave_Si_Jm, (char *)0, 0},
61689  {(char *)"ki", __pyx_getprop_9WaveTools_7NewWave_ki, __pyx_setprop_9WaveTools_7NewWave_ki, (char *)0, 0},
61690  {(char *)"omega", __pyx_getprop_9WaveTools_7NewWave_omega, __pyx_setprop_9WaveTools_7NewWave_omega, (char *)0, 0},
61691  {(char *)"tanhF", __pyx_getprop_9WaveTools_7NewWave_tanhF, __pyx_setprop_9WaveTools_7NewWave_tanhF, (char *)0, 0},
61692  {(char *)"g", __pyx_getprop_9WaveTools_7NewWave_g, __pyx_setprop_9WaveTools_7NewWave_g, (char *)0, 0},
61693  {(char *)"waveDir", __pyx_getprop_9WaveTools_7NewWave_waveDir, __pyx_setprop_9WaveTools_7NewWave_waveDir, (char *)0, 0},
61694  {(char *)"vDir", __pyx_getprop_9WaveTools_7NewWave_vDir, __pyx_setprop_9WaveTools_7NewWave_vDir, (char *)0, 0},
61695  {(char *)"kDir", __pyx_getprop_9WaveTools_7NewWave_kDir, __pyx_setprop_9WaveTools_7NewWave_kDir, (char *)0, 0},
61696  {(char *)"ai", __pyx_getprop_9WaveTools_7NewWave_ai, __pyx_setprop_9WaveTools_7NewWave_ai, (char *)0, 0},
61697  {(char *)"phi", __pyx_getprop_9WaveTools_7NewWave_phi, __pyx_setprop_9WaveTools_7NewWave_phi, (char *)0, 0},
61698  {0, 0, 0, 0, 0}
61699 };
61700 
61701 static PyTypeObject __pyx_type_9WaveTools_NewWave = {
61702  PyVarObject_HEAD_INIT(0, 0)
61703  "WaveTools.NewWave", /*tp_name*/
61704  sizeof(struct __pyx_obj_9WaveTools_NewWave), /*tp_basicsize*/
61705  0, /*tp_itemsize*/
61706  __pyx_tp_dealloc_9WaveTools_NewWave, /*tp_dealloc*/
61707  0, /*tp_print*/
61708  0, /*tp_getattr*/
61709  0, /*tp_setattr*/
61710  #if PY_MAJOR_VERSION < 3
61711  0, /*tp_compare*/
61712  #endif
61713  #if PY_MAJOR_VERSION >= 3
61714  0, /*tp_as_async*/
61715  #endif
61716  0, /*tp_repr*/
61717  0, /*tp_as_number*/
61718  0, /*tp_as_sequence*/
61719  0, /*tp_as_mapping*/
61720  0, /*tp_hash*/
61721  0, /*tp_call*/
61722  0, /*tp_str*/
61723  0, /*tp_getattro*/
61724  0, /*tp_setattro*/
61725  0, /*tp_as_buffer*/
61726  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
61727  "\n This class is used for generating the NewWave theory (see Tromans et al. 1991)\n\n Parameters\n ----------\n Tp : float\n Peak wave period \n Hs : float\n Significant wave height \n mwl : float\n Still water level \n depth : float\n Water depth \n waveDir : numpy.ndarray\n Wave direction vector \n g : Numpy array\n Gravitational acceleration vector \n N : int\n Number of frequency components\n bandFactor : float\n Spectral band factor. fmax = bandFactor/Tp, fmin = 1/(bandFactor*Tp) \n spectName : string\n Name of spectral distribution\n spectral_params : dict\n Dictionary of arguments specific to the spectral distribution\n Example for JONSWAP = {\"gamma\": 3.3, \"TMA\":True,\"depth\": depth}\n TMA=True activates the TMA modification, which in turn needs the depth as a parameter \n crestFocus: bool\n Switch to determine if crest focused or trough focused. By default true\n xfocus : numpy array\n Position of focused crest / trough\n tfocus : numpy array\n Time of focused crest / trough\n Nmax: int\n Normalisation factor to get the 1/N wave event at the NewWave series\n fast : bool\n Switch for optimised functions \n ", /*tp_doc*/
61728  __pyx_tp_traverse_9WaveTools_NewWave, /*tp_traverse*/
61729  __pyx_tp_clear_9WaveTools_NewWave, /*tp_clear*/
61730  0, /*tp_richcompare*/
61731  0, /*tp_weaklistoffset*/
61732  0, /*tp_iter*/
61733  0, /*tp_iternext*/
61734  __pyx_methods_9WaveTools_NewWave, /*tp_methods*/
61735  0, /*tp_members*/
61736  __pyx_getsets_9WaveTools_NewWave, /*tp_getset*/
61737  0, /*tp_base*/
61738  0, /*tp_dict*/
61739  0, /*tp_descr_get*/
61740  0, /*tp_descr_set*/
61741  0, /*tp_dictoffset*/
61742  0, /*tp_init*/
61743  0, /*tp_alloc*/
61744  __pyx_tp_new_9WaveTools_NewWave, /*tp_new*/
61745  0, /*tp_free*/
61746  0, /*tp_is_gc*/
61747  0, /*tp_bases*/
61748  0, /*tp_mro*/
61749  0, /*tp_cache*/
61750  0, /*tp_subclasses*/
61751  0, /*tp_weaklist*/
61752  0, /*tp_del*/
61753  0, /*tp_version_tag*/
61754  #if PY_VERSION_HEX >= 0x030400a1
61755  0, /*tp_finalize*/
61756  #endif
61757 };
61758 static struct __pyx_vtabstruct_9WaveTools_RandomWaves __pyx_vtable_9WaveTools_RandomWaves;
61759 
61760 static PyObject *__pyx_tp_new_9WaveTools_RandomWaves(PyTypeObject *t, PyObject *a, PyObject *k) {
61761  struct __pyx_obj_9WaveTools_RandomWaves *p;
61762  PyObject *o;
61763  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
61764  o = (*t->tp_alloc)(t, 0);
61765  } else {
61766  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
61767  }
61768  if (unlikely(!o)) return 0;
61769  p = ((struct __pyx_obj_9WaveTools_RandomWaves *)o);
61770  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_RandomWaves;
61771  p->fi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61772  p->fim = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61773  p->Si_Jm = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61774  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61775  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61776  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61777  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61778  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61779  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61780  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61781  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61782  p->phi = Py_None; Py_INCREF(Py_None);
61783  if (unlikely(__pyx_pw_9WaveTools_11RandomWaves_1__cinit__(o, a, k) < 0)) goto bad;
61784  return o;
61785  bad:
61786  Py_DECREF(o); o = 0;
61787  return NULL;
61788 }
61789 
61790 static void __pyx_tp_dealloc_9WaveTools_RandomWaves(PyObject *o) {
61791  struct __pyx_obj_9WaveTools_RandomWaves *p = (struct __pyx_obj_9WaveTools_RandomWaves *)o;
61792  #if CYTHON_USE_TP_FINALIZE
61793  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
61794  if (PyObject_CallFinalizerFromDealloc(o)) return;
61795  }
61796  #endif
61797  PyObject_GC_UnTrack(o);
61798  Py_CLEAR(p->fi);
61799  Py_CLEAR(p->fim);
61800  Py_CLEAR(p->Si_Jm);
61801  Py_CLEAR(p->ki);
61802  Py_CLEAR(p->omega);
61803  Py_CLEAR(p->tanhF);
61804  Py_CLEAR(p->g);
61805  Py_CLEAR(p->waveDir);
61806  Py_CLEAR(p->vDir);
61807  Py_CLEAR(p->kDir);
61808  Py_CLEAR(p->ai);
61809  Py_CLEAR(p->phi);
61810  (*Py_TYPE(o)->tp_free)(o);
61811 }
61812 
61813 static int __pyx_tp_traverse_9WaveTools_RandomWaves(PyObject *o, visitproc v, void *a) {
61814  int e;
61815  struct __pyx_obj_9WaveTools_RandomWaves *p = (struct __pyx_obj_9WaveTools_RandomWaves *)o;
61816  if (p->fi) {
61817  e = (*v)(((PyObject *)p->fi), a); if (e) return e;
61818  }
61819  if (p->fim) {
61820  e = (*v)(((PyObject *)p->fim), a); if (e) return e;
61821  }
61822  if (p->Si_Jm) {
61823  e = (*v)(((PyObject *)p->Si_Jm), a); if (e) return e;
61824  }
61825  if (p->ki) {
61826  e = (*v)(((PyObject *)p->ki), a); if (e) return e;
61827  }
61828  if (p->omega) {
61829  e = (*v)(((PyObject *)p->omega), a); if (e) return e;
61830  }
61831  if (p->tanhF) {
61832  e = (*v)(((PyObject *)p->tanhF), a); if (e) return e;
61833  }
61834  if (p->g) {
61835  e = (*v)(((PyObject *)p->g), a); if (e) return e;
61836  }
61837  if (p->waveDir) {
61838  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
61839  }
61840  if (p->vDir) {
61841  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
61842  }
61843  if (p->kDir) {
61844  e = (*v)(((PyObject *)p->kDir), a); if (e) return e;
61845  }
61846  if (p->ai) {
61847  e = (*v)(((PyObject *)p->ai), a); if (e) return e;
61848  }
61849  if (p->phi) {
61850  e = (*v)(p->phi, a); if (e) return e;
61851  }
61852  return 0;
61853 }
61854 
61855 static int __pyx_tp_clear_9WaveTools_RandomWaves(PyObject *o) {
61856  PyObject* tmp;
61857  struct __pyx_obj_9WaveTools_RandomWaves *p = (struct __pyx_obj_9WaveTools_RandomWaves *)o;
61858  tmp = ((PyObject*)p->fi);
61859  p->fi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61860  Py_XDECREF(tmp);
61861  tmp = ((PyObject*)p->fim);
61862  p->fim = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61863  Py_XDECREF(tmp);
61864  tmp = ((PyObject*)p->Si_Jm);
61865  p->Si_Jm = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61866  Py_XDECREF(tmp);
61867  tmp = ((PyObject*)p->ki);
61868  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61869  Py_XDECREF(tmp);
61870  tmp = ((PyObject*)p->omega);
61871  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61872  Py_XDECREF(tmp);
61873  tmp = ((PyObject*)p->tanhF);
61874  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61875  Py_XDECREF(tmp);
61876  tmp = ((PyObject*)p->g);
61877  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61878  Py_XDECREF(tmp);
61879  tmp = ((PyObject*)p->waveDir);
61880  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61881  Py_XDECREF(tmp);
61882  tmp = ((PyObject*)p->vDir);
61883  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61884  Py_XDECREF(tmp);
61885  tmp = ((PyObject*)p->kDir);
61886  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61887  Py_XDECREF(tmp);
61888  tmp = ((PyObject*)p->ai);
61889  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
61890  Py_XDECREF(tmp);
61891  tmp = ((PyObject*)p->phi);
61892  p->phi = Py_None; Py_INCREF(Py_None);
61893  Py_XDECREF(tmp);
61894  return 0;
61895 }
61896 
61897 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_mwl(PyObject *o, CYTHON_UNUSED void *x) {
61898  return __pyx_pw_9WaveTools_11RandomWaves_3mwl_1__get__(o);
61899 }
61900 
61901 static int __pyx_setprop_9WaveTools_11RandomWaves_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61902  if (v) {
61903  return __pyx_pw_9WaveTools_11RandomWaves_3mwl_3__set__(o, v);
61904  }
61905  else {
61906  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61907  return -1;
61908  }
61909 }
61910 
61911 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_depth(PyObject *o, CYTHON_UNUSED void *x) {
61912  return __pyx_pw_9WaveTools_11RandomWaves_5depth_1__get__(o);
61913 }
61914 
61915 static int __pyx_setprop_9WaveTools_11RandomWaves_depth(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61916  if (v) {
61917  return __pyx_pw_9WaveTools_11RandomWaves_5depth_3__set__(o, v);
61918  }
61919  else {
61920  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61921  return -1;
61922  }
61923 }
61924 
61925 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_gAbs(PyObject *o, CYTHON_UNUSED void *x) {
61926  return __pyx_pw_9WaveTools_11RandomWaves_4gAbs_1__get__(o);
61927 }
61928 
61929 static int __pyx_setprop_9WaveTools_11RandomWaves_gAbs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61930  if (v) {
61931  return __pyx_pw_9WaveTools_11RandomWaves_4gAbs_3__set__(o, v);
61932  }
61933  else {
61934  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61935  return -1;
61936  }
61937 }
61938 
61939 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_Tlag(PyObject *o, CYTHON_UNUSED void *x) {
61940  return __pyx_pw_9WaveTools_11RandomWaves_4Tlag_1__get__(o);
61941 }
61942 
61943 static int __pyx_setprop_9WaveTools_11RandomWaves_Tlag(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61944  if (v) {
61945  return __pyx_pw_9WaveTools_11RandomWaves_4Tlag_3__set__(o, v);
61946  }
61947  else {
61948  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61949  return -1;
61950  }
61951 }
61952 
61953 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_Hs(PyObject *o, CYTHON_UNUSED void *x) {
61954  return __pyx_pw_9WaveTools_11RandomWaves_2Hs_1__get__(o);
61955 }
61956 
61957 static int __pyx_setprop_9WaveTools_11RandomWaves_Hs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61958  if (v) {
61959  return __pyx_pw_9WaveTools_11RandomWaves_2Hs_3__set__(o, v);
61960  }
61961  else {
61962  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61963  return -1;
61964  }
61965 }
61966 
61967 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_Tp(PyObject *o, CYTHON_UNUSED void *x) {
61968  return __pyx_pw_9WaveTools_11RandomWaves_2Tp_1__get__(o);
61969 }
61970 
61971 static int __pyx_setprop_9WaveTools_11RandomWaves_Tp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61972  if (v) {
61973  return __pyx_pw_9WaveTools_11RandomWaves_2Tp_3__set__(o, v);
61974  }
61975  else {
61976  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61977  return -1;
61978  }
61979 }
61980 
61981 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_fp(PyObject *o, CYTHON_UNUSED void *x) {
61982  return __pyx_pw_9WaveTools_11RandomWaves_2fp_1__get__(o);
61983 }
61984 
61985 static int __pyx_setprop_9WaveTools_11RandomWaves_fp(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
61986  if (v) {
61987  return __pyx_pw_9WaveTools_11RandomWaves_2fp_3__set__(o, v);
61988  }
61989  else {
61990  PyErr_SetString(PyExc_NotImplementedError, "__del__");
61991  return -1;
61992  }
61993 }
61994 
61995 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_bandFactor(PyObject *o, CYTHON_UNUSED void *x) {
61996  return __pyx_pw_9WaveTools_11RandomWaves_10bandFactor_1__get__(o);
61997 }
61998 
61999 static int __pyx_setprop_9WaveTools_11RandomWaves_bandFactor(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62000  if (v) {
62001  return __pyx_pw_9WaveTools_11RandomWaves_10bandFactor_3__set__(o, v);
62002  }
62003  else {
62004  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62005  return -1;
62006  }
62007 }
62008 
62009 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_df(PyObject *o, CYTHON_UNUSED void *x) {
62010  return __pyx_pw_9WaveTools_11RandomWaves_2df_1__get__(o);
62011 }
62012 
62013 static int __pyx_setprop_9WaveTools_11RandomWaves_df(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62014  if (v) {
62015  return __pyx_pw_9WaveTools_11RandomWaves_2df_3__set__(o, v);
62016  }
62017  else {
62018  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62019  return -1;
62020  }
62021 }
62022 
62023 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_wavelength(PyObject *o, CYTHON_UNUSED void *x) {
62024  return __pyx_pw_9WaveTools_11RandomWaves_10wavelength_1__get__(o);
62025 }
62026 
62027 static int __pyx_setprop_9WaveTools_11RandomWaves_wavelength(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62028  if (v) {
62029  return __pyx_pw_9WaveTools_11RandomWaves_10wavelength_3__set__(o, v);
62030  }
62031  else {
62032  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62033  return -1;
62034  }
62035 }
62036 
62037 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_N(PyObject *o, CYTHON_UNUSED void *x) {
62038  return __pyx_pw_9WaveTools_11RandomWaves_1N_1__get__(o);
62039 }
62040 
62041 static int __pyx_setprop_9WaveTools_11RandomWaves_N(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62042  if (v) {
62043  return __pyx_pw_9WaveTools_11RandomWaves_1N_3__set__(o, v);
62044  }
62045  else {
62046  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62047  return -1;
62048  }
62049 }
62050 
62051 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_fi(PyObject *o, CYTHON_UNUSED void *x) {
62052  return __pyx_pw_9WaveTools_11RandomWaves_2fi_1__get__(o);
62053 }
62054 
62055 static int __pyx_setprop_9WaveTools_11RandomWaves_fi(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62056  if (v) {
62057  return __pyx_pw_9WaveTools_11RandomWaves_2fi_3__set__(o, v);
62058  }
62059  else {
62060  return __pyx_pw_9WaveTools_11RandomWaves_2fi_5__del__(o);
62061  }
62062 }
62063 
62064 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_fim(PyObject *o, CYTHON_UNUSED void *x) {
62065  return __pyx_pw_9WaveTools_11RandomWaves_3fim_1__get__(o);
62066 }
62067 
62068 static int __pyx_setprop_9WaveTools_11RandomWaves_fim(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62069  if (v) {
62070  return __pyx_pw_9WaveTools_11RandomWaves_3fim_3__set__(o, v);
62071  }
62072  else {
62073  return __pyx_pw_9WaveTools_11RandomWaves_3fim_5__del__(o);
62074  }
62075 }
62076 
62077 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_Si_Jm(PyObject *o, CYTHON_UNUSED void *x) {
62078  return __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_1__get__(o);
62079 }
62080 
62081 static int __pyx_setprop_9WaveTools_11RandomWaves_Si_Jm(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62082  if (v) {
62083  return __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_3__set__(o, v);
62084  }
62085  else {
62086  return __pyx_pw_9WaveTools_11RandomWaves_5Si_Jm_5__del__(o);
62087  }
62088 }
62089 
62090 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_ki(PyObject *o, CYTHON_UNUSED void *x) {
62091  return __pyx_pw_9WaveTools_11RandomWaves_2ki_1__get__(o);
62092 }
62093 
62094 static int __pyx_setprop_9WaveTools_11RandomWaves_ki(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62095  if (v) {
62096  return __pyx_pw_9WaveTools_11RandomWaves_2ki_3__set__(o, v);
62097  }
62098  else {
62099  return __pyx_pw_9WaveTools_11RandomWaves_2ki_5__del__(o);
62100  }
62101 }
62102 
62103 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_omega(PyObject *o, CYTHON_UNUSED void *x) {
62104  return __pyx_pw_9WaveTools_11RandomWaves_5omega_1__get__(o);
62105 }
62106 
62107 static int __pyx_setprop_9WaveTools_11RandomWaves_omega(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62108  if (v) {
62109  return __pyx_pw_9WaveTools_11RandomWaves_5omega_3__set__(o, v);
62110  }
62111  else {
62112  return __pyx_pw_9WaveTools_11RandomWaves_5omega_5__del__(o);
62113  }
62114 }
62115 
62116 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_tanhF(PyObject *o, CYTHON_UNUSED void *x) {
62117  return __pyx_pw_9WaveTools_11RandomWaves_5tanhF_1__get__(o);
62118 }
62119 
62120 static int __pyx_setprop_9WaveTools_11RandomWaves_tanhF(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62121  if (v) {
62122  return __pyx_pw_9WaveTools_11RandomWaves_5tanhF_3__set__(o, v);
62123  }
62124  else {
62125  return __pyx_pw_9WaveTools_11RandomWaves_5tanhF_5__del__(o);
62126  }
62127 }
62128 
62129 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_g(PyObject *o, CYTHON_UNUSED void *x) {
62130  return __pyx_pw_9WaveTools_11RandomWaves_1g_1__get__(o);
62131 }
62132 
62133 static int __pyx_setprop_9WaveTools_11RandomWaves_g(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62134  if (v) {
62135  return __pyx_pw_9WaveTools_11RandomWaves_1g_3__set__(o, v);
62136  }
62137  else {
62138  return __pyx_pw_9WaveTools_11RandomWaves_1g_5__del__(o);
62139  }
62140 }
62141 
62142 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_waveDir(PyObject *o, CYTHON_UNUSED void *x) {
62143  return __pyx_pw_9WaveTools_11RandomWaves_7waveDir_1__get__(o);
62144 }
62145 
62146 static int __pyx_setprop_9WaveTools_11RandomWaves_waveDir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62147  if (v) {
62148  return __pyx_pw_9WaveTools_11RandomWaves_7waveDir_3__set__(o, v);
62149  }
62150  else {
62151  return __pyx_pw_9WaveTools_11RandomWaves_7waveDir_5__del__(o);
62152  }
62153 }
62154 
62155 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_vDir(PyObject *o, CYTHON_UNUSED void *x) {
62156  return __pyx_pw_9WaveTools_11RandomWaves_4vDir_1__get__(o);
62157 }
62158 
62159 static int __pyx_setprop_9WaveTools_11RandomWaves_vDir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62160  if (v) {
62161  return __pyx_pw_9WaveTools_11RandomWaves_4vDir_3__set__(o, v);
62162  }
62163  else {
62164  return __pyx_pw_9WaveTools_11RandomWaves_4vDir_5__del__(o);
62165  }
62166 }
62167 
62168 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_kDir(PyObject *o, CYTHON_UNUSED void *x) {
62169  return __pyx_pw_9WaveTools_11RandomWaves_4kDir_1__get__(o);
62170 }
62171 
62172 static int __pyx_setprop_9WaveTools_11RandomWaves_kDir(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62173  if (v) {
62174  return __pyx_pw_9WaveTools_11RandomWaves_4kDir_3__set__(o, v);
62175  }
62176  else {
62177  return __pyx_pw_9WaveTools_11RandomWaves_4kDir_5__del__(o);
62178  }
62179 }
62180 
62181 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_ai(PyObject *o, CYTHON_UNUSED void *x) {
62182  return __pyx_pw_9WaveTools_11RandomWaves_2ai_1__get__(o);
62183 }
62184 
62185 static int __pyx_setprop_9WaveTools_11RandomWaves_ai(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62186  if (v) {
62187  return __pyx_pw_9WaveTools_11RandomWaves_2ai_3__set__(o, v);
62188  }
62189  else {
62190  return __pyx_pw_9WaveTools_11RandomWaves_2ai_5__del__(o);
62191  }
62192 }
62193 
62194 static PyObject *__pyx_getprop_9WaveTools_11RandomWaves_phi(PyObject *o, CYTHON_UNUSED void *x) {
62195  return __pyx_pw_9WaveTools_11RandomWaves_3phi_1__get__(o);
62196 }
62197 
62198 static int __pyx_setprop_9WaveTools_11RandomWaves_phi(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62199  if (v) {
62200  return __pyx_pw_9WaveTools_11RandomWaves_3phi_3__set__(o, v);
62201  }
62202  else {
62203  return __pyx_pw_9WaveTools_11RandomWaves_3phi_5__del__(o);
62204  }
62205 }
62206 
62207 static PyMethodDef __pyx_methods_9WaveTools_RandomWaves[] = {
62208  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11RandomWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_11RandomWaves_2eta},
62209  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11RandomWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_11RandomWaves_4u},
62210  {"writeEtaSeries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_11RandomWaves_7writeEtaSeries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_11RandomWaves_6writeEtaSeries},
62211  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_11RandomWaves_9__reduce_cython__, METH_NOARGS, 0},
62212  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_11RandomWaves_11__setstate_cython__, METH_O, 0},
62213  {0, 0, 0, 0}
62214 };
62215 
62216 static struct PyGetSetDef __pyx_getsets_9WaveTools_RandomWaves[] = {
62217  {(char *)"mwl", __pyx_getprop_9WaveTools_11RandomWaves_mwl, __pyx_setprop_9WaveTools_11RandomWaves_mwl, (char *)0, 0},
62218  {(char *)"depth", __pyx_getprop_9WaveTools_11RandomWaves_depth, __pyx_setprop_9WaveTools_11RandomWaves_depth, (char *)0, 0},
62219  {(char *)"gAbs", __pyx_getprop_9WaveTools_11RandomWaves_gAbs, __pyx_setprop_9WaveTools_11RandomWaves_gAbs, (char *)0, 0},
62220  {(char *)"Tlag", __pyx_getprop_9WaveTools_11RandomWaves_Tlag, __pyx_setprop_9WaveTools_11RandomWaves_Tlag, (char *)0, 0},
62221  {(char *)"Hs", __pyx_getprop_9WaveTools_11RandomWaves_Hs, __pyx_setprop_9WaveTools_11RandomWaves_Hs, (char *)0, 0},
62222  {(char *)"Tp", __pyx_getprop_9WaveTools_11RandomWaves_Tp, __pyx_setprop_9WaveTools_11RandomWaves_Tp, (char *)0, 0},
62223  {(char *)"fp", __pyx_getprop_9WaveTools_11RandomWaves_fp, __pyx_setprop_9WaveTools_11RandomWaves_fp, (char *)0, 0},
62224  {(char *)"bandFactor", __pyx_getprop_9WaveTools_11RandomWaves_bandFactor, __pyx_setprop_9WaveTools_11RandomWaves_bandFactor, (char *)0, 0},
62225  {(char *)"df", __pyx_getprop_9WaveTools_11RandomWaves_df, __pyx_setprop_9WaveTools_11RandomWaves_df, (char *)0, 0},
62226  {(char *)"wavelength", __pyx_getprop_9WaveTools_11RandomWaves_wavelength, __pyx_setprop_9WaveTools_11RandomWaves_wavelength, (char *)0, 0},
62227  {(char *)"N", __pyx_getprop_9WaveTools_11RandomWaves_N, __pyx_setprop_9WaveTools_11RandomWaves_N, (char *)0, 0},
62228  {(char *)"fi", __pyx_getprop_9WaveTools_11RandomWaves_fi, __pyx_setprop_9WaveTools_11RandomWaves_fi, (char *)0, 0},
62229  {(char *)"fim", __pyx_getprop_9WaveTools_11RandomWaves_fim, __pyx_setprop_9WaveTools_11RandomWaves_fim, (char *)0, 0},
62230  {(char *)"Si_Jm", __pyx_getprop_9WaveTools_11RandomWaves_Si_Jm, __pyx_setprop_9WaveTools_11RandomWaves_Si_Jm, (char *)0, 0},
62231  {(char *)"ki", __pyx_getprop_9WaveTools_11RandomWaves_ki, __pyx_setprop_9WaveTools_11RandomWaves_ki, (char *)0, 0},
62232  {(char *)"omega", __pyx_getprop_9WaveTools_11RandomWaves_omega, __pyx_setprop_9WaveTools_11RandomWaves_omega, (char *)0, 0},
62233  {(char *)"tanhF", __pyx_getprop_9WaveTools_11RandomWaves_tanhF, __pyx_setprop_9WaveTools_11RandomWaves_tanhF, (char *)0, 0},
62234  {(char *)"g", __pyx_getprop_9WaveTools_11RandomWaves_g, __pyx_setprop_9WaveTools_11RandomWaves_g, (char *)0, 0},
62235  {(char *)"waveDir", __pyx_getprop_9WaveTools_11RandomWaves_waveDir, __pyx_setprop_9WaveTools_11RandomWaves_waveDir, (char *)0, 0},
62236  {(char *)"vDir", __pyx_getprop_9WaveTools_11RandomWaves_vDir, __pyx_setprop_9WaveTools_11RandomWaves_vDir, (char *)0, 0},
62237  {(char *)"kDir", __pyx_getprop_9WaveTools_11RandomWaves_kDir, __pyx_setprop_9WaveTools_11RandomWaves_kDir, (char *)0, 0},
62238  {(char *)"ai", __pyx_getprop_9WaveTools_11RandomWaves_ai, __pyx_setprop_9WaveTools_11RandomWaves_ai, (char *)0, 0},
62239  {(char *)"phi", __pyx_getprop_9WaveTools_11RandomWaves_phi, __pyx_setprop_9WaveTools_11RandomWaves_phi, (char *)0, 0},
62240  {0, 0, 0, 0, 0}
62241 };
62242 
62243 static PyTypeObject __pyx_type_9WaveTools_RandomWaves = {
62244  PyVarObject_HEAD_INIT(0, 0)
62245  "WaveTools.RandomWaves", /*tp_name*/
62246  sizeof(struct __pyx_obj_9WaveTools_RandomWaves), /*tp_basicsize*/
62247  0, /*tp_itemsize*/
62248  __pyx_tp_dealloc_9WaveTools_RandomWaves, /*tp_dealloc*/
62249  0, /*tp_print*/
62250  0, /*tp_getattr*/
62251  0, /*tp_setattr*/
62252  #if PY_MAJOR_VERSION < 3
62253  0, /*tp_compare*/
62254  #endif
62255  #if PY_MAJOR_VERSION >= 3
62256  0, /*tp_as_async*/
62257  #endif
62258  0, /*tp_repr*/
62259  0, /*tp_as_number*/
62260  0, /*tp_as_sequence*/
62261  0, /*tp_as_mapping*/
62262  0, /*tp_hash*/
62263  0, /*tp_call*/
62264  0, /*tp_str*/
62265  0, /*tp_getattro*/
62266  0, /*tp_setattro*/
62267  0, /*tp_as_buffer*/
62268  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
62269  "\n This class is used for generating plane random waves using linear reconstruction of components from a\n wave spectrum\n\n Parameters\n ----------\n Tp : float\n Peak wave period \n Hs : float\n Significant wave height \n mwl : float\n Still water level \n depth : float\n Water depth \n waveDir : numpy.ndarray\n Wave direction vector \n g : Numpy array\n Gravitational acceleration vector \n N : int\n Number of frequency components\n bandFactor : float\n Spectral band factor. fmax = bandFactor/Tp, fmin = 1/(bandFactor*Tp) \n spectName : string\n Name of spectral distribution\n spectral_params : dict\n Dictionary of arguments specific to the spectral distribution\n Example for JONSWAP = {\"gamma\": 3.3, \"TMA\":True,\"depth\": depth}\n TMA=True activates the TMA modification, which in turn needs the depth as a parameter \n phi : numpy.ndarray\n Component phases (if set to None, phases are picked at random) \n fast : bool\n Switch for optimised functions \n ", /*tp_doc*/
62270  __pyx_tp_traverse_9WaveTools_RandomWaves, /*tp_traverse*/
62271  __pyx_tp_clear_9WaveTools_RandomWaves, /*tp_clear*/
62272  0, /*tp_richcompare*/
62273  0, /*tp_weaklistoffset*/
62274  0, /*tp_iter*/
62275  0, /*tp_iternext*/
62276  __pyx_methods_9WaveTools_RandomWaves, /*tp_methods*/
62277  0, /*tp_members*/
62278  __pyx_getsets_9WaveTools_RandomWaves, /*tp_getset*/
62279  0, /*tp_base*/
62280  0, /*tp_dict*/
62281  0, /*tp_descr_get*/
62282  0, /*tp_descr_set*/
62283  0, /*tp_dictoffset*/
62284  0, /*tp_init*/
62285  0, /*tp_alloc*/
62286  __pyx_tp_new_9WaveTools_RandomWaves, /*tp_new*/
62287  0, /*tp_free*/
62288  0, /*tp_is_gc*/
62289  0, /*tp_bases*/
62290  0, /*tp_mro*/
62291  0, /*tp_cache*/
62292  0, /*tp_subclasses*/
62293  0, /*tp_weaklist*/
62294  0, /*tp_del*/
62295  0, /*tp_version_tag*/
62296  #if PY_VERSION_HEX >= 0x030400a1
62297  0, /*tp_finalize*/
62298  #endif
62299 };
62300 static struct __pyx_vtabstruct_9WaveTools_MultiSpectraRandomWaves __pyx_vtable_9WaveTools_MultiSpectraRandomWaves;
62301 
62302 static PyObject *__pyx_tp_new_9WaveTools_MultiSpectraRandomWaves(PyTypeObject *t, PyObject *a, PyObject *k) {
62303  struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *p;
62304  PyObject *o;
62305  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
62306  o = (*t->tp_alloc)(t, 0);
62307  } else {
62308  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
62309  }
62310  if (unlikely(!o)) return 0;
62311  p = ((struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)o);
62312  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_MultiSpectraRandomWaves;
62313  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62314  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62315  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62316  p->omegaM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62317  p->phiM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62318  p->kiM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62319  p->kDirM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62320  p->tanhFM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62321  p->aiM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62322  if (unlikely(__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_1__cinit__(o, a, k) < 0)) goto bad;
62323  return o;
62324  bad:
62325  Py_DECREF(o); o = 0;
62326  return NULL;
62327 }
62328 
62329 static void __pyx_tp_dealloc_9WaveTools_MultiSpectraRandomWaves(PyObject *o) {
62330  struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *p = (struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)o;
62331  #if CYTHON_USE_TP_FINALIZE
62332  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
62333  if (PyObject_CallFinalizerFromDealloc(o)) return;
62334  }
62335  #endif
62336  PyObject_GC_UnTrack(o);
62337  Py_CLEAR(p->g);
62338  Py_CLEAR(p->vDir);
62339  Py_CLEAR(p->waveDir);
62340  Py_CLEAR(p->omegaM);
62341  Py_CLEAR(p->phiM);
62342  Py_CLEAR(p->kiM);
62343  Py_CLEAR(p->kDirM);
62344  Py_CLEAR(p->tanhFM);
62345  Py_CLEAR(p->aiM);
62346  (*Py_TYPE(o)->tp_free)(o);
62347 }
62348 
62349 static int __pyx_tp_traverse_9WaveTools_MultiSpectraRandomWaves(PyObject *o, visitproc v, void *a) {
62350  int e;
62351  struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *p = (struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)o;
62352  if (p->g) {
62353  e = (*v)(((PyObject *)p->g), a); if (e) return e;
62354  }
62355  if (p->vDir) {
62356  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
62357  }
62358  if (p->waveDir) {
62359  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
62360  }
62361  if (p->omegaM) {
62362  e = (*v)(((PyObject *)p->omegaM), a); if (e) return e;
62363  }
62364  if (p->phiM) {
62365  e = (*v)(((PyObject *)p->phiM), a); if (e) return e;
62366  }
62367  if (p->kiM) {
62368  e = (*v)(((PyObject *)p->kiM), a); if (e) return e;
62369  }
62370  if (p->kDirM) {
62371  e = (*v)(((PyObject *)p->kDirM), a); if (e) return e;
62372  }
62373  if (p->tanhFM) {
62374  e = (*v)(((PyObject *)p->tanhFM), a); if (e) return e;
62375  }
62376  if (p->aiM) {
62377  e = (*v)(((PyObject *)p->aiM), a); if (e) return e;
62378  }
62379  return 0;
62380 }
62381 
62382 static int __pyx_tp_clear_9WaveTools_MultiSpectraRandomWaves(PyObject *o) {
62383  PyObject* tmp;
62384  struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *p = (struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *)o;
62385  tmp = ((PyObject*)p->g);
62386  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62387  Py_XDECREF(tmp);
62388  tmp = ((PyObject*)p->vDir);
62389  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62390  Py_XDECREF(tmp);
62391  tmp = ((PyObject*)p->waveDir);
62392  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62393  Py_XDECREF(tmp);
62394  tmp = ((PyObject*)p->omegaM);
62395  p->omegaM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62396  Py_XDECREF(tmp);
62397  tmp = ((PyObject*)p->phiM);
62398  p->phiM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62399  Py_XDECREF(tmp);
62400  tmp = ((PyObject*)p->kiM);
62401  p->kiM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62402  Py_XDECREF(tmp);
62403  tmp = ((PyObject*)p->kDirM);
62404  p->kDirM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62405  Py_XDECREF(tmp);
62406  tmp = ((PyObject*)p->tanhFM);
62407  p->tanhFM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62408  Py_XDECREF(tmp);
62409  tmp = ((PyObject*)p->aiM);
62410  p->aiM = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62411  Py_XDECREF(tmp);
62412  return 0;
62413 }
62414 
62415 static PyObject *__pyx_getprop_9WaveTools_23MultiSpectraRandomWaves_mwl(PyObject *o, CYTHON_UNUSED void *x) {
62416  return __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3mwl_1__get__(o);
62417 }
62418 
62419 static int __pyx_setprop_9WaveTools_23MultiSpectraRandomWaves_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62420  if (v) {
62421  return __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3mwl_3__set__(o, v);
62422  }
62423  else {
62424  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62425  return -1;
62426  }
62427 }
62428 
62429 static PyObject *__pyx_getprop_9WaveTools_23MultiSpectraRandomWaves_depth(PyObject *o, CYTHON_UNUSED void *x) {
62430  return __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5depth_1__get__(o);
62431 }
62432 
62433 static int __pyx_setprop_9WaveTools_23MultiSpectraRandomWaves_depth(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62434  if (v) {
62435  return __pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5depth_3__set__(o, v);
62436  }
62437  else {
62438  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62439  return -1;
62440  }
62441 }
62442 
62443 static PyMethodDef __pyx_methods_9WaveTools_MultiSpectraRandomWaves[] = {
62444  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_23MultiSpectraRandomWaves_2eta},
62445  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_23MultiSpectraRandomWaves_4u},
62446  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_7__reduce_cython__, METH_NOARGS, 0},
62447  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_23MultiSpectraRandomWaves_9__setstate_cython__, METH_O, 0},
62448  {0, 0, 0, 0}
62449 };
62450 
62451 static struct PyGetSetDef __pyx_getsets_9WaveTools_MultiSpectraRandomWaves[] = {
62452  {(char *)"mwl", __pyx_getprop_9WaveTools_23MultiSpectraRandomWaves_mwl, __pyx_setprop_9WaveTools_23MultiSpectraRandomWaves_mwl, (char *)0, 0},
62453  {(char *)"depth", __pyx_getprop_9WaveTools_23MultiSpectraRandomWaves_depth, __pyx_setprop_9WaveTools_23MultiSpectraRandomWaves_depth, (char *)0, 0},
62454  {0, 0, 0, 0, 0}
62455 };
62456 
62457 static PyTypeObject __pyx_type_9WaveTools_MultiSpectraRandomWaves = {
62458  PyVarObject_HEAD_INIT(0, 0)
62459  "WaveTools.MultiSpectraRandomWaves", /*tp_name*/
62460  sizeof(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves), /*tp_basicsize*/
62461  0, /*tp_itemsize*/
62462  __pyx_tp_dealloc_9WaveTools_MultiSpectraRandomWaves, /*tp_dealloc*/
62463  0, /*tp_print*/
62464  0, /*tp_getattr*/
62465  0, /*tp_setattr*/
62466  #if PY_MAJOR_VERSION < 3
62467  0, /*tp_compare*/
62468  #endif
62469  #if PY_MAJOR_VERSION >= 3
62470  0, /*tp_as_async*/
62471  #endif
62472  0, /*tp_repr*/
62473  0, /*tp_as_number*/
62474  0, /*tp_as_sequence*/
62475  0, /*tp_as_mapping*/
62476  0, /*tp_hash*/
62477  0, /*tp_call*/
62478  0, /*tp_str*/
62479  0, /*tp_getattro*/
62480  0, /*tp_setattro*/
62481  0, /*tp_as_buffer*/
62482  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
62483  "This class is used for generating random waves by combining\n multiple spectra with different distributions and directions\n\n Parameters\n ----------\n\n Nspectra : int\n Total number of spectra\n Tp : list\n List of peak wave periods\n Hs : list\n List of significant wave heights\n mwl : float\n Still water level\n \n depth : float\n Water depth\n \n waveDir : list\n List of wave direction vector\n \n g : Numpy array\n Gravitational acceleration vector\n N : list\n List of numbers of frequency components\n bandFactor : list\n List of spectral band factors\n spectName : list\n List of names of spectral distribution\n spectral_params : list\n List of names of spectral distribution (see RandomWaves class)\n phi : list\n List of component phases\n fast : bool\n Switch for optimised functions \n ", /*tp_doc*/
62484  __pyx_tp_traverse_9WaveTools_MultiSpectraRandomWaves, /*tp_traverse*/
62485  __pyx_tp_clear_9WaveTools_MultiSpectraRandomWaves, /*tp_clear*/
62486  0, /*tp_richcompare*/
62487  0, /*tp_weaklistoffset*/
62488  0, /*tp_iter*/
62489  0, /*tp_iternext*/
62490  __pyx_methods_9WaveTools_MultiSpectraRandomWaves, /*tp_methods*/
62491  0, /*tp_members*/
62492  __pyx_getsets_9WaveTools_MultiSpectraRandomWaves, /*tp_getset*/
62493  0, /*tp_base*/
62494  0, /*tp_dict*/
62495  0, /*tp_descr_get*/
62496  0, /*tp_descr_set*/
62497  0, /*tp_dictoffset*/
62498  0, /*tp_init*/
62499  0, /*tp_alloc*/
62500  __pyx_tp_new_9WaveTools_MultiSpectraRandomWaves, /*tp_new*/
62501  0, /*tp_free*/
62502  0, /*tp_is_gc*/
62503  0, /*tp_bases*/
62504  0, /*tp_mro*/
62505  0, /*tp_cache*/
62506  0, /*tp_subclasses*/
62507  0, /*tp_weaklist*/
62508  0, /*tp_del*/
62509  0, /*tp_version_tag*/
62510  #if PY_VERSION_HEX >= 0x030400a1
62511  0, /*tp_finalize*/
62512  #endif
62513 };
62514 static struct __pyx_vtabstruct_9WaveTools_DirectionalWaves __pyx_vtable_9WaveTools_DirectionalWaves;
62515 
62516 static PyObject *__pyx_tp_new_9WaveTools_DirectionalWaves(PyTypeObject *t, PyObject *a, PyObject *k) {
62517  struct __pyx_obj_9WaveTools_DirectionalWaves *p;
62518  PyObject *o;
62519  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
62520  o = (*t->tp_alloc)(t, 0);
62521  } else {
62522  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
62523  }
62524  if (unlikely(!o)) return 0;
62525  p = ((struct __pyx_obj_9WaveTools_DirectionalWaves *)o);
62526  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_DirectionalWaves;
62527  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62528  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62529  p->tanh = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62530  p->waveDir0 = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62531  p->waveDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62532  p->phiDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62533  p->aiDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62534  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62535  p->kDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62536  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62537  if (unlikely(__pyx_pw_9WaveTools_16DirectionalWaves_1__cinit__(o, a, k) < 0)) goto bad;
62538  return o;
62539  bad:
62540  Py_DECREF(o); o = 0;
62541  return NULL;
62542 }
62543 
62544 static void __pyx_tp_dealloc_9WaveTools_DirectionalWaves(PyObject *o) {
62545  struct __pyx_obj_9WaveTools_DirectionalWaves *p = (struct __pyx_obj_9WaveTools_DirectionalWaves *)o;
62546  #if CYTHON_USE_TP_FINALIZE
62547  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
62548  if (PyObject_CallFinalizerFromDealloc(o)) return;
62549  }
62550  #endif
62551  PyObject_GC_UnTrack(o);
62552  Py_CLEAR(p->vDir);
62553  Py_CLEAR(p->omega);
62554  Py_CLEAR(p->tanh);
62555  Py_CLEAR(p->waveDir0);
62556  Py_CLEAR(p->waveDirs);
62557  Py_CLEAR(p->phiDirs);
62558  Py_CLEAR(p->aiDirs);
62559  Py_CLEAR(p->ki);
62560  Py_CLEAR(p->kDirs);
62561  Py_CLEAR(p->tanhF);
62562  (*Py_TYPE(o)->tp_free)(o);
62563 }
62564 
62565 static int __pyx_tp_traverse_9WaveTools_DirectionalWaves(PyObject *o, visitproc v, void *a) {
62566  int e;
62567  struct __pyx_obj_9WaveTools_DirectionalWaves *p = (struct __pyx_obj_9WaveTools_DirectionalWaves *)o;
62568  if (p->vDir) {
62569  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
62570  }
62571  if (p->omega) {
62572  e = (*v)(((PyObject *)p->omega), a); if (e) return e;
62573  }
62574  if (p->tanh) {
62575  e = (*v)(((PyObject *)p->tanh), a); if (e) return e;
62576  }
62577  if (p->waveDir0) {
62578  e = (*v)(((PyObject *)p->waveDir0), a); if (e) return e;
62579  }
62580  if (p->waveDirs) {
62581  e = (*v)(((PyObject *)p->waveDirs), a); if (e) return e;
62582  }
62583  if (p->phiDirs) {
62584  e = (*v)(((PyObject *)p->phiDirs), a); if (e) return e;
62585  }
62586  if (p->aiDirs) {
62587  e = (*v)(((PyObject *)p->aiDirs), a); if (e) return e;
62588  }
62589  if (p->ki) {
62590  e = (*v)(((PyObject *)p->ki), a); if (e) return e;
62591  }
62592  if (p->kDirs) {
62593  e = (*v)(((PyObject *)p->kDirs), a); if (e) return e;
62594  }
62595  if (p->tanhF) {
62596  e = (*v)(((PyObject *)p->tanhF), a); if (e) return e;
62597  }
62598  return 0;
62599 }
62600 
62601 static int __pyx_tp_clear_9WaveTools_DirectionalWaves(PyObject *o) {
62602  PyObject* tmp;
62603  struct __pyx_obj_9WaveTools_DirectionalWaves *p = (struct __pyx_obj_9WaveTools_DirectionalWaves *)o;
62604  tmp = ((PyObject*)p->vDir);
62605  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62606  Py_XDECREF(tmp);
62607  tmp = ((PyObject*)p->omega);
62608  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62609  Py_XDECREF(tmp);
62610  tmp = ((PyObject*)p->tanh);
62611  p->tanh = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62612  Py_XDECREF(tmp);
62613  tmp = ((PyObject*)p->waveDir0);
62614  p->waveDir0 = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62615  Py_XDECREF(tmp);
62616  tmp = ((PyObject*)p->waveDirs);
62617  p->waveDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62618  Py_XDECREF(tmp);
62619  tmp = ((PyObject*)p->phiDirs);
62620  p->phiDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62621  Py_XDECREF(tmp);
62622  tmp = ((PyObject*)p->aiDirs);
62623  p->aiDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62624  Py_XDECREF(tmp);
62625  tmp = ((PyObject*)p->ki);
62626  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62627  Py_XDECREF(tmp);
62628  tmp = ((PyObject*)p->kDirs);
62629  p->kDirs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62630  Py_XDECREF(tmp);
62631  tmp = ((PyObject*)p->tanhF);
62632  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62633  Py_XDECREF(tmp);
62634  return 0;
62635 }
62636 
62637 static PyObject *__pyx_getprop_9WaveTools_16DirectionalWaves_mwl(PyObject *o, CYTHON_UNUSED void *x) {
62638  return __pyx_pw_9WaveTools_16DirectionalWaves_3mwl_1__get__(o);
62639 }
62640 
62641 static int __pyx_setprop_9WaveTools_16DirectionalWaves_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62642  if (v) {
62643  return __pyx_pw_9WaveTools_16DirectionalWaves_3mwl_3__set__(o, v);
62644  }
62645  else {
62646  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62647  return -1;
62648  }
62649 }
62650 
62651 static PyObject *__pyx_getprop_9WaveTools_16DirectionalWaves_depth(PyObject *o, CYTHON_UNUSED void *x) {
62652  return __pyx_pw_9WaveTools_16DirectionalWaves_5depth_1__get__(o);
62653 }
62654 
62655 static int __pyx_setprop_9WaveTools_16DirectionalWaves_depth(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62656  if (v) {
62657  return __pyx_pw_9WaveTools_16DirectionalWaves_5depth_3__set__(o, v);
62658  }
62659  else {
62660  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62661  return -1;
62662  }
62663 }
62664 
62665 static PyMethodDef __pyx_methods_9WaveTools_DirectionalWaves[] = {
62666  {"eta", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_16DirectionalWaves_3eta, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_16DirectionalWaves_2eta},
62667  {"u", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_16DirectionalWaves_5u, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_16DirectionalWaves_4u},
62668  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_16DirectionalWaves_7__reduce_cython__, METH_NOARGS, 0},
62669  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_16DirectionalWaves_9__setstate_cython__, METH_O, 0},
62670  {0, 0, 0, 0}
62671 };
62672 
62673 static struct PyGetSetDef __pyx_getsets_9WaveTools_DirectionalWaves[] = {
62674  {(char *)"mwl", __pyx_getprop_9WaveTools_16DirectionalWaves_mwl, __pyx_setprop_9WaveTools_16DirectionalWaves_mwl, (char *)0, 0},
62675  {(char *)"depth", __pyx_getprop_9WaveTools_16DirectionalWaves_depth, __pyx_setprop_9WaveTools_16DirectionalWaves_depth, (char *)0, 0},
62676  {0, 0, 0, 0, 0}
62677 };
62678 
62679 static PyTypeObject __pyx_type_9WaveTools_DirectionalWaves = {
62680  PyVarObject_HEAD_INIT(0, 0)
62681  "WaveTools.DirectionalWaves", /*tp_name*/
62682  sizeof(struct __pyx_obj_9WaveTools_DirectionalWaves), /*tp_basicsize*/
62683  0, /*tp_itemsize*/
62684  __pyx_tp_dealloc_9WaveTools_DirectionalWaves, /*tp_dealloc*/
62685  0, /*tp_print*/
62686  0, /*tp_getattr*/
62687  0, /*tp_setattr*/
62688  #if PY_MAJOR_VERSION < 3
62689  0, /*tp_compare*/
62690  #endif
62691  #if PY_MAJOR_VERSION >= 3
62692  0, /*tp_as_async*/
62693  #endif
62694  0, /*tp_repr*/
62695  0, /*tp_as_number*/
62696  0, /*tp_as_sequence*/
62697  0, /*tp_as_mapping*/
62698  0, /*tp_hash*/
62699  0, /*tp_call*/
62700  0, /*tp_str*/
62701  0, /*tp_getattro*/
62702  0, /*tp_setattro*/
62703  0, /*tp_as_buffer*/
62704  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
62705  "\n This class is used for generating directional random waves using linear reconstruction of components from a\n wave spectrum\n\n Parameters\n ----------\n M : int\n Number of directional components\n Tp : float\n Peak wave period\n Hs : float\n Significant wave height\n mwl : float\n Still water level\n depth : float\n Water depth\n waveDir0 : numpy.ndarray\n Leading wave direction vector\n g : Numpy array\n Gravitational acceleration vector\n N : int\n Number of frequency components\n bandFactor : float\n Spectral band factor. fmax = bandFactor/Tp, fmin = 1/(bandFactor*Tp) \n spectName : string\n Name of spectral distribution\n spreadName : string\n Name of spreading distribution\n spectral_params : dict\n Dictionary of arguments specific to the spectral distribution (see RandomWaves class) \n spread_params : dict\n Dictionary of arguments specific to the spreading distribution\n Example for Cos-2s = {\"s\": 10}\n Example for Mitsuyashu-type = {\"fp\": 1/Tp, \"smax\":10}\n \n phi : numpy.ndarray\n Component phases (if set to None, phases are picked at random)\n \n phiSymm : bool\n Switch for enabling a symmetric phase allocation across directional components\n fast : bool\n Switch for enabling optimised functions \n\n ", /*tp_doc*/
62706  __pyx_tp_traverse_9WaveTools_DirectionalWaves, /*tp_traverse*/
62707  __pyx_tp_clear_9WaveTools_DirectionalWaves, /*tp_clear*/
62708  0, /*tp_richcompare*/
62709  0, /*tp_weaklistoffset*/
62710  0, /*tp_iter*/
62711  0, /*tp_iternext*/
62712  __pyx_methods_9WaveTools_DirectionalWaves, /*tp_methods*/
62713  0, /*tp_members*/
62714  __pyx_getsets_9WaveTools_DirectionalWaves, /*tp_getset*/
62715  0, /*tp_base*/
62716  0, /*tp_dict*/
62717  0, /*tp_descr_get*/
62718  0, /*tp_descr_set*/
62719  0, /*tp_dictoffset*/
62720  0, /*tp_init*/
62721  0, /*tp_alloc*/
62722  __pyx_tp_new_9WaveTools_DirectionalWaves, /*tp_new*/
62723  0, /*tp_free*/
62724  0, /*tp_is_gc*/
62725  0, /*tp_bases*/
62726  0, /*tp_mro*/
62727  0, /*tp_cache*/
62728  0, /*tp_subclasses*/
62729  0, /*tp_weaklist*/
62730  0, /*tp_del*/
62731  0, /*tp_version_tag*/
62732  #if PY_VERSION_HEX >= 0x030400a1
62733  0, /*tp_finalize*/
62734  #endif
62735 };
62736 static struct __pyx_vtabstruct_9WaveTools_TimeSeries __pyx_vtable_9WaveTools_TimeSeries;
62737 
62738 static PyObject *__pyx_tp_new_9WaveTools_TimeSeries(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
62739  struct __pyx_obj_9WaveTools_TimeSeries *p;
62740  PyObject *o;
62741  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
62742  o = (*t->tp_alloc)(t, 0);
62743  } else {
62744  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
62745  }
62746  if (unlikely(!o)) return 0;
62747  p = ((struct __pyx_obj_9WaveTools_TimeSeries *)o);
62748  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_TimeSeries;
62749  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62750  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62751  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62752  p->x0 = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62753  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62754  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62755  p->time = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62756  p->etaS = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62757  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62758  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62759  p->phi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62760  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62761  p->windows_handover = ((PyObject*)Py_None); Py_INCREF(Py_None);
62762  p->windows_rec = ((PyObject*)Py_None); Py_INCREF(Py_None);
62763  p->decompose_window = ((PyObject*)Py_None); Py_INCREF(Py_None);
62764  p->eta = Py_None; Py_INCREF(Py_None);
62765  p->u = Py_None; Py_INCREF(Py_None);
62766  return o;
62767 }
62768 
62769 static void __pyx_tp_dealloc_9WaveTools_TimeSeries(PyObject *o) {
62770  struct __pyx_obj_9WaveTools_TimeSeries *p = (struct __pyx_obj_9WaveTools_TimeSeries *)o;
62771  #if CYTHON_USE_TP_FINALIZE
62772  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
62773  if (PyObject_CallFinalizerFromDealloc(o)) return;
62774  }
62775  #endif
62776  PyObject_GC_UnTrack(o);
62777  Py_CLEAR(p->g);
62778  Py_CLEAR(p->waveDir);
62779  Py_CLEAR(p->vDir);
62780  Py_CLEAR(p->x0);
62781  Py_CLEAR(p->kDir);
62782  Py_CLEAR(p->tanhF);
62783  Py_CLEAR(p->time);
62784  Py_CLEAR(p->etaS);
62785  Py_CLEAR(p->ai);
62786  Py_CLEAR(p->omega);
62787  Py_CLEAR(p->phi);
62788  Py_CLEAR(p->ki);
62789  Py_CLEAR(p->windows_handover);
62790  Py_CLEAR(p->windows_rec);
62791  Py_CLEAR(p->decompose_window);
62792  Py_CLEAR(p->eta);
62793  Py_CLEAR(p->u);
62794  (*Py_TYPE(o)->tp_free)(o);
62795 }
62796 
62797 static int __pyx_tp_traverse_9WaveTools_TimeSeries(PyObject *o, visitproc v, void *a) {
62798  int e;
62799  struct __pyx_obj_9WaveTools_TimeSeries *p = (struct __pyx_obj_9WaveTools_TimeSeries *)o;
62800  if (p->g) {
62801  e = (*v)(((PyObject *)p->g), a); if (e) return e;
62802  }
62803  if (p->waveDir) {
62804  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
62805  }
62806  if (p->vDir) {
62807  e = (*v)(((PyObject *)p->vDir), a); if (e) return e;
62808  }
62809  if (p->x0) {
62810  e = (*v)(((PyObject *)p->x0), a); if (e) return e;
62811  }
62812  if (p->kDir) {
62813  e = (*v)(((PyObject *)p->kDir), a); if (e) return e;
62814  }
62815  if (p->tanhF) {
62816  e = (*v)(((PyObject *)p->tanhF), a); if (e) return e;
62817  }
62818  if (p->time) {
62819  e = (*v)(((PyObject *)p->time), a); if (e) return e;
62820  }
62821  if (p->etaS) {
62822  e = (*v)(((PyObject *)p->etaS), a); if (e) return e;
62823  }
62824  if (p->ai) {
62825  e = (*v)(((PyObject *)p->ai), a); if (e) return e;
62826  }
62827  if (p->omega) {
62828  e = (*v)(((PyObject *)p->omega), a); if (e) return e;
62829  }
62830  if (p->phi) {
62831  e = (*v)(((PyObject *)p->phi), a); if (e) return e;
62832  }
62833  if (p->ki) {
62834  e = (*v)(((PyObject *)p->ki), a); if (e) return e;
62835  }
62836  if (p->windows_handover) {
62837  e = (*v)(p->windows_handover, a); if (e) return e;
62838  }
62839  if (p->windows_rec) {
62840  e = (*v)(p->windows_rec, a); if (e) return e;
62841  }
62842  if (p->decompose_window) {
62843  e = (*v)(p->decompose_window, a); if (e) return e;
62844  }
62845  if (p->eta) {
62846  e = (*v)(p->eta, a); if (e) return e;
62847  }
62848  if (p->u) {
62849  e = (*v)(p->u, a); if (e) return e;
62850  }
62851  return 0;
62852 }
62853 
62854 static int __pyx_tp_clear_9WaveTools_TimeSeries(PyObject *o) {
62855  PyObject* tmp;
62856  struct __pyx_obj_9WaveTools_TimeSeries *p = (struct __pyx_obj_9WaveTools_TimeSeries *)o;
62857  tmp = ((PyObject*)p->g);
62858  p->g = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62859  Py_XDECREF(tmp);
62860  tmp = ((PyObject*)p->waveDir);
62861  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62862  Py_XDECREF(tmp);
62863  tmp = ((PyObject*)p->vDir);
62864  p->vDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62865  Py_XDECREF(tmp);
62866  tmp = ((PyObject*)p->x0);
62867  p->x0 = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62868  Py_XDECREF(tmp);
62869  tmp = ((PyObject*)p->kDir);
62870  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62871  Py_XDECREF(tmp);
62872  tmp = ((PyObject*)p->tanhF);
62873  p->tanhF = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62874  Py_XDECREF(tmp);
62875  tmp = ((PyObject*)p->time);
62876  p->time = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62877  Py_XDECREF(tmp);
62878  tmp = ((PyObject*)p->etaS);
62879  p->etaS = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62880  Py_XDECREF(tmp);
62881  tmp = ((PyObject*)p->ai);
62882  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62883  Py_XDECREF(tmp);
62884  tmp = ((PyObject*)p->omega);
62885  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62886  Py_XDECREF(tmp);
62887  tmp = ((PyObject*)p->phi);
62888  p->phi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62889  Py_XDECREF(tmp);
62890  tmp = ((PyObject*)p->ki);
62891  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
62892  Py_XDECREF(tmp);
62893  tmp = ((PyObject*)p->windows_handover);
62894  p->windows_handover = ((PyObject*)Py_None); Py_INCREF(Py_None);
62895  Py_XDECREF(tmp);
62896  tmp = ((PyObject*)p->windows_rec);
62897  p->windows_rec = ((PyObject*)Py_None); Py_INCREF(Py_None);
62898  Py_XDECREF(tmp);
62899  tmp = ((PyObject*)p->decompose_window);
62900  p->decompose_window = ((PyObject*)Py_None); Py_INCREF(Py_None);
62901  Py_XDECREF(tmp);
62902  tmp = ((PyObject*)p->eta);
62903  p->eta = Py_None; Py_INCREF(Py_None);
62904  Py_XDECREF(tmp);
62905  tmp = ((PyObject*)p->u);
62906  p->u = Py_None; Py_INCREF(Py_None);
62907  Py_XDECREF(tmp);
62908  return 0;
62909 }
62910 
62911 static PyObject *__pyx_getprop_9WaveTools_10TimeSeries_wavelength(PyObject *o, CYTHON_UNUSED void *x) {
62912  return __pyx_pw_9WaveTools_10TimeSeries_10wavelength_1__get__(o);
62913 }
62914 
62915 static int __pyx_setprop_9WaveTools_10TimeSeries_wavelength(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62916  if (v) {
62917  return __pyx_pw_9WaveTools_10TimeSeries_10wavelength_3__set__(o, v);
62918  }
62919  else {
62920  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62921  return -1;
62922  }
62923 }
62924 
62925 static PyObject *__pyx_getprop_9WaveTools_10TimeSeries_mwl(PyObject *o, CYTHON_UNUSED void *x) {
62926  return __pyx_pw_9WaveTools_10TimeSeries_3mwl_1__get__(o);
62927 }
62928 
62929 static int __pyx_setprop_9WaveTools_10TimeSeries_mwl(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62930  if (v) {
62931  return __pyx_pw_9WaveTools_10TimeSeries_3mwl_3__set__(o, v);
62932  }
62933  else {
62934  PyErr_SetString(PyExc_NotImplementedError, "__del__");
62935  return -1;
62936  }
62937 }
62938 
62939 static PyObject *__pyx_getprop_9WaveTools_10TimeSeries_eta(PyObject *o, CYTHON_UNUSED void *x) {
62940  return __pyx_pw_9WaveTools_10TimeSeries_3eta_1__get__(o);
62941 }
62942 
62943 static int __pyx_setprop_9WaveTools_10TimeSeries_eta(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62944  if (v) {
62945  return __pyx_pw_9WaveTools_10TimeSeries_3eta_3__set__(o, v);
62946  }
62947  else {
62948  return __pyx_pw_9WaveTools_10TimeSeries_3eta_5__del__(o);
62949  }
62950 }
62951 
62952 static PyObject *__pyx_getprop_9WaveTools_10TimeSeries_u(PyObject *o, CYTHON_UNUSED void *x) {
62953  return __pyx_pw_9WaveTools_10TimeSeries_1u_1__get__(o);
62954 }
62955 
62956 static int __pyx_setprop_9WaveTools_10TimeSeries_u(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
62957  if (v) {
62958  return __pyx_pw_9WaveTools_10TimeSeries_1u_3__set__(o, v);
62959  }
62960  else {
62961  return __pyx_pw_9WaveTools_10TimeSeries_1u_5__del__(o);
62962  }
62963 }
62964 
62965 static PyMethodDef __pyx_methods_9WaveTools_TimeSeries[] = {
62966  {"windOut", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_3windOut, METH_NOARGS, 0},
62967  {"etaDirect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_5etaDirect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_4etaDirect},
62968  {"uDirect", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_7uDirect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_6uDirect},
62969  {"findWindow", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_9findWindow, METH_O, __pyx_doc_9WaveTools_10TimeSeries_8findWindow},
62970  {"etaWindow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_11etaWindow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_10etaWindow},
62971  {"uWindow", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_10TimeSeries_13uWindow, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_10TimeSeries_12uWindow},
62972  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_15__reduce_cython__, METH_NOARGS, 0},
62973  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_10TimeSeries_17__setstate_cython__, METH_O, 0},
62974  {0, 0, 0, 0}
62975 };
62976 
62977 static struct PyGetSetDef __pyx_getsets_9WaveTools_TimeSeries[] = {
62978  {(char *)"wavelength", __pyx_getprop_9WaveTools_10TimeSeries_wavelength, __pyx_setprop_9WaveTools_10TimeSeries_wavelength, (char *)0, 0},
62979  {(char *)"mwl", __pyx_getprop_9WaveTools_10TimeSeries_mwl, __pyx_setprop_9WaveTools_10TimeSeries_mwl, (char *)0, 0},
62980  {(char *)"eta", __pyx_getprop_9WaveTools_10TimeSeries_eta, __pyx_setprop_9WaveTools_10TimeSeries_eta, (char *)0, 0},
62981  {(char *)"u", __pyx_getprop_9WaveTools_10TimeSeries_u, __pyx_setprop_9WaveTools_10TimeSeries_u, (char *)0, 0},
62982  {0, 0, 0, 0, 0}
62983 };
62984 
62985 static PyTypeObject __pyx_type_9WaveTools_TimeSeries = {
62986  PyVarObject_HEAD_INIT(0, 0)
62987  "WaveTools.TimeSeries", /*tp_name*/
62988  sizeof(struct __pyx_obj_9WaveTools_TimeSeries), /*tp_basicsize*/
62989  0, /*tp_itemsize*/
62990  __pyx_tp_dealloc_9WaveTools_TimeSeries, /*tp_dealloc*/
62991  0, /*tp_print*/
62992  0, /*tp_getattr*/
62993  0, /*tp_setattr*/
62994  #if PY_MAJOR_VERSION < 3
62995  0, /*tp_compare*/
62996  #endif
62997  #if PY_MAJOR_VERSION >= 3
62998  0, /*tp_as_async*/
62999  #endif
63000  0, /*tp_repr*/
63001  0, /*tp_as_number*/
63002  0, /*tp_as_sequence*/
63003  0, /*tp_as_mapping*/
63004  0, /*tp_hash*/
63005  0, /*tp_call*/
63006  0, /*tp_str*/
63007  0, /*tp_getattro*/
63008  0, /*tp_setattro*/
63009  0, /*tp_as_buffer*/
63010  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
63011  "This class is used for generating waves from an arbirtrary free-surface elevation time series\n\n Parameters\n ----------\n timeSeriesFile : string\n Time series file name (csv or txt)\n skiprows : int\n Number of header rows in time series file \n timeSeriesPosition : numpy.ndarrat\n Coordinates of the gauge / signal location \n depth : float\n Water depth \n N : int\n Number of frequency components\n mwl : float\n Still water level \n waveDir : numpy.ndarray\n Leading wave direction vector \n g : Numpy array\n Gravitational acceleration vector \n cutoffTotal : float\n Cut off fraction, applied both at the leading and tailing parts of the series \n rec_direct : bool\n Switch for activating direct decomposition\n window_params : dict\n Dictionary of parameters for window method\n e.g. window_params = {\"Nwaves\":15, \"Tm\": Tp/1.1, \"Window\":\"costap\"} (minimum parameters required)\n e.g. window_params = {\"Nwaves\":15, \"Tm\": Tp/1.1, \"Window\":\"costap\", \"Overlap\":0.5, \"Cutoff\":0.2} (full range of parameters)\n \n arrayData : bool\n Switch for passing the time series as an array (False by default)\n seriesArray : numpy.ndarray\n Free surface elevation time series given in an array format (None by default) \n fast : bool\n Switch for enabling optimised functions \n\n ", /*tp_doc*/
63012  __pyx_tp_traverse_9WaveTools_TimeSeries, /*tp_traverse*/
63013  __pyx_tp_clear_9WaveTools_TimeSeries, /*tp_clear*/
63014  0, /*tp_richcompare*/
63015  0, /*tp_weaklistoffset*/
63016  0, /*tp_iter*/
63017  0, /*tp_iternext*/
63018  __pyx_methods_9WaveTools_TimeSeries, /*tp_methods*/
63019  0, /*tp_members*/
63020  __pyx_getsets_9WaveTools_TimeSeries, /*tp_getset*/
63021  0, /*tp_base*/
63022  0, /*tp_dict*/
63023  0, /*tp_descr_get*/
63024  0, /*tp_descr_set*/
63025  0, /*tp_dictoffset*/
63026  __pyx_pw_9WaveTools_10TimeSeries_1__init__, /*tp_init*/
63027  0, /*tp_alloc*/
63028  __pyx_tp_new_9WaveTools_TimeSeries, /*tp_new*/
63029  0, /*tp_free*/
63030  0, /*tp_is_gc*/
63031  0, /*tp_bases*/
63032  0, /*tp_mro*/
63033  0, /*tp_cache*/
63034  0, /*tp_subclasses*/
63035  0, /*tp_weaklist*/
63036  0, /*tp_del*/
63037  0, /*tp_version_tag*/
63038  #if PY_VERSION_HEX >= 0x030400a1
63039  0, /*tp_finalize*/
63040  #endif
63041 };
63042 static struct __pyx_vtabstruct_9WaveTools_RandomNLWaves __pyx_vtable_9WaveTools_RandomNLWaves;
63043 
63044 static PyObject *__pyx_tp_new_9WaveTools_RandomNLWaves(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
63045  struct __pyx_obj_9WaveTools_RandomNLWaves *p;
63046  PyObject *o;
63047  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
63048  o = (*t->tp_alloc)(t, 0);
63049  } else {
63050  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
63051  }
63052  if (unlikely(!o)) return 0;
63053  p = ((struct __pyx_obj_9WaveTools_RandomNLWaves *)o);
63054  p->__pyx_vtab = __pyx_vtabptr_9WaveTools_RandomNLWaves;
63055  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63056  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63057  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63058  p->phi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63059  p->tanhKd = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63060  p->sinhKd = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63061  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63062  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63063  p->eta = Py_None; Py_INCREF(Py_None);
63064  p->u = Py_None; Py_INCREF(Py_None);
63065  p->eta_linear = Py_None; Py_INCREF(Py_None);
63066  return o;
63067 }
63068 
63069 static void __pyx_tp_dealloc_9WaveTools_RandomNLWaves(PyObject *o) {
63070  struct __pyx_obj_9WaveTools_RandomNLWaves *p = (struct __pyx_obj_9WaveTools_RandomNLWaves *)o;
63071  #if CYTHON_USE_TP_FINALIZE
63072  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
63073  if (PyObject_CallFinalizerFromDealloc(o)) return;
63074  }
63075  #endif
63076  PyObject_GC_UnTrack(o);
63077  Py_CLEAR(p->omega);
63078  Py_CLEAR(p->ki);
63079  Py_CLEAR(p->kDir);
63080  Py_CLEAR(p->phi);
63081  Py_CLEAR(p->tanhKd);
63082  Py_CLEAR(p->sinhKd);
63083  Py_CLEAR(p->waveDir);
63084  Py_CLEAR(p->ai);
63085  Py_CLEAR(p->eta);
63086  Py_CLEAR(p->u);
63087  Py_CLEAR(p->eta_linear);
63088  (*Py_TYPE(o)->tp_free)(o);
63089 }
63090 
63091 static int __pyx_tp_traverse_9WaveTools_RandomNLWaves(PyObject *o, visitproc v, void *a) {
63092  int e;
63093  struct __pyx_obj_9WaveTools_RandomNLWaves *p = (struct __pyx_obj_9WaveTools_RandomNLWaves *)o;
63094  if (p->omega) {
63095  e = (*v)(((PyObject *)p->omega), a); if (e) return e;
63096  }
63097  if (p->ki) {
63098  e = (*v)(((PyObject *)p->ki), a); if (e) return e;
63099  }
63100  if (p->kDir) {
63101  e = (*v)(((PyObject *)p->kDir), a); if (e) return e;
63102  }
63103  if (p->phi) {
63104  e = (*v)(((PyObject *)p->phi), a); if (e) return e;
63105  }
63106  if (p->tanhKd) {
63107  e = (*v)(((PyObject *)p->tanhKd), a); if (e) return e;
63108  }
63109  if (p->sinhKd) {
63110  e = (*v)(((PyObject *)p->sinhKd), a); if (e) return e;
63111  }
63112  if (p->waveDir) {
63113  e = (*v)(((PyObject *)p->waveDir), a); if (e) return e;
63114  }
63115  if (p->ai) {
63116  e = (*v)(((PyObject *)p->ai), a); if (e) return e;
63117  }
63118  if (p->eta) {
63119  e = (*v)(p->eta, a); if (e) return e;
63120  }
63121  if (p->u) {
63122  e = (*v)(p->u, a); if (e) return e;
63123  }
63124  if (p->eta_linear) {
63125  e = (*v)(p->eta_linear, a); if (e) return e;
63126  }
63127  return 0;
63128 }
63129 
63130 static int __pyx_tp_clear_9WaveTools_RandomNLWaves(PyObject *o) {
63131  PyObject* tmp;
63132  struct __pyx_obj_9WaveTools_RandomNLWaves *p = (struct __pyx_obj_9WaveTools_RandomNLWaves *)o;
63133  tmp = ((PyObject*)p->omega);
63134  p->omega = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63135  Py_XDECREF(tmp);
63136  tmp = ((PyObject*)p->ki);
63137  p->ki = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63138  Py_XDECREF(tmp);
63139  tmp = ((PyObject*)p->kDir);
63140  p->kDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63141  Py_XDECREF(tmp);
63142  tmp = ((PyObject*)p->phi);
63143  p->phi = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63144  Py_XDECREF(tmp);
63145  tmp = ((PyObject*)p->tanhKd);
63146  p->tanhKd = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63147  Py_XDECREF(tmp);
63148  tmp = ((PyObject*)p->sinhKd);
63149  p->sinhKd = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63150  Py_XDECREF(tmp);
63151  tmp = ((PyObject*)p->waveDir);
63152  p->waveDir = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63153  Py_XDECREF(tmp);
63154  tmp = ((PyObject*)p->ai);
63155  p->ai = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
63156  Py_XDECREF(tmp);
63157  tmp = ((PyObject*)p->eta);
63158  p->eta = Py_None; Py_INCREF(Py_None);
63159  Py_XDECREF(tmp);
63160  tmp = ((PyObject*)p->u);
63161  p->u = Py_None; Py_INCREF(Py_None);
63162  Py_XDECREF(tmp);
63163  tmp = ((PyObject*)p->eta_linear);
63164  p->eta_linear = Py_None; Py_INCREF(Py_None);
63165  Py_XDECREF(tmp);
63166  return 0;
63167 }
63168 
63169 static PyObject *__pyx_getprop_9WaveTools_13RandomNLWaves_eta(PyObject *o, CYTHON_UNUSED void *x) {
63170  return __pyx_pw_9WaveTools_13RandomNLWaves_3eta_1__get__(o);
63171 }
63172 
63173 static int __pyx_setprop_9WaveTools_13RandomNLWaves_eta(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
63174  if (v) {
63175  return __pyx_pw_9WaveTools_13RandomNLWaves_3eta_3__set__(o, v);
63176  }
63177  else {
63178  return __pyx_pw_9WaveTools_13RandomNLWaves_3eta_5__del__(o);
63179  }
63180 }
63181 
63182 static PyObject *__pyx_getprop_9WaveTools_13RandomNLWaves_u(PyObject *o, CYTHON_UNUSED void *x) {
63183  return __pyx_pw_9WaveTools_13RandomNLWaves_1u_1__get__(o);
63184 }
63185 
63186 static int __pyx_setprop_9WaveTools_13RandomNLWaves_u(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
63187  if (v) {
63188  return __pyx_pw_9WaveTools_13RandomNLWaves_1u_3__set__(o, v);
63189  }
63190  else {
63191  return __pyx_pw_9WaveTools_13RandomNLWaves_1u_5__del__(o);
63192  }
63193 }
63194 
63195 static PyObject *__pyx_getprop_9WaveTools_13RandomNLWaves_eta_linear(PyObject *o, CYTHON_UNUSED void *x) {
63196  return __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_1__get__(o);
63197 }
63198 
63199 static int __pyx_setprop_9WaveTools_13RandomNLWaves_eta_linear(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
63200  if (v) {
63201  return __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_3__set__(o, v);
63202  }
63203  else {
63204  return __pyx_pw_9WaveTools_13RandomNLWaves_10eta_linear_5__del__(o);
63205  }
63206 }
63207 
63208 static PyMethodDef __pyx_methods_9WaveTools_RandomNLWaves[] = {
63209  {"eta_2ndOrder", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_3eta_2ndOrder, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_2eta_2ndOrder},
63210  {"eta_short", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_5eta_short, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_4eta_short},
63211  {"eta_long", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_7eta_long, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_6eta_long},
63212  {"eta_setUp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_9eta_setUp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_8eta_setUp},
63213  {"eta_overall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_11eta_overall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_10eta_overall},
63214  {"writeEtaSeries", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_13writeEtaSeries, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_12writeEtaSeries},
63215  {"wtError", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_9WaveTools_13RandomNLWaves_15wtError, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9WaveTools_13RandomNLWaves_14wtError},
63216  {"__reduce_cython__", (PyCFunction)__pyx_pw_9WaveTools_13RandomNLWaves_17__reduce_cython__, METH_NOARGS, 0},
63217  {"__setstate_cython__", (PyCFunction)__pyx_pw_9WaveTools_13RandomNLWaves_19__setstate_cython__, METH_O, 0},
63218  {0, 0, 0, 0}
63219 };
63220 
63221 static struct PyGetSetDef __pyx_getsets_9WaveTools_RandomNLWaves[] = {
63222  {(char *)"eta", __pyx_getprop_9WaveTools_13RandomNLWaves_eta, __pyx_setprop_9WaveTools_13RandomNLWaves_eta, (char *)0, 0},
63223  {(char *)"u", __pyx_getprop_9WaveTools_13RandomNLWaves_u, __pyx_setprop_9WaveTools_13RandomNLWaves_u, (char *)0, 0},
63224  {(char *)"eta_linear", __pyx_getprop_9WaveTools_13RandomNLWaves_eta_linear, __pyx_setprop_9WaveTools_13RandomNLWaves_eta_linear, (char *)0, 0},
63225  {0, 0, 0, 0, 0}
63226 };
63227 
63228 static PyTypeObject __pyx_type_9WaveTools_RandomNLWaves = {
63229  PyVarObject_HEAD_INIT(0, 0)
63230  "WaveTools.RandomNLWaves", /*tp_name*/
63231  sizeof(struct __pyx_obj_9WaveTools_RandomNLWaves), /*tp_basicsize*/
63232  0, /*tp_itemsize*/
63233  __pyx_tp_dealloc_9WaveTools_RandomNLWaves, /*tp_dealloc*/
63234  0, /*tp_print*/
63235  0, /*tp_getattr*/
63236  0, /*tp_setattr*/
63237  #if PY_MAJOR_VERSION < 3
63238  0, /*tp_compare*/
63239  #endif
63240  #if PY_MAJOR_VERSION >= 3
63241  0, /*tp_as_async*/
63242  #endif
63243  0, /*tp_repr*/
63244  0, /*tp_as_number*/
63245  0, /*tp_as_sequence*/
63246  0, /*tp_as_mapping*/
63247  0, /*tp_hash*/
63248  0, /*tp_call*/
63249  0, /*tp_str*/
63250  0, /*tp_getattro*/
63251  0, /*tp_setattro*/
63252  0, /*tp_as_buffer*/
63253  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
63254  "\n This class is contains functions for calculating random waves with 2nd order corrections\n\n Parameters\n ----------\n Tstart : float\n Start time\n Tend : float\n End time\n Tp : float\n Peak wave period\n Hs : float\n Significant wave height\n mwl : float\n Still water level\n depth : float\n Water depth\n waveDir : numpy.ndarray\n Wave direction vector\n g : Numpy array\n Gravitational acceleration vector\n N : int\n Number of frequency components\n bandFactor : float\n Spectral band factor. fmax = bandFactor/Tp, fmin = 1/(bandFactor*Tp)\n spectName : string\n Name of spectral distribution\n spectral_params : dict\n Dictionary of arguments specific to the spectral distribution\n Example for JONSWAP = {\"gamma\": 3.3, \"TMA\":True,\"depth\": depth}\n TMA=True activates the TMA modification, which in turn needs the depth as a parameter \n phi : numpy.ndarray\n Component phases (if set to None, phases are picked at random) \n fast : bool\n Switch for enabling optimised functions \n ", /*tp_doc*/
63255  __pyx_tp_traverse_9WaveTools_RandomNLWaves, /*tp_traverse*/
63256  __pyx_tp_clear_9WaveTools_RandomNLWaves, /*tp_clear*/
63257  0, /*tp_richcompare*/
63258  0, /*tp_weaklistoffset*/
63259  0, /*tp_iter*/
63260  0, /*tp_iternext*/
63261  __pyx_methods_9WaveTools_RandomNLWaves, /*tp_methods*/
63262  0, /*tp_members*/
63263  __pyx_getsets_9WaveTools_RandomNLWaves, /*tp_getset*/
63264  0, /*tp_base*/
63265  0, /*tp_dict*/
63266  0, /*tp_descr_get*/
63267  0, /*tp_descr_set*/
63268  0, /*tp_dictoffset*/
63269  __pyx_pw_9WaveTools_13RandomNLWaves_1__init__, /*tp_init*/
63270  0, /*tp_alloc*/
63271  __pyx_tp_new_9WaveTools_RandomNLWaves, /*tp_new*/
63272  0, /*tp_free*/
63273  0, /*tp_is_gc*/
63274  0, /*tp_bases*/
63275  0, /*tp_mro*/
63276  0, /*tp_cache*/
63277  0, /*tp_subclasses*/
63278  0, /*tp_weaklist*/
63279  0, /*tp_del*/
63280  0, /*tp_version_tag*/
63281  #if PY_VERSION_HEX >= 0x030400a1
63282  0, /*tp_finalize*/
63283  #endif
63284 };
63285 
63286 static struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *__pyx_freelist_9WaveTools___pyx_scope_struct____cinit__[8];
63287 static int __pyx_freecount_9WaveTools___pyx_scope_struct____cinit__ = 0;
63288 
63289 static PyObject *__pyx_tp_new_9WaveTools___pyx_scope_struct____cinit__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
63290  PyObject *o;
63291  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9WaveTools___pyx_scope_struct____cinit__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__)))) {
63292  o = (PyObject*)__pyx_freelist_9WaveTools___pyx_scope_struct____cinit__[--__pyx_freecount_9WaveTools___pyx_scope_struct____cinit__];
63293  memset(o, 0, sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__));
63294  (void) PyObject_INIT(o, t);
63295  PyObject_GC_Track(o);
63296  } else {
63297  o = (*t->tp_alloc)(t, 0);
63298  if (unlikely(!o)) return 0;
63299  }
63300  return o;
63301 }
63302 
63303 static void __pyx_tp_dealloc_9WaveTools___pyx_scope_struct____cinit__(PyObject *o) {
63304  struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *)o;
63305  PyObject_GC_UnTrack(o);
63306  Py_CLEAR(p->__pyx_v_self);
63307  Py_CLEAR(p->__pyx_v_xfocus);
63308  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9WaveTools___pyx_scope_struct____cinit__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__)))) {
63309  __pyx_freelist_9WaveTools___pyx_scope_struct____cinit__[__pyx_freecount_9WaveTools___pyx_scope_struct____cinit__++] = ((struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *)o);
63310  } else {
63311  (*Py_TYPE(o)->tp_free)(o);
63312  }
63313 }
63314 
63315 static int __pyx_tp_traverse_9WaveTools___pyx_scope_struct____cinit__(PyObject *o, visitproc v, void *a) {
63316  int e;
63317  struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *)o;
63318  if (p->__pyx_v_self) {
63319  e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
63320  }
63321  if (p->__pyx_v_xfocus) {
63322  e = (*v)(p->__pyx_v_xfocus, a); if (e) return e;
63323  }
63324  return 0;
63325 }
63326 
63327 static int __pyx_tp_clear_9WaveTools___pyx_scope_struct____cinit__(PyObject *o) {
63328  PyObject* tmp;
63329  struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *p = (struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__ *)o;
63330  tmp = ((PyObject*)p->__pyx_v_self);
63331  p->__pyx_v_self = ((struct __pyx_obj_9WaveTools_NewWave *)Py_None); Py_INCREF(Py_None);
63332  Py_XDECREF(tmp);
63333  tmp = ((PyObject*)p->__pyx_v_xfocus);
63334  p->__pyx_v_xfocus = Py_None; Py_INCREF(Py_None);
63335  Py_XDECREF(tmp);
63336  return 0;
63337 }
63338 
63339 static PyTypeObject __pyx_type_9WaveTools___pyx_scope_struct____cinit__ = {
63340  PyVarObject_HEAD_INIT(0, 0)
63341  "WaveTools.__pyx_scope_struct____cinit__", /*tp_name*/
63342  sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct____cinit__), /*tp_basicsize*/
63343  0, /*tp_itemsize*/
63344  __pyx_tp_dealloc_9WaveTools___pyx_scope_struct____cinit__, /*tp_dealloc*/
63345  0, /*tp_print*/
63346  0, /*tp_getattr*/
63347  0, /*tp_setattr*/
63348  #if PY_MAJOR_VERSION < 3
63349  0, /*tp_compare*/
63350  #endif
63351  #if PY_MAJOR_VERSION >= 3
63352  0, /*tp_as_async*/
63353  #endif
63354  0, /*tp_repr*/
63355  0, /*tp_as_number*/
63356  0, /*tp_as_sequence*/
63357  0, /*tp_as_mapping*/
63358  0, /*tp_hash*/
63359  0, /*tp_call*/
63360  0, /*tp_str*/
63361  0, /*tp_getattro*/
63362  0, /*tp_setattro*/
63363  0, /*tp_as_buffer*/
63364  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
63365  0, /*tp_doc*/
63366  __pyx_tp_traverse_9WaveTools___pyx_scope_struct____cinit__, /*tp_traverse*/
63367  __pyx_tp_clear_9WaveTools___pyx_scope_struct____cinit__, /*tp_clear*/
63368  0, /*tp_richcompare*/
63369  0, /*tp_weaklistoffset*/
63370  0, /*tp_iter*/
63371  0, /*tp_iternext*/
63372  0, /*tp_methods*/
63373  0, /*tp_members*/
63374  0, /*tp_getset*/
63375  0, /*tp_base*/
63376  0, /*tp_dict*/
63377  0, /*tp_descr_get*/
63378  0, /*tp_descr_set*/
63379  0, /*tp_dictoffset*/
63380  0, /*tp_init*/
63381  0, /*tp_alloc*/
63382  __pyx_tp_new_9WaveTools___pyx_scope_struct____cinit__, /*tp_new*/
63383  0, /*tp_free*/
63384  0, /*tp_is_gc*/
63385  0, /*tp_bases*/
63386  0, /*tp_mro*/
63387  0, /*tp_cache*/
63388  0, /*tp_subclasses*/
63389  0, /*tp_weaklist*/
63390  0, /*tp_del*/
63391  0, /*tp_version_tag*/
63392  #if PY_VERSION_HEX >= 0x030400a1
63393  0, /*tp_finalize*/
63394  #endif
63395 };
63396 
63397 static struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *__pyx_freelist_9WaveTools___pyx_scope_struct_1_genexpr[8];
63398 static int __pyx_freecount_9WaveTools___pyx_scope_struct_1_genexpr = 0;
63399 
63400 static PyObject *__pyx_tp_new_9WaveTools___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
63401  PyObject *o;
63402  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9WaveTools___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr)))) {
63403  o = (PyObject*)__pyx_freelist_9WaveTools___pyx_scope_struct_1_genexpr[--__pyx_freecount_9WaveTools___pyx_scope_struct_1_genexpr];
63404  memset(o, 0, sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr));
63405  (void) PyObject_INIT(o, t);
63406  PyObject_GC_Track(o);
63407  } else {
63408  o = (*t->tp_alloc)(t, 0);
63409  if (unlikely(!o)) return 0;
63410  }
63411  return o;
63412 }
63413 
63414 static void __pyx_tp_dealloc_9WaveTools___pyx_scope_struct_1_genexpr(PyObject *o) {
63415  struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *)o;
63416  PyObject_GC_UnTrack(o);
63417  Py_CLEAR(p->__pyx_outer_scope);
63418  Py_CLEAR(p->__pyx_v_j);
63419  Py_CLEAR(p->__pyx_t_0);
63420  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9WaveTools___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr)))) {
63421  __pyx_freelist_9WaveTools___pyx_scope_struct_1_genexpr[__pyx_freecount_9WaveTools___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *)o);
63422  } else {
63423  (*Py_TYPE(o)->tp_free)(o);
63424  }
63425 }
63426 
63427 static int __pyx_tp_traverse_9WaveTools___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
63428  int e;
63429  struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr *)o;
63430  if (p->__pyx_outer_scope) {
63431  e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
63432  }
63433  if (p->__pyx_v_j) {
63434  e = (*v)(p->__pyx_v_j, a); if (e) return e;
63435  }
63436  if (p->__pyx_t_0) {
63437  e = (*v)(p->__pyx_t_0, a); if (e) return e;
63438  }
63439  return 0;
63440 }
63441 
63442 static PyTypeObject __pyx_type_9WaveTools___pyx_scope_struct_1_genexpr = {
63443  PyVarObject_HEAD_INIT(0, 0)
63444  "WaveTools.__pyx_scope_struct_1_genexpr", /*tp_name*/
63445  sizeof(struct __pyx_obj_9WaveTools___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
63446  0, /*tp_itemsize*/
63447  __pyx_tp_dealloc_9WaveTools___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
63448  0, /*tp_print*/
63449  0, /*tp_getattr*/
63450  0, /*tp_setattr*/
63451  #if PY_MAJOR_VERSION < 3
63452  0, /*tp_compare*/
63453  #endif
63454  #if PY_MAJOR_VERSION >= 3
63455  0, /*tp_as_async*/
63456  #endif
63457  0, /*tp_repr*/
63458  0, /*tp_as_number*/
63459  0, /*tp_as_sequence*/
63460  0, /*tp_as_mapping*/
63461  0, /*tp_hash*/
63462  0, /*tp_call*/
63463  0, /*tp_str*/
63464  0, /*tp_getattro*/
63465  0, /*tp_setattro*/
63466  0, /*tp_as_buffer*/
63467  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
63468  0, /*tp_doc*/
63469  __pyx_tp_traverse_9WaveTools___pyx_scope_struct_1_genexpr, /*tp_traverse*/
63470  0, /*tp_clear*/
63471  0, /*tp_richcompare*/
63472  0, /*tp_weaklistoffset*/
63473  0, /*tp_iter*/
63474  0, /*tp_iternext*/
63475  0, /*tp_methods*/
63476  0, /*tp_members*/
63477  0, /*tp_getset*/
63478  0, /*tp_base*/
63479  0, /*tp_dict*/
63480  0, /*tp_descr_get*/
63481  0, /*tp_descr_set*/
63482  0, /*tp_dictoffset*/
63483  0, /*tp_init*/
63484  0, /*tp_alloc*/
63485  __pyx_tp_new_9WaveTools___pyx_scope_struct_1_genexpr, /*tp_new*/
63486  0, /*tp_free*/
63487  0, /*tp_is_gc*/
63488  0, /*tp_bases*/
63489  0, /*tp_mro*/
63490  0, /*tp_cache*/
63491  0, /*tp_subclasses*/
63492  0, /*tp_weaklist*/
63493  0, /*tp_del*/
63494  0, /*tp_version_tag*/
63495  #if PY_VERSION_HEX >= 0x030400a1
63496  0, /*tp_finalize*/
63497  #endif
63498 };
63499 
63500 static PyMethodDef __pyx_methods[] = {
63501  {0, 0, 0, 0}
63502 };
63503 
63504 #if PY_MAJOR_VERSION >= 3
63505 #if CYTHON_PEP489_MULTI_PHASE_INIT
63506 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
63507 static int __pyx_pymod_exec_WaveTools(PyObject* module); /*proto*/
63508 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
63509  {Py_mod_create, (void*)__pyx_pymod_create},
63510  {Py_mod_exec, (void*)__pyx_pymod_exec_WaveTools},
63511  {0, NULL}
63512 };
63513 #endif
63514 
63515 static struct PyModuleDef __pyx_moduledef = {
63516  PyModuleDef_HEAD_INIT,
63517  "WaveTools",
63518  __pyx_k_Tools_for_working_with_water_wav, /* m_doc */
63519  #if CYTHON_PEP489_MULTI_PHASE_INIT
63520  0, /* m_size */
63521  #else
63522  -1, /* m_size */
63523  #endif
63524  __pyx_methods /* m_methods */,
63525  #if CYTHON_PEP489_MULTI_PHASE_INIT
63526  __pyx_moduledef_slots, /* m_slots */
63527  #else
63528  NULL, /* m_reload */
63529  #endif
63530  NULL, /* m_traverse */
63531  NULL, /* m_clear */
63532  NULL /* m_free */
63533 };
63534 #endif
63535 #ifndef CYTHON_SMALL_CODE
63536 #if defined(__clang__)
63537  #define CYTHON_SMALL_CODE
63538 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
63539  #define CYTHON_SMALL_CODE __attribute__((cold))
63540 #else
63541  #define CYTHON_SMALL_CODE
63542 #endif
63543 #endif
63544 
63545 static __Pyx_StringTabEntry __pyx_string_tab[] = {
63546  {&__pyx_n_s_Bcoeff, __pyx_k_Bcoeff, sizeof(__pyx_k_Bcoeff), 0, 0, 1, 1},
63547  {&__pyx_n_s_CombineWaves, __pyx_k_CombineWaves, sizeof(__pyx_k_CombineWaves), 0, 0, 1, 1},
63548  {&__pyx_n_s_CombineWaves___init, __pyx_k_CombineWaves___init, sizeof(__pyx_k_CombineWaves___init), 0, 0, 1, 1},
63549  {&__pyx_n_s_CombineWaves_eta, __pyx_k_CombineWaves_eta, sizeof(__pyx_k_CombineWaves_eta), 0, 0, 1, 1},
63550  {&__pyx_n_s_CombineWaves_u, __pyx_k_CombineWaves_u, sizeof(__pyx_k_CombineWaves_u), 0, 0, 1, 1},
63551  {&__pyx_n_s_Comm, __pyx_k_Comm, sizeof(__pyx_k_Comm), 0, 0, 1, 1},
63552  {&__pyx_n_s_Cutoff, __pyx_k_Cutoff, sizeof(__pyx_k_Cutoff), 0, 0, 1, 1},
63553  {&__pyx_kp_s_Cutoff_2, __pyx_k_Cutoff_2, sizeof(__pyx_k_Cutoff_2), 0, 0, 1, 0},
63554  {&__pyx_kp_s_Direct_reconstruction, __pyx_k_Direct_reconstruction, sizeof(__pyx_k_Direct_reconstruction), 0, 0, 1, 0},
63555  {&__pyx_n_s_DirectionalWaves, __pyx_k_DirectionalWaves, sizeof(__pyx_k_DirectionalWaves), 0, 0, 1, 1},
63556  {&__pyx_n_s_DirectionalWaves___reduce_cython, __pyx_k_DirectionalWaves___reduce_cython, sizeof(__pyx_k_DirectionalWaves___reduce_cython), 0, 0, 1, 1},
63557  {&__pyx_n_s_DirectionalWaves___setstate_cyth, __pyx_k_DirectionalWaves___setstate_cyth, sizeof(__pyx_k_DirectionalWaves___setstate_cyth), 0, 0, 1, 1},
63558  {&__pyx_n_s_DirectionalWaves_eta, __pyx_k_DirectionalWaves_eta, sizeof(__pyx_k_DirectionalWaves_eta), 0, 0, 1, 1},
63559  {&__pyx_n_s_DirectionalWaves_u, __pyx_k_DirectionalWaves_u, sizeof(__pyx_k_DirectionalWaves_u), 0, 0, 1, 1},
63560  {&__pyx_kp_s_ERROR_Each_input_list_entry_shou, __pyx_k_ERROR_Each_input_list_entry_shou, sizeof(__pyx_k_ERROR_Each_input_list_entry_shou), 0, 0, 1, 0},
63561  {&__pyx_kp_s_ERROR_Each_input_list_entry_shou_2, __pyx_k_ERROR_Each_input_list_entry_shou_2, sizeof(__pyx_k_ERROR_Each_input_list_entry_shou_2), 0, 0, 1, 0},
63562  {&__pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke, __pyx_k_ERROR_WaveTools_py_Dictionary_ke, sizeof(__pyx_k_ERROR_WaveTools_py_Dictionary_ke), 0, 0, 1, 0},
63563  {&__pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_2, __pyx_k_ERROR_WaveTools_py_Dictionary_ke_2, sizeof(__pyx_k_ERROR_WaveTools_py_Dictionary_ke_2), 0, 0, 1, 0},
63564  {&__pyx_kp_s_ERROR_WaveTools_py_Dictionary_ke_3, __pyx_k_ERROR_WaveTools_py_Dictionary_ke_3, sizeof(__pyx_k_ERROR_WaveTools_py_Dictionary_ke_3), 0, 0, 1, 0},
63565  {&__pyx_kp_s_ERROR_WaveTools_py_Found_large_e, __pyx_k_ERROR_WaveTools_py_Found_large_e, sizeof(__pyx_k_ERROR_WaveTools_py_Found_large_e), 0, 0, 1, 0},
63566  {&__pyx_kp_s_ERROR_WaveTools_py_Found_not_con, __pyx_k_ERROR_WaveTools_py_Found_not_con, sizeof(__pyx_k_ERROR_WaveTools_py_Found_not_con), 0, 0, 1, 0},
63567  {&__pyx_kp_s_ERROR_WaveTools_py_Found_too_few, __pyx_k_ERROR_WaveTools_py_Found_too_few, sizeof(__pyx_k_ERROR_WaveTools_py_Found_too_few), 0, 0, 1, 0},
63568  {&__pyx_kp_s_ERROR_WaveTools_py_Reconstructio, __pyx_k_ERROR_WaveTools_py_Reconstructio, sizeof(__pyx_k_ERROR_WaveTools_py_Reconstructio), 0, 0, 1, 0},
63569  {&__pyx_kp_s_ERROR_WaveTools_py_Relaxation_zo, __pyx_k_ERROR_WaveTools_py_Relaxation_zo, sizeof(__pyx_k_ERROR_WaveTools_py_Relaxation_zo), 0, 0, 1, 0},
63570  {&__pyx_kp_s_ERROR_WaveTools_py_Set_parameter, __pyx_k_ERROR_WaveTools_py_Set_parameter, sizeof(__pyx_k_ERROR_WaveTools_py_Set_parameter), 0, 0, 1, 0},
63571  {&__pyx_kp_s_ERROR_Wavetools_py_Additional_sp, __pyx_k_ERROR_Wavetools_py_Additional_sp, sizeof(__pyx_k_ERROR_Wavetools_py_Additional_sp), 0, 0, 1, 0},
63572  {&__pyx_kp_s_ERROR_Wavetools_py_Additional_sp_2, __pyx_k_ERROR_Wavetools_py_Additional_sp_2, sizeof(__pyx_k_ERROR_Wavetools_py_Additional_sp_2), 0, 0, 1, 0},
63573  {&__pyx_kp_s_ERROR_Wavetools_py_File_s_must_b, __pyx_k_ERROR_Wavetools_py_File_s_must_b, sizeof(__pyx_k_ERROR_Wavetools_py_File_s_must_b), 0, 0, 1, 0},
63574  {&__pyx_kp_s_ERROR_Wavetools_py_Location_vect, __pyx_k_ERROR_Wavetools_py_Location_vect, sizeof(__pyx_k_ERROR_Wavetools_py_Location_vect), 0, 0, 1, 0},
63575  {&__pyx_kp_s_ERROR_Wavetools_py_Location_vect_2, __pyx_k_ERROR_Wavetools_py_Location_vect_2, sizeof(__pyx_k_ERROR_Wavetools_py_Location_vect_2), 0, 0, 1, 0},
63576  {&__pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe, __pyx_k_ERROR_Wavetools_py_Maximum_numbe, sizeof(__pyx_k_ERROR_Wavetools_py_Maximum_numbe), 0, 0, 1, 0},
63577  {&__pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe_2, __pyx_k_ERROR_Wavetools_py_Maximum_numbe_2, sizeof(__pyx_k_ERROR_Wavetools_py_Maximum_numbe_2), 0, 0, 1, 0},
63578  {&__pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe_3, __pyx_k_ERROR_Wavetools_py_Maximum_numbe_3, sizeof(__pyx_k_ERROR_Wavetools_py_Maximum_numbe_3), 0, 0, 1, 0},
63579  {&__pyx_kp_s_ERROR_Wavetools_py_Parameters_pa, __pyx_k_ERROR_Wavetools_py_Parameters_pa, sizeof(__pyx_k_ERROR_Wavetools_py_Parameters_pa), 0, 0, 1, 0},
63580  {&__pyx_kp_s_ERROR_Wavetools_py_Phase_array_m, __pyx_k_ERROR_Wavetools_py_Phase_array_m, sizeof(__pyx_k_ERROR_Wavetools_py_Phase_array_m), 0, 0, 1, 0},
63581  {&__pyx_kp_s_ERROR_Wavetools_py_SteadyCurrent, __pyx_k_ERROR_Wavetools_py_SteadyCurrent, sizeof(__pyx_k_ERROR_Wavetools_py_SteadyCurrent), 0, 0, 1, 0},
63582  {&__pyx_kp_s_ERROR_Wavetools_py_Timeseries_fi, __pyx_k_ERROR_Wavetools_py_Timeseries_fi, sizeof(__pyx_k_ERROR_Wavetools_py_Timeseries_fi), 0, 0, 1, 0},
63583  {&__pyx_kp_s_ERROR_Wavetools_py_Wavelenght_is, __pyx_k_ERROR_Wavetools_py_Wavelenght_is, sizeof(__pyx_k_ERROR_Wavetools_py_Wavelenght_is), 0, 0, 1, 0},
63584  {&__pyx_kp_s_ERROR_Wavetools_py_Window_handov, __pyx_k_ERROR_Wavetools_py_Window_handov, sizeof(__pyx_k_ERROR_Wavetools_py_Window_handov), 0, 0, 1, 0},
63585  {&__pyx_kp_s_ERROR_Wavetools_py_Wrong_functio, __pyx_k_ERROR_Wavetools_py_Wrong_functio, sizeof(__pyx_k_ERROR_Wavetools_py_Wrong_functio), 0, 0, 1, 0},
63586  {&__pyx_kp_s_ERROR_Wavetools_py_Ycoeff_and_Bc, __pyx_k_ERROR_Wavetools_py_Ycoeff_and_Bc, sizeof(__pyx_k_ERROR_Wavetools_py_Ycoeff_and_Bc), 0, 0, 1, 0},
63587  {&__pyx_kp_s_ERROR_Wavetools_py_You_are_not_r, __pyx_k_ERROR_Wavetools_py_You_are_not_r, sizeof(__pyx_k_ERROR_Wavetools_py_You_are_not_r), 0, 0, 1, 0},
63588  {&__pyx_kp_s_ERROR_Wavetools_py_eta_and_u_fun, __pyx_k_ERROR_Wavetools_py_eta_and_u_fun, sizeof(__pyx_k_ERROR_Wavetools_py_eta_and_u_fun), 0, 0, 1, 0},
63589  {&__pyx_kp_s_ERROR_Wavetools_py_meanVelocity, __pyx_k_ERROR_Wavetools_py_meanVelocity, sizeof(__pyx_k_ERROR_Wavetools_py_meanVelocity), 0, 0, 1, 0},
63590  {&__pyx_kp_s_ERROR_Wavetools_py_phi_argument, __pyx_k_ERROR_Wavetools_py_phi_argument, sizeof(__pyx_k_ERROR_Wavetools_py_phi_argument), 0, 0, 1, 0},
63591  {&__pyx_kp_s_ERROR_Wavetools_py_phi_in_Direct, __pyx_k_ERROR_Wavetools_py_phi_in_Direct, sizeof(__pyx_k_ERROR_Wavetools_py_phi_in_Direct), 0, 0, 1, 0},
63592  {&__pyx_kp_s_ERROR_Wavetools_pyx_Argument_mod, __pyx_k_ERROR_Wavetools_pyx_Argument_mod, sizeof(__pyx_k_ERROR_Wavetools_pyx_Argument_mod), 0, 0, 1, 0},
63593  {&__pyx_kp_s_ERROR_Wrong_wavetype_given_Valid, __pyx_k_ERROR_Wrong_wavetype_given_Valid, sizeof(__pyx_k_ERROR_Wrong_wavetype_given_Valid), 0, 0, 1, 0},
63594  {&__pyx_kp_s_End_time, __pyx_k_End_time, sizeof(__pyx_k_End_time), 0, 0, 1, 0},
63595  {&__pyx_kp_s_Er1, __pyx_k_Er1, sizeof(__pyx_k_Er1), 0, 0, 1, 0},
63596  {&__pyx_n_s_Etaoverall, __pyx_k_Etaoverall, sizeof(__pyx_k_Etaoverall), 0, 0, 1, 1},
63597  {&__pyx_n_s_EtasetUp, __pyx_k_EtasetUp, sizeof(__pyx_k_EtasetUp), 0, 0, 1, 1},
63598  {&__pyx_n_s_Fenton, __pyx_k_Fenton, sizeof(__pyx_k_Fenton), 0, 0, 1, 1},
63599  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
63600  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
63601  {&__pyx_n_s_G0, __pyx_k_G0, sizeof(__pyx_k_G0), 0, 0, 1, 1},
63602  {&__pyx_n_s_Hs, __pyx_k_Hs, sizeof(__pyx_k_Hs), 0, 0, 1, 1},
63603  {&__pyx_n_s_Hs_2, __pyx_k_Hs_2, sizeof(__pyx_k_Hs_2), 0, 0, 1, 1},
63604  {&__pyx_kp_s_INFO_Calculating_nonlinear_corre, __pyx_k_INFO_Calculating_nonlinear_corre, sizeof(__pyx_k_INFO_Calculating_nonlinear_corre), 0, 0, 1, 0},
63605  {&__pyx_kp_s_INFO_WaveTools_py_Cutoff_entry_i, __pyx_k_INFO_WaveTools_py_Cutoff_entry_i, sizeof(__pyx_k_INFO_WaveTools_py_Cutoff_entry_i), 0, 0, 1, 0},
63606  {&__pyx_kp_s_INFO_WaveTools_py_Not_constant_s, __pyx_k_INFO_WaveTools_py_Not_constant_s, sizeof(__pyx_k_INFO_WaveTools_py_Not_constant_s), 0, 0, 1, 0},
63607  {&__pyx_kp_s_INFO_WaveTools_py_Overlap_entry, __pyx_k_INFO_WaveTools_py_Overlap_entry, sizeof(__pyx_k_INFO_WaveTools_py_Overlap_entry), 0, 0, 1, 0},
63608  {&__pyx_kp_s_INFO_WaveTools_py_performing_a_d, __pyx_k_INFO_WaveTools_py_performing_a_d, sizeof(__pyx_k_INFO_WaveTools_py_performing_a_d), 0, 0, 1, 0},
63609  {&__pyx_kp_s_INFO_WaveTools_py_performing_ser, __pyx_k_INFO_WaveTools_py_performing_ser, sizeof(__pyx_k_INFO_WaveTools_py_performing_ser), 0, 0, 1, 0},
63610  {&__pyx_kp_s_INFO_Wavetools_py_Checking_durat, __pyx_k_INFO_Wavetools_py_Checking_durat, sizeof(__pyx_k_INFO_Wavetools_py_Checking_durat), 0, 0, 1, 0},
63611  {&__pyx_kp_s_INFO_Wavetools_py_Correcting_win, __pyx_k_INFO_Wavetools_py_Correcting_win, sizeof(__pyx_k_INFO_Wavetools_py_Correcting_win), 0, 0, 1, 0},
63612  {&__pyx_kp_s_INFO_Wavetools_py_No_phase_array, __pyx_k_INFO_Wavetools_py_No_phase_array, sizeof(__pyx_k_INFO_Wavetools_py_No_phase_array), 0, 0, 1, 0},
63613  {&__pyx_kp_s_INFO_Wavetools_py_Reading_spectr, __pyx_k_INFO_Wavetools_py_Reading_spectr, sizeof(__pyx_k_INFO_Wavetools_py_Reading_spectr), 0, 0, 1, 0},
63614  {&__pyx_kp_s_INFO_Wavetools_py_Using_s_window, __pyx_k_INFO_Wavetools_py_Using_s_window, sizeof(__pyx_k_INFO_Wavetools_py_Using_s_window), 0, 0, 1, 0},
63615  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
63616  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9a, __pyx_k_Incompatible_checksums_s_vs_0x9a, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9a), 0, 0, 1, 0},
63617  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xe2, __pyx_k_Incompatible_checksums_s_vs_0xe2, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xe2), 0, 0, 1, 0},
63618  {&__pyx_n_s_JONSWAP, __pyx_k_JONSWAP, sizeof(__pyx_k_JONSWAP), 0, 0, 1, 1},
63619  {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
63620  {&__pyx_n_s_Lgen, __pyx_k_Lgen, sizeof(__pyx_k_Lgen), 0, 0, 1, 1},
63621  {&__pyx_n_s_Linear, __pyx_k_Linear, sizeof(__pyx_k_Linear), 0, 0, 1, 1},
63622  {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
63623  {&__pyx_n_s_MonochromaticWaves, __pyx_k_MonochromaticWaves, sizeof(__pyx_k_MonochromaticWaves), 0, 0, 1, 1},
63624  {&__pyx_n_s_MonochromaticWaves___reduce_cyth, __pyx_k_MonochromaticWaves___reduce_cyth, sizeof(__pyx_k_MonochromaticWaves___reduce_cyth), 0, 0, 1, 1},
63625  {&__pyx_n_s_MonochromaticWaves___setstate_cy, __pyx_k_MonochromaticWaves___setstate_cy, sizeof(__pyx_k_MonochromaticWaves___setstate_cy), 0, 0, 1, 1},
63626  {&__pyx_n_s_MonochromaticWaves_eta, __pyx_k_MonochromaticWaves_eta, sizeof(__pyx_k_MonochromaticWaves_eta), 0, 0, 1, 1},
63627  {&__pyx_n_s_MonochromaticWaves_u, __pyx_k_MonochromaticWaves_u, sizeof(__pyx_k_MonochromaticWaves_u), 0, 0, 1, 1},
63628  {&__pyx_n_s_MultiSpectraRandomWaves, __pyx_k_MultiSpectraRandomWaves, sizeof(__pyx_k_MultiSpectraRandomWaves), 0, 0, 1, 1},
63629  {&__pyx_n_s_MultiSpectraRandomWaves___reduce, __pyx_k_MultiSpectraRandomWaves___reduce, sizeof(__pyx_k_MultiSpectraRandomWaves___reduce), 0, 0, 1, 1},
63630  {&__pyx_n_s_MultiSpectraRandomWaves___setsta, __pyx_k_MultiSpectraRandomWaves___setsta, sizeof(__pyx_k_MultiSpectraRandomWaves___setsta), 0, 0, 1, 1},
63631  {&__pyx_n_s_MultiSpectraRandomWaves_eta, __pyx_k_MultiSpectraRandomWaves_eta, sizeof(__pyx_k_MultiSpectraRandomWaves_eta), 0, 0, 1, 1},
63632  {&__pyx_n_s_MultiSpectraRandomWaves_u, __pyx_k_MultiSpectraRandomWaves_u, sizeof(__pyx_k_MultiSpectraRandomWaves_u), 0, 0, 1, 1},
63633  {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
63634  {&__pyx_n_s_NLongW, __pyx_k_NLongW, sizeof(__pyx_k_NLongW), 0, 0, 1, 1},
63635  {&__pyx_n_s_NewWave, __pyx_k_NewWave, sizeof(__pyx_k_NewWave), 0, 0, 1, 1},
63636  {&__pyx_n_s_NewWave___reduce_cython, __pyx_k_NewWave___reduce_cython, sizeof(__pyx_k_NewWave___reduce_cython), 0, 0, 1, 1},
63637  {&__pyx_n_s_NewWave___setstate_cython, __pyx_k_NewWave___setstate_cython, sizeof(__pyx_k_NewWave___setstate_cython), 0, 0, 1, 1},
63638  {&__pyx_n_s_NewWave_eta, __pyx_k_NewWave_eta, sizeof(__pyx_k_NewWave_eta), 0, 0, 1, 1},
63639  {&__pyx_n_s_NewWave_u, __pyx_k_NewWave_u, sizeof(__pyx_k_NewWave_u), 0, 0, 1, 1},
63640  {&__pyx_n_s_NewWave_writeEtaSeries, __pyx_k_NewWave_writeEtaSeries, sizeof(__pyx_k_NewWave_writeEtaSeries), 0, 0, 1, 1},
63641  {&__pyx_n_s_Nf, __pyx_k_Nf, sizeof(__pyx_k_Nf), 0, 0, 1, 1},
63642  {&__pyx_n_s_Nfreq, __pyx_k_Nfreq, sizeof(__pyx_k_Nfreq), 0, 0, 1, 1},
63643  {&__pyx_n_s_Nmax, __pyx_k_Nmax, sizeof(__pyx_k_Nmax), 0, 0, 1, 1},
63644  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
63645  {&__pyx_n_s_Np, __pyx_k_Np, sizeof(__pyx_k_Np), 0, 0, 1, 1},
63646  {&__pyx_n_s_Nseries, __pyx_k_Nseries, sizeof(__pyx_k_Nseries), 0, 0, 1, 1},
63647  {&__pyx_n_s_Nspectra, __pyx_k_Nspectra, sizeof(__pyx_k_Nspectra), 0, 0, 1, 1},
63648  {&__pyx_kp_s_Number_of_windows, __pyx_k_Number_of_windows, sizeof(__pyx_k_Number_of_windows), 0, 0, 1, 0},
63649  {&__pyx_n_s_Nwaves, __pyx_k_Nwaves, sizeof(__pyx_k_Nwaves), 0, 0, 1, 1},
63650  {&__pyx_n_s_Nwaves_tot, __pyx_k_Nwaves_tot, sizeof(__pyx_k_Nwaves_tot), 0, 0, 1, 1},
63651  {&__pyx_n_s_Nwind, __pyx_k_Nwind, sizeof(__pyx_k_Nwind), 0, 0, 1, 1},
63652  {&__pyx_n_s_Overlap, __pyx_k_Overlap, sizeof(__pyx_k_Overlap), 0, 0, 1, 1},
63653  {&__pyx_n_s_PM_mod, __pyx_k_PM_mod, sizeof(__pyx_k_PM_mod), 0, 0, 1, 1},
63654  {&__pyx_n_s_Period, __pyx_k_Period, sizeof(__pyx_k_Period), 0, 0, 1, 1},
63655  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
63656  {&__pyx_n_s_Profiling, __pyx_k_Profiling, sizeof(__pyx_k_Profiling), 0, 0, 1, 1},
63657  {&__pyx_n_s_RW, __pyx_k_RW, sizeof(__pyx_k_RW), 0, 0, 1, 1},
63658  {&__pyx_n_s_RandomNLWaves, __pyx_k_RandomNLWaves, sizeof(__pyx_k_RandomNLWaves), 0, 0, 1, 1},
63659  {&__pyx_n_s_RandomNLWavesFast, __pyx_k_RandomNLWavesFast, sizeof(__pyx_k_RandomNLWavesFast), 0, 0, 1, 1},
63660  {&__pyx_n_s_RandomNLWavesFast___init, __pyx_k_RandomNLWavesFast___init, sizeof(__pyx_k_RandomNLWavesFast___init), 0, 0, 1, 1},
63661  {&__pyx_n_s_RandomNLWavesFast_eta, __pyx_k_RandomNLWavesFast_eta, sizeof(__pyx_k_RandomNLWavesFast_eta), 0, 0, 1, 1},
63662  {&__pyx_n_s_RandomNLWavesFast_u, __pyx_k_RandomNLWavesFast_u, sizeof(__pyx_k_RandomNLWavesFast_u), 0, 0, 1, 1},
63663  {&__pyx_n_s_RandomNLWaves___reduce_cython, __pyx_k_RandomNLWaves___reduce_cython, sizeof(__pyx_k_RandomNLWaves___reduce_cython), 0, 0, 1, 1},
63664  {&__pyx_n_s_RandomNLWaves___setstate_cython, __pyx_k_RandomNLWaves___setstate_cython, sizeof(__pyx_k_RandomNLWaves___setstate_cython), 0, 0, 1, 1},
63665  {&__pyx_n_s_RandomNLWaves_eta_2ndOrder, __pyx_k_RandomNLWaves_eta_2ndOrder, sizeof(__pyx_k_RandomNLWaves_eta_2ndOrder), 0, 0, 1, 1},
63666  {&__pyx_n_s_RandomNLWaves_eta_long, __pyx_k_RandomNLWaves_eta_long, sizeof(__pyx_k_RandomNLWaves_eta_long), 0, 0, 1, 1},
63667  {&__pyx_n_s_RandomNLWaves_eta_overall, __pyx_k_RandomNLWaves_eta_overall, sizeof(__pyx_k_RandomNLWaves_eta_overall), 0, 0, 1, 1},
63668  {&__pyx_n_s_RandomNLWaves_eta_setUp, __pyx_k_RandomNLWaves_eta_setUp, sizeof(__pyx_k_RandomNLWaves_eta_setUp), 0, 0, 1, 1},
63669  {&__pyx_n_s_RandomNLWaves_eta_short, __pyx_k_RandomNLWaves_eta_short, sizeof(__pyx_k_RandomNLWaves_eta_short), 0, 0, 1, 1},
63670  {&__pyx_n_s_RandomNLWaves_writeEtaSeries, __pyx_k_RandomNLWaves_writeEtaSeries, sizeof(__pyx_k_RandomNLWaves_writeEtaSeries), 0, 0, 1, 1},
63671  {&__pyx_n_s_RandomNLWaves_wtError, __pyx_k_RandomNLWaves_wtError, sizeof(__pyx_k_RandomNLWaves_wtError), 0, 0, 1, 1},
63672  {&__pyx_n_s_RandomSeries, __pyx_k_RandomSeries, sizeof(__pyx_k_RandomSeries), 0, 0, 1, 1},
63673  {&__pyx_n_s_RandomWaves, __pyx_k_RandomWaves, sizeof(__pyx_k_RandomWaves), 0, 0, 1, 1},
63674  {&__pyx_n_s_RandomWavesFast, __pyx_k_RandomWavesFast, sizeof(__pyx_k_RandomWavesFast), 0, 0, 1, 1},
63675  {&__pyx_n_s_RandomWavesFast___init, __pyx_k_RandomWavesFast___init, sizeof(__pyx_k_RandomWavesFast___init), 0, 0, 1, 1},
63676  {&__pyx_n_s_RandomWavesFast_printOut, __pyx_k_RandomWavesFast_printOut, sizeof(__pyx_k_RandomWavesFast_printOut), 0, 0, 1, 1},
63677  {&__pyx_n_s_RandomWaves___reduce_cython, __pyx_k_RandomWaves___reduce_cython, sizeof(__pyx_k_RandomWaves___reduce_cython), 0, 0, 1, 1},
63678  {&__pyx_n_s_RandomWaves___setstate_cython, __pyx_k_RandomWaves___setstate_cython, sizeof(__pyx_k_RandomWaves___setstate_cython), 0, 0, 1, 1},
63679  {&__pyx_n_s_RandomWaves_eta, __pyx_k_RandomWaves_eta, sizeof(__pyx_k_RandomWaves_eta), 0, 0, 1, 1},
63680  {&__pyx_n_s_RandomWaves_u, __pyx_k_RandomWaves_u, sizeof(__pyx_k_RandomWaves_u), 0, 0, 1, 1},
63681  {&__pyx_n_s_RandomWaves_writeEtaSeries, __pyx_k_RandomWaves_writeEtaSeries, sizeof(__pyx_k_RandomWaves_writeEtaSeries), 0, 0, 1, 1},
63682  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
63683  {&__pyx_n_s_SolitaryWave, __pyx_k_SolitaryWave, sizeof(__pyx_k_SolitaryWave), 0, 0, 1, 1},
63684  {&__pyx_n_s_SolitaryWave___reduce_cython, __pyx_k_SolitaryWave___reduce_cython, sizeof(__pyx_k_SolitaryWave___reduce_cython), 0, 0, 1, 1},
63685  {&__pyx_n_s_SolitaryWave___setstate_cython, __pyx_k_SolitaryWave___setstate_cython, sizeof(__pyx_k_SolitaryWave___setstate_cython), 0, 0, 1, 1},
63686  {&__pyx_n_s_SolitaryWave_eta, __pyx_k_SolitaryWave_eta, sizeof(__pyx_k_SolitaryWave_eta), 0, 0, 1, 1},
63687  {&__pyx_n_s_SolitaryWave_u, __pyx_k_SolitaryWave_u, sizeof(__pyx_k_SolitaryWave_u), 0, 0, 1, 1},
63688  {&__pyx_n_s_SpatialTools, __pyx_k_SpatialTools, sizeof(__pyx_k_SpatialTools), 0, 0, 1, 1},
63689  {&__pyx_kp_s_Start_Time, __pyx_k_Start_Time, sizeof(__pyx_k_Start_Time), 0, 0, 1, 0},
63690  {&__pyx_n_s_SteadyCurrent, __pyx_k_SteadyCurrent, sizeof(__pyx_k_SteadyCurrent), 0, 0, 1, 1},
63691  {&__pyx_n_s_SteadyCurrent___reduce_cython, __pyx_k_SteadyCurrent___reduce_cython, sizeof(__pyx_k_SteadyCurrent___reduce_cython), 0, 0, 1, 1},
63692  {&__pyx_n_s_SteadyCurrent___setstate_cython, __pyx_k_SteadyCurrent___setstate_cython, sizeof(__pyx_k_SteadyCurrent___setstate_cython), 0, 0, 1, 1},
63693  {&__pyx_n_s_SteadyCurrent_eta, __pyx_k_SteadyCurrent_eta, sizeof(__pyx_k_SteadyCurrent_eta), 0, 0, 1, 1},
63694  {&__pyx_n_s_SteadyCurrent_u, __pyx_k_SteadyCurrent_u, sizeof(__pyx_k_SteadyCurrent_u), 0, 0, 1, 1},
63695  {&__pyx_n_s_TMA, __pyx_k_TMA, sizeof(__pyx_k_TMA), 0, 0, 1, 1},
63696  {&__pyx_n_s_TOverlap, __pyx_k_TOverlap, sizeof(__pyx_k_TOverlap), 0, 0, 1, 1},
63697  {&__pyx_n_s_TS, __pyx_k_TS, sizeof(__pyx_k_TS), 0, 0, 1, 1},
63698  {&__pyx_n_s_TWindow, __pyx_k_TWindow, sizeof(__pyx_k_TWindow), 0, 0, 1, 1},
63699  {&__pyx_n_s_Tend, __pyx_k_Tend, sizeof(__pyx_k_Tend), 0, 0, 1, 1},
63700  {&__pyx_kp_s_This_class_is_used_for_combinin, __pyx_k_This_class_is_used_for_combinin, sizeof(__pyx_k_This_class_is_used_for_combinin), 0, 0, 1, 0},
63701  {&__pyx_kp_s_This_class_is_used_for_generati, __pyx_k_This_class_is_used_for_generati, sizeof(__pyx_k_This_class_is_used_for_generati), 0, 0, 1, 0},
63702  {&__pyx_kp_s_This_class_is_used_for_generati_2, __pyx_k_This_class_is_used_for_generati_2, sizeof(__pyx_k_This_class_is_used_for_generati_2), 0, 0, 1, 0},
63703  {&__pyx_n_s_TimeSeries, __pyx_k_TimeSeries, sizeof(__pyx_k_TimeSeries), 0, 0, 1, 1},
63704  {&__pyx_n_s_TimeSeries___reduce_cython, __pyx_k_TimeSeries___reduce_cython, sizeof(__pyx_k_TimeSeries___reduce_cython), 0, 0, 1, 1},
63705  {&__pyx_n_s_TimeSeries___setstate_cython, __pyx_k_TimeSeries___setstate_cython, sizeof(__pyx_k_TimeSeries___setstate_cython), 0, 0, 1, 1},
63706  {&__pyx_n_s_TimeSeries_etaDirect, __pyx_k_TimeSeries_etaDirect, sizeof(__pyx_k_TimeSeries_etaDirect), 0, 0, 1, 1},
63707  {&__pyx_n_s_TimeSeries_etaWindow, __pyx_k_TimeSeries_etaWindow, sizeof(__pyx_k_TimeSeries_etaWindow), 0, 0, 1, 1},
63708  {&__pyx_n_s_TimeSeries_findWindow, __pyx_k_TimeSeries_findWindow, sizeof(__pyx_k_TimeSeries_findWindow), 0, 0, 1, 1},
63709  {&__pyx_n_s_TimeSeries_uDirect, __pyx_k_TimeSeries_uDirect, sizeof(__pyx_k_TimeSeries_uDirect), 0, 0, 1, 1},
63710  {&__pyx_n_s_TimeSeries_uWindow, __pyx_k_TimeSeries_uWindow, sizeof(__pyx_k_TimeSeries_uWindow), 0, 0, 1, 1},
63711  {&__pyx_n_s_TimeSeries_windOut, __pyx_k_TimeSeries_windOut, sizeof(__pyx_k_TimeSeries_windOut), 0, 0, 1, 1},
63712  {&__pyx_n_s_Tlag, __pyx_k_Tlag, sizeof(__pyx_k_Tlag), 0, 0, 1, 1},
63713  {&__pyx_n_s_Tm, __pyx_k_Tm, sizeof(__pyx_k_Tm), 0, 0, 1, 1},
63714  {&__pyx_n_s_Tmax, __pyx_k_Tmax, sizeof(__pyx_k_Tmax), 0, 0, 1, 1},
63715  {&__pyx_n_s_Tp, __pyx_k_Tp, sizeof(__pyx_k_Tp), 0, 0, 1, 1},
63716  {&__pyx_n_s_Tp_2, __pyx_k_Tp_2, sizeof(__pyx_k_Tp_2), 0, 0, 1, 1},
63717  {&__pyx_n_s_Tstart, __pyx_k_Tstart, sizeof(__pyx_k_Tstart), 0, 0, 1, 1},
63718  {&__pyx_n_s_Tstart_temp, __pyx_k_Tstart_temp, sizeof(__pyx_k_Tstart_temp), 0, 0, 1, 1},
63719  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
63720  {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1},
63721  {&__pyx_n_s_UH, __pyx_k_UH, sizeof(__pyx_k_UH), 0, 0, 1, 1},
63722  {&__pyx_n_s_UV, __pyx_k_UV, sizeof(__pyx_k_UV), 0, 0, 1, 1},
63723  {&__pyx_n_s_Udrift, __pyx_k_Udrift, sizeof(__pyx_k_Udrift), 0, 0, 1, 1},
63724  {&__pyx_n_s_Uhorz, __pyx_k_Uhorz, sizeof(__pyx_k_Uhorz), 0, 0, 1, 1},
63725  {&__pyx_n_s_Uvert, __pyx_k_Uvert, sizeof(__pyx_k_Uvert), 0, 0, 1, 1},
63726  {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1},
63727  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
63728  {&__pyx_n_s_WaveTools, __pyx_k_WaveTools, sizeof(__pyx_k_WaveTools), 0, 0, 1, 1},
63729  {&__pyx_kp_s_Wave_direction_is_not_perpendicu, __pyx_k_Wave_direction_is_not_perpendicu, sizeof(__pyx_k_Wave_direction_is_not_perpendicu), 0, 0, 1, 0},
63730  {&__pyx_kp_s_Wavetools_py_Provide_valid_depth, __pyx_k_Wavetools_py_Provide_valid_depth, sizeof(__pyx_k_Wavetools_py_Provide_valid_depth), 0, 0, 1, 0},
63731  {&__pyx_kp_s_Wavetools_py_Stopping_simulation, __pyx_k_Wavetools_py_Stopping_simulation, sizeof(__pyx_k_Wavetools_py_Stopping_simulation), 0, 0, 1, 0},
63732  {&__pyx_n_s_Window, __pyx_k_Window, sizeof(__pyx_k_Window), 0, 0, 1, 1},
63733  {&__pyx_n_s_Ycoeff, __pyx_k_Ycoeff, sizeof(__pyx_k_Ycoeff), 0, 0, 1, 1},
63734  {&__pyx_n_s_Z, __pyx_k_Z, sizeof(__pyx_k_Z), 0, 0, 1, 1},
63735  {&__pyx_kp_s__43, __pyx_k__43, sizeof(__pyx_k__43), 0, 0, 1, 0},
63736  {&__pyx_kp_s__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 1, 0},
63737  {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
63738  {&__pyx_n_s_a1, __pyx_k_a1, sizeof(__pyx_k_a1), 0, 0, 1, 1},
63739  {&__pyx_n_s_a2, __pyx_k_a2, sizeof(__pyx_k_a2), 0, 0, 1, 1},
63740  {&__pyx_n_s_aR, __pyx_k_aR, sizeof(__pyx_k_aR), 0, 0, 1, 1},
63741  {&__pyx_n_s_aRN, __pyx_k_aRN, sizeof(__pyx_k_aRN), 0, 0, 1, 1},
63742  {&__pyx_n_s_aa, __pyx_k_aa, sizeof(__pyx_k_aa), 0, 0, 1, 1},
63743  {&__pyx_n_s_ai, __pyx_k_ai, sizeof(__pyx_k_ai), 0, 0, 1, 1},
63744  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
63745  {&__pyx_n_s_all_2, __pyx_k_all_2, sizeof(__pyx_k_all_2), 0, 0, 1, 1},
63746  {&__pyx_n_s_amp, __pyx_k_amp, sizeof(__pyx_k_amp), 0, 0, 1, 1},
63747  {&__pyx_n_s_amplitude, __pyx_k_amplitude, sizeof(__pyx_k_amplitude), 0, 0, 1, 1},
63748  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
63749  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
63750  {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
63751  {&__pyx_n_s_arrayData, __pyx_k_arrayData, sizeof(__pyx_k_arrayData), 0, 0, 1, 1},
63752  {&__pyx_n_s_autoFenton, __pyx_k_autoFenton, sizeof(__pyx_k_autoFenton), 0, 0, 1, 1},
63753  {&__pyx_n_s_autoFentonOpts, __pyx_k_autoFentonOpts, sizeof(__pyx_k_autoFentonOpts), 0, 0, 1, 1},
63754  {&__pyx_n_s_bandFactor, __pyx_k_bandFactor, sizeof(__pyx_k_bandFactor), 0, 0, 1, 1},
63755  {&__pyx_n_s_barrier, __pyx_k_barrier, sizeof(__pyx_k_barrier), 0, 0, 1, 1},
63756  {&__pyx_n_s_bj, __pyx_k_bj, sizeof(__pyx_k_bj), 0, 0, 1, 1},
63757  {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
63758  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
63759  {&__pyx_n_s_checkAcc, __pyx_k_checkAcc, sizeof(__pyx_k_checkAcc), 0, 0, 1, 1},
63760  {&__pyx_n_s_cinit___locals_genexpr, __pyx_k_cinit___locals_genexpr, sizeof(__pyx_k_cinit___locals_genexpr), 0, 0, 1, 1},
63761  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
63762  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
63763  {&__pyx_n_s_cmat, __pyx_k_cmat, sizeof(__pyx_k_cmat), 0, 0, 1, 1},
63764  {&__pyx_n_s_cmath, __pyx_k_cmath, sizeof(__pyx_k_cmath), 0, 0, 1, 1},
63765  {&__pyx_n_s_cond, __pyx_k_cond, sizeof(__pyx_k_cond), 0, 0, 1, 1},
63766  {&__pyx_n_s_condition, __pyx_k_condition, sizeof(__pyx_k_condition), 0, 0, 1, 1},
63767  {&__pyx_n_s_conv_crit, __pyx_k_conv_crit, sizeof(__pyx_k_conv_crit), 0, 0, 1, 1},
63768  {&__pyx_n_s_copyFiles, __pyx_k_copyFiles, sizeof(__pyx_k_copyFiles), 0, 0, 1, 1},
63769  {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
63770  {&__pyx_n_s_cos2s, __pyx_k_cos2s, sizeof(__pyx_k_cos2s), 0, 0, 1, 1},
63771  {&__pyx_n_s_coshkzd_test, __pyx_k_coshkzd_test, sizeof(__pyx_k_coshkzd_test), 0, 0, 1, 1},
63772  {&__pyx_n_s_costap, __pyx_k_costap, sizeof(__pyx_k_costap), 0, 0, 1, 1},
63773  {&__pyx_n_s_cppU, __pyx_k_cppU, sizeof(__pyx_k_cppU), 0, 0, 1, 1},
63774  {&__pyx_n_s_crestFocus, __pyx_k_crestFocus, sizeof(__pyx_k_crestFocus), 0, 0, 1, 1},
63775  {&__pyx_kp_s_csv, __pyx_k_csv, sizeof(__pyx_k_csv), 0, 0, 1, 0},
63776  {&__pyx_n_s_current_criterion, __pyx_k_current_criterion, sizeof(__pyx_k_current_criterion), 0, 0, 1, 1},
63777  {&__pyx_n_s_current_magnitude, __pyx_k_current_magnitude, sizeof(__pyx_k_current_magnitude), 0, 0, 1, 1},
63778  {&__pyx_n_s_cut, __pyx_k_cut, sizeof(__pyx_k_cut), 0, 0, 1, 1},
63779  {&__pyx_n_s_cutoff, __pyx_k_cutoff, sizeof(__pyx_k_cutoff), 0, 0, 1, 1},
63780  {&__pyx_n_s_cutoffTotal, __pyx_k_cutoffTotal, sizeof(__pyx_k_cutoffTotal), 0, 0, 1, 1},
63781  {&__pyx_n_s_cutoff_win, __pyx_k_cutoff_win, sizeof(__pyx_k_cutoff_win), 0, 0, 1, 1},
63782  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
63783  {&__pyx_n_s_decompose_tseries, __pyx_k_decompose_tseries, sizeof(__pyx_k_decompose_tseries), 0, 0, 1, 1},
63784  {&__pyx_n_s_delimiter, __pyx_k_delimiter, sizeof(__pyx_k_delimiter), 0, 0, 1, 1},
63785  {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
63786  {&__pyx_n_s_depth_2, __pyx_k_depth_2, sizeof(__pyx_k_depth_2), 0, 0, 1, 1},
63787  {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
63788  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
63789  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
63790  {&__pyx_n_s_dirCheck, __pyx_k_dirCheck, sizeof(__pyx_k_dirCheck), 0, 0, 1, 1},
63791  {&__pyx_n_s_dircheck, __pyx_k_dircheck, sizeof(__pyx_k_dircheck), 0, 0, 1, 1},
63792  {&__pyx_n_s_dispersion, __pyx_k_dispersion, sizeof(__pyx_k_dispersion), 0, 0, 1, 1},
63793  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
63794  {&__pyx_n_s_dom, __pyx_k_dom, sizeof(__pyx_k_dom), 0, 0, 1, 1},
63795  {&__pyx_n_s_dt, __pyx_k_dt, sizeof(__pyx_k_dt), 0, 0, 1, 1},
63796  {&__pyx_n_s_duration, __pyx_k_duration, sizeof(__pyx_k_duration), 0, 0, 1, 1},
63797  {&__pyx_n_s_er1, __pyx_k_er1, sizeof(__pyx_k_er1), 0, 0, 1, 1},
63798  {&__pyx_n_s_errors, __pyx_k_errors, sizeof(__pyx_k_errors), 0, 0, 1, 1},
63799  {&__pyx_n_s_eta, __pyx_k_eta, sizeof(__pyx_k_eta), 0, 0, 1, 1},
63800  {&__pyx_n_s_etaCheck, __pyx_k_etaCheck, sizeof(__pyx_k_etaCheck), 0, 0, 1, 1},
63801  {&__pyx_n_s_etaDirect, __pyx_k_etaDirect, sizeof(__pyx_k_etaDirect), 0, 0, 1, 1},
63802  {&__pyx_n_s_etaR, __pyx_k_etaR, sizeof(__pyx_k_etaR), 0, 0, 1, 1},
63803  {&__pyx_n_s_etaWindow, __pyx_k_etaWindow, sizeof(__pyx_k_etaWindow), 0, 0, 1, 1},
63804  {&__pyx_n_s_eta_2ndOrder, __pyx_k_eta_2ndOrder, sizeof(__pyx_k_eta_2ndOrder), 0, 0, 1, 1},
63805  {&__pyx_n_s_eta_long, __pyx_k_eta_long, sizeof(__pyx_k_eta_long), 0, 0, 1, 1},
63806  {&__pyx_n_s_eta_mode, __pyx_k_eta_mode, sizeof(__pyx_k_eta_mode), 0, 0, 1, 1},
63807  {&__pyx_n_s_eta_overall, __pyx_k_eta_overall, sizeof(__pyx_k_eta_overall), 0, 0, 1, 1},
63808  {&__pyx_n_s_eta_setUp, __pyx_k_eta_setUp, sizeof(__pyx_k_eta_setUp), 0, 0, 1, 1},
63809  {&__pyx_n_s_eta_short, __pyx_k_eta_short, sizeof(__pyx_k_eta_short), 0, 0, 1, 1},
63810  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
63811  {&__pyx_n_s_exp, __pyx_k_exp, sizeof(__pyx_k_exp), 0, 0, 1, 1},
63812  {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
63813  {&__pyx_n_s_f0, __pyx_k_f0, sizeof(__pyx_k_f0), 0, 0, 1, 1},
63814  {&__pyx_n_s_fast, __pyx_k_fast, sizeof(__pyx_k_fast), 0, 0, 1, 1},
63815  {&__pyx_n_s_fastcos_test, __pyx_k_fastcos_test, sizeof(__pyx_k_fastcos_test), 0, 0, 1, 1},
63816  {&__pyx_n_s_fastcosh_test, __pyx_k_fastcosh_test, sizeof(__pyx_k_fastcosh_test), 0, 0, 1, 1},
63817  {&__pyx_n_s_fastsinh_test, __pyx_k_fastsinh_test, sizeof(__pyx_k_fastsinh_test), 0, 0, 1, 1},
63818  {&__pyx_n_s_fft, __pyx_k_fft, sizeof(__pyx_k_fft), 0, 0, 1, 1},
63819  {&__pyx_n_s_fft_x, __pyx_k_fft_x, sizeof(__pyx_k_fft_x), 0, 0, 1, 1},
63820  {&__pyx_n_s_fftfreq, __pyx_k_fftfreq, sizeof(__pyx_k_fftfreq), 0, 0, 1, 1},
63821  {&__pyx_n_s_fi, __pyx_k_fi, sizeof(__pyx_k_fi), 0, 0, 1, 1},
63822  {&__pyx_n_s_fim_tmp, __pyx_k_fim_tmp, sizeof(__pyx_k_fim_tmp), 0, 0, 1, 1},
63823  {&__pyx_n_s_findWindow, __pyx_k_findWindow, sizeof(__pyx_k_findWindow), 0, 0, 1, 1},
63824  {&__pyx_n_s_fname, __pyx_k_fname, sizeof(__pyx_k_fname), 0, 0, 1, 1},
63825  {&__pyx_n_s_freq, __pyx_k_freq, sizeof(__pyx_k_freq), 0, 0, 1, 1},
63826  {&__pyx_n_s_fun, __pyx_k_fun, sizeof(__pyx_k_fun), 0, 0, 1, 1},
63827  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
63828  {&__pyx_n_s_funcName, __pyx_k_funcName, sizeof(__pyx_k_funcName), 0, 0, 1, 1},
63829  {&__pyx_n_s_funcNames, __pyx_k_funcNames, sizeof(__pyx_k_funcNames), 0, 0, 1, 1},
63830  {&__pyx_n_s_func_ret, __pyx_k_func_ret, sizeof(__pyx_k_func_ret), 0, 0, 1, 1},
63831  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
63832  {&__pyx_n_s_gAbs, __pyx_k_gAbs, sizeof(__pyx_k_gAbs), 0, 0, 1, 1},
63833  {&__pyx_n_s_gamma, __pyx_k_gamma, sizeof(__pyx_k_gamma), 0, 0, 1, 1},
63834  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
63835  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
63836  {&__pyx_n_s_getBYCoeffs, __pyx_k_getBYCoeffs, sizeof(__pyx_k_getBYCoeffs), 0, 0, 1, 1},
63837  {&__pyx_n_s_getWavelength, __pyx_k_getWavelength, sizeof(__pyx_k_getWavelength), 0, 0, 1, 1},
63838  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
63839  {&__pyx_n_s_height_steps, __pyx_k_height_steps, sizeof(__pyx_k_height_steps), 0, 0, 1, 1},
63840  {&__pyx_n_s_ho, __pyx_k_ho, sizeof(__pyx_k_ho), 0, 0, 1, 1},
63841  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
63842  {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
63843  {&__pyx_n_s_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 0, 1, 1},
63844  {&__pyx_n_s_iend, __pyx_k_iend, sizeof(__pyx_k_iend), 0, 0, 1, 1},
63845  {&__pyx_n_s_ii, __pyx_k_ii, sizeof(__pyx_k_ii), 0, 0, 1, 1},
63846  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
63847  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
63848  {&__pyx_n_s_interp, __pyx_k_interp, sizeof(__pyx_k_interp), 0, 0, 1, 1},
63849  {&__pyx_n_s_isMaster, __pyx_k_isMaster, sizeof(__pyx_k_isMaster), 0, 0, 1, 1},
63850  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
63851  {&__pyx_n_s_jj, __pyx_k_jj, sizeof(__pyx_k_jj), 0, 0, 1, 1},
63852  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
63853  {&__pyx_n_s_kAbs, __pyx_k_kAbs, sizeof(__pyx_k_kAbs), 0, 0, 1, 1},
63854  {&__pyx_n_s_kDir, __pyx_k_kDir, sizeof(__pyx_k_kDir), 0, 0, 1, 1},
63855  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
63856  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
63857  {&__pyx_n_s_linalg, __pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 0, 1, 1},
63858  {&__pyx_n_s_linear, __pyx_k_linear, sizeof(__pyx_k_linear), 0, 0, 1, 1},
63859  {&__pyx_n_s_linspace, __pyx_k_linspace, sizeof(__pyx_k_linspace), 0, 0, 1, 1},
63860  {&__pyx_n_s_loadExistingFunction, __pyx_k_loadExistingFunction, sizeof(__pyx_k_loadExistingFunction), 0, 0, 1, 1},
63861  {&__pyx_n_s_loadtxt, __pyx_k_loadtxt, sizeof(__pyx_k_loadtxt), 0, 0, 1, 1},
63862  {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
63863  {&__pyx_n_s_logEvent, __pyx_k_logEvent, sizeof(__pyx_k_logEvent), 0, 0, 1, 1},
63864  {&__pyx_n_s_logFile, __pyx_k_logFile, sizeof(__pyx_k_logFile), 0, 0, 1, 1},
63865  {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1},
63866  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
63867  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
63868  {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
63869  {&__pyx_n_s_meanVelocity, __pyx_k_meanVelocity, sizeof(__pyx_k_meanVelocity), 0, 0, 1, 1},
63870  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
63871  {&__pyx_n_s_mitsuyasu, __pyx_k_mitsuyasu, sizeof(__pyx_k_mitsuyasu), 0, 0, 1, 1},
63872  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
63873  {&__pyx_n_s_modes, __pyx_k_modes, sizeof(__pyx_k_modes), 0, 0, 1, 1},
63874  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
63875  {&__pyx_n_s_mwl, __pyx_k_mwl, sizeof(__pyx_k_mwl), 0, 0, 1, 1},
63876  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
63877  {&__pyx_n_s_ncoeffs, __pyx_k_ncoeffs, sizeof(__pyx_k_ncoeffs), 0, 0, 1, 1},
63878  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
63879  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
63880  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
63881  {&__pyx_n_s_nfft, __pyx_k_nfft, sizeof(__pyx_k_nfft), 0, 0, 1, 1},
63882  {&__pyx_n_s_niter, __pyx_k_niter, sizeof(__pyx_k_niter), 0, 0, 1, 1},
63883  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
63884  {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1},
63885  {&__pyx_n_s_normIntegral, __pyx_k_normIntegral, sizeof(__pyx_k_normIntegral), 0, 0, 1, 1},
63886  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
63887  {&__pyx_n_s_npoints, __pyx_k_npoints, sizeof(__pyx_k_npoints), 0, 0, 1, 1},
63888  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
63889  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
63890  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
63891  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
63892  {&__pyx_n_s_old_div, __pyx_k_old_div, sizeof(__pyx_k_old_div), 0, 0, 1, 1},
63893  {&__pyx_n_s_omega, __pyx_k_omega, sizeof(__pyx_k_omega), 0, 0, 1, 1},
63894  {&__pyx_n_s_omega0, __pyx_k_omega0, sizeof(__pyx_k_omega0), 0, 0, 1, 1},
63895  {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
63896  {&__pyx_n_s_open, __pyx_k_open, sizeof(__pyx_k_open), 0, 0, 1, 1},
63897  {&__pyx_n_s_overl, __pyx_k_overl, sizeof(__pyx_k_overl), 0, 0, 1, 1},
63898  {&__pyx_n_s_past_utils, __pyx_k_past_utils, sizeof(__pyx_k_past_utils), 0, 0, 1, 1},
63899  {&__pyx_n_s_period, __pyx_k_period, sizeof(__pyx_k_period), 0, 0, 1, 1},
63900  {&__pyx_n_s_periods, __pyx_k_periods, sizeof(__pyx_k_periods), 0, 0, 1, 1},
63901  {&__pyx_n_s_phase, __pyx_k_phase, sizeof(__pyx_k_phase), 0, 0, 1, 1},
63902  {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
63903  {&__pyx_n_s_phi0, __pyx_k_phi0, sizeof(__pyx_k_phi0), 0, 0, 1, 1},
63904  {&__pyx_n_s_phiSymm, __pyx_k_phiSymm, sizeof(__pyx_k_phiSymm), 0, 0, 1, 1},
63905  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
63906  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
63907  {&__pyx_n_s_points_freesurface, __pyx_k_points_freesurface, sizeof(__pyx_k_points_freesurface), 0, 0, 1, 1},
63908  {&__pyx_n_s_points_velocity, __pyx_k_points_velocity, sizeof(__pyx_k_points_velocity), 0, 0, 1, 1},
63909  {&__pyx_n_s_points_vertical, __pyx_k_points_vertical, sizeof(__pyx_k_points_vertical), 0, 0, 1, 1},
63910  {&__pyx_n_s_pp, __pyx_k_pp, sizeof(__pyx_k_pp), 0, 0, 1, 1},
63911  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
63912  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
63913  {&__pyx_n_s_printOut, __pyx_k_printOut, sizeof(__pyx_k_printOut), 0, 0, 1, 1},
63914  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
63915  {&__pyx_kp_s_proteus_WaveTools_py, __pyx_k_proteus_WaveTools_py, sizeof(__pyx_k_proteus_WaveTools_py), 0, 0, 1, 0},
63916  {&__pyx_n_s_proteus_fenton, __pyx_k_proteus_fenton, sizeof(__pyx_k_proteus_fenton), 0, 0, 1, 1},
63917  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
63918  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
63919  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
63920  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
63921  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
63922  {&__pyx_n_s_pyx_unpickle_SolitaryWave, __pyx_k_pyx_unpickle_SolitaryWave, sizeof(__pyx_k_pyx_unpickle_SolitaryWave), 0, 0, 1, 1},
63923  {&__pyx_n_s_pyx_unpickle_SteadyCurrent, __pyx_k_pyx_unpickle_SteadyCurrent, sizeof(__pyx_k_pyx_unpickle_SteadyCurrent), 0, 0, 1, 1},
63924  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
63925  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
63926  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
63927  {&__pyx_n_s_rampTime, __pyx_k_rampTime, sizeof(__pyx_k_rampTime), 0, 0, 1, 1},
63928  {&__pyx_n_s_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 0, 0, 1, 1},
63929  {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
63930  {&__pyx_n_s_randomNLWaves, __pyx_k_randomNLWaves, sizeof(__pyx_k_randomNLWaves), 0, 0, 1, 1},
63931  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
63932  {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
63933  {&__pyx_n_s_rec_d, __pyx_k_rec_d, sizeof(__pyx_k_rec_d), 0, 0, 1, 1},
63934  {&__pyx_n_s_rec_direct, __pyx_k_rec_direct, sizeof(__pyx_k_rec_direct), 0, 0, 1, 1},
63935  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
63936  {&__pyx_n_s_reduceToIntervals, __pyx_k_reduceToIntervals, sizeof(__pyx_k_reduceToIntervals), 0, 0, 1, 1},
63937  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
63938  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
63939  {&__pyx_n_s_results, __pyx_k_results, sizeof(__pyx_k_results), 0, 0, 1, 1},
63940  {&__pyx_n_s_returnRectangles, __pyx_k_returnRectangles, sizeof(__pyx_k_returnRectangles), 0, 0, 1, 1},
63941  {&__pyx_n_s_returnRectangles3D, __pyx_k_returnRectangles3D, sizeof(__pyx_k_returnRectangles3D), 0, 0, 1, 1},
63942  {&__pyx_n_s_rotation3D, __pyx_k_rotation3D, sizeof(__pyx_k_rotation3D), 0, 0, 1, 1},
63943  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
63944  {&__pyx_n_s_runFourier, __pyx_k_runFourier, sizeof(__pyx_k_runFourier), 0, 0, 1, 1},
63945  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
63946  {&__pyx_n_s_savetxt, __pyx_k_savetxt, sizeof(__pyx_k_savetxt), 0, 0, 1, 1},
63947  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
63948  {&__pyx_kp_s_self_Bcoeff__self_Ycoeff__self, __pyx_k_self_Bcoeff__self_Ycoeff__self, sizeof(__pyx_k_self_Bcoeff__self_Ycoeff__self), 0, 0, 1, 0},
63949  {&__pyx_kp_s_self_T0__self__cpp_eta_self__cpp, __pyx_k_self_T0__self__cpp_eta_self__cpp, sizeof(__pyx_k_self_T0__self__cpp_eta_self__cpp), 0, 0, 1, 0},
63950  {&__pyx_kp_s_self_ai__self_kDir__self_ki__sel, __pyx_k_self_ai__self_kDir__self_ki__sel, sizeof(__pyx_k_self_ai__self_kDir__self_ki__sel), 0, 0, 1, 0},
63951  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
63952  {&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1},
63953  {&__pyx_n_s_seriesArray, __pyx_k_seriesArray, sizeof(__pyx_k_seriesArray), 0, 0, 1, 1},
63954  {&__pyx_n_s_setDirVector, __pyx_k_setDirVector, sizeof(__pyx_k_setDirVector), 0, 0, 1, 1},
63955  {&__pyx_n_s_setUp, __pyx_k_setUp, sizeof(__pyx_k_setUp), 0, 0, 1, 1},
63956  {&__pyx_n_s_setVertDir, __pyx_k_setVertDir, sizeof(__pyx_k_setVertDir), 0, 0, 1, 1},
63957  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
63958  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
63959  {&__pyx_n_s_setup, __pyx_k_setup, sizeof(__pyx_k_setup), 0, 0, 1, 1},
63960  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
63961  {&__pyx_n_s_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 0, 1, 1},
63962  {&__pyx_n_s_sigma, __pyx_k_sigma, sizeof(__pyx_k_sigma), 0, 0, 1, 1},
63963  {&__pyx_n_s_sigmaReturn, __pyx_k_sigmaReturn, sizeof(__pyx_k_sigmaReturn), 0, 0, 1, 1},
63964  {&__pyx_n_s_sinh, __pyx_k_sinh, sizeof(__pyx_k_sinh), 0, 0, 1, 1},
63965  {&__pyx_n_s_sinhkzd_test, __pyx_k_sinhkzd_test, sizeof(__pyx_k_sinhkzd_test), 0, 0, 1, 1},
63966  {&__pyx_n_s_sinus, __pyx_k_sinus, sizeof(__pyx_k_sinus), 0, 0, 1, 1},
63967  {&__pyx_n_s_skiprows, __pyx_k_skiprows, sizeof(__pyx_k_skiprows), 0, 0, 1, 1},
63968  {&__pyx_n_s_smax, __pyx_k_smax, sizeof(__pyx_k_smax), 0, 0, 1, 1},
63969  {&__pyx_n_s_spectName, __pyx_k_spectName, sizeof(__pyx_k_spectName), 0, 0, 1, 1},
63970  {&__pyx_n_s_spectral_params, __pyx_k_spectral_params, sizeof(__pyx_k_spectral_params), 0, 0, 1, 1},
63971  {&__pyx_n_s_spreadName, __pyx_k_spreadName, sizeof(__pyx_k_spreadName), 0, 0, 1, 1},
63972  {&__pyx_n_s_spread_params, __pyx_k_spread_params, sizeof(__pyx_k_spread_params), 0, 0, 1, 1},
63973  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
63974  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
63975  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
63976  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
63977  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
63978  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
63979  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
63980  {&__pyx_n_s_tanh, __pyx_k_tanh, sizeof(__pyx_k_tanh), 0, 0, 1, 1},
63981  {&__pyx_n_s_te, __pyx_k_te, sizeof(__pyx_k_te), 0, 0, 1, 1},
63982  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
63983  {&__pyx_n_s_tfocus, __pyx_k_tfocus, sizeof(__pyx_k_tfocus), 0, 0, 1, 1},
63984  {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
63985  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
63986  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
63987  {&__pyx_n_s_timeSeriesFile, __pyx_k_timeSeriesFile, sizeof(__pyx_k_timeSeriesFile), 0, 0, 1, 1},
63988  {&__pyx_n_s_timeSeriesPosition, __pyx_k_timeSeriesPosition, sizeof(__pyx_k_timeSeriesPosition), 0, 0, 1, 1},
63989  {&__pyx_n_s_timelst, __pyx_k_timelst, sizeof(__pyx_k_timelst), 0, 0, 1, 1},
63990  {&__pyx_n_s_tma, __pyx_k_tma, sizeof(__pyx_k_tma), 0, 0, 1, 1},
63991  {&__pyx_n_s_tolist, __pyx_k_tolist, sizeof(__pyx_k_tolist), 0, 0, 1, 1},
63992  {&__pyx_n_s_tophat, __pyx_k_tophat, sizeof(__pyx_k_tophat), 0, 0, 1, 1},
63993  {&__pyx_n_s_trans, __pyx_k_trans, sizeof(__pyx_k_trans), 0, 0, 1, 1},
63994  {&__pyx_n_s_ts, __pyx_k_ts, sizeof(__pyx_k_ts), 0, 0, 1, 1},
63995  {&__pyx_n_s_tt, __pyx_k_tt, sizeof(__pyx_k_tt), 0, 0, 1, 1},
63996  {&__pyx_kp_s_txt, __pyx_k_txt, sizeof(__pyx_k_txt), 0, 0, 1, 0},
63997  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
63998  {&__pyx_n_s_uCheck, __pyx_k_uCheck, sizeof(__pyx_k_uCheck), 0, 0, 1, 1},
63999  {&__pyx_n_s_uDirect, __pyx_k_uDirect, sizeof(__pyx_k_uDirect), 0, 0, 1, 1},
64000  {&__pyx_n_s_uR, __pyx_k_uR, sizeof(__pyx_k_uR), 0, 0, 1, 1},
64001  {&__pyx_n_s_uWindow, __pyx_k_uWindow, sizeof(__pyx_k_uWindow), 0, 0, 1, 1},
64002  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
64003  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
64004  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
64005  {&__pyx_n_s_v1, __pyx_k_v1, sizeof(__pyx_k_v1), 0, 0, 1, 1},
64006  {&__pyx_n_s_v2, __pyx_k_v2, sizeof(__pyx_k_v2), 0, 0, 1, 1},
64007  {&__pyx_n_s_vDir, __pyx_k_vDir, sizeof(__pyx_k_vDir), 0, 0, 1, 1},
64008  {&__pyx_n_s_validFunctions, __pyx_k_validFunctions, sizeof(__pyx_k_validFunctions), 0, 0, 1, 1},
64009  {&__pyx_n_s_vector, __pyx_k_vector, sizeof(__pyx_k_vector), 0, 0, 1, 1},
64010  {&__pyx_n_s_vel_mode, __pyx_k_vel_mode, sizeof(__pyx_k_vel_mode), 0, 0, 1, 1},
64011  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
64012  {&__pyx_n_s_w_aux, __pyx_k_w_aux, sizeof(__pyx_k_w_aux), 0, 0, 1, 1},
64013  {&__pyx_n_s_waveDir, __pyx_k_waveDir, sizeof(__pyx_k_waveDir), 0, 0, 1, 1},
64014  {&__pyx_n_s_waveDir0, __pyx_k_waveDir0, sizeof(__pyx_k_waveDir0), 0, 0, 1, 1},
64015  {&__pyx_n_s_waveHeight, __pyx_k_waveHeight, sizeof(__pyx_k_waveHeight), 0, 0, 1, 1},
64016  {&__pyx_n_s_waveList, __pyx_k_waveList, sizeof(__pyx_k_waveList), 0, 0, 1, 1},
64017  {&__pyx_n_s_waveType, __pyx_k_waveType, sizeof(__pyx_k_waveType), 0, 0, 1, 1},
64018  {&__pyx_n_s_waveheight, __pyx_k_waveheight, sizeof(__pyx_k_waveheight), 0, 0, 1, 1},
64019  {&__pyx_n_s_wavelength, __pyx_k_wavelength, sizeof(__pyx_k_wavelength), 0, 0, 1, 1},
64020  {&__pyx_kp_s_waves_This_may_take_a_while, __pyx_k_waves_This_may_take_a_while, sizeof(__pyx_k_waves_This_may_take_a_while), 0, 0, 1, 0},
64021  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
64022  {&__pyx_n_s_wind, __pyx_k_wind, sizeof(__pyx_k_wind), 0, 0, 1, 1},
64023  {&__pyx_n_s_windOut, __pyx_k_windOut, sizeof(__pyx_k_windOut), 0, 0, 1, 1},
64024  {&__pyx_n_s_window_params, __pyx_k_window_params, sizeof(__pyx_k_window_params), 0, 0, 1, 1},
64025  {&__pyx_n_s_windows, __pyx_k_windows, sizeof(__pyx_k_windows), 0, 0, 1, 1},
64026  {&__pyx_n_s_writeEtaSeries, __pyx_k_writeEtaSeries, sizeof(__pyx_k_writeEtaSeries), 0, 0, 1, 1},
64027  {&__pyx_n_s_writeInput, __pyx_k_writeInput, sizeof(__pyx_k_writeInput), 0, 0, 1, 1},
64028  {&__pyx_n_s_wtError, __pyx_k_wtError, sizeof(__pyx_k_wtError), 0, 0, 1, 1},
64029  {&__pyx_n_s_ww, __pyx_k_ww, sizeof(__pyx_k_ww), 0, 0, 1, 1},
64030  {&__pyx_n_s_wwi_setUp, __pyx_k_wwi_setUp, sizeof(__pyx_k_wwi_setUp), 0, 0, 1, 1},
64031  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
64032  {&__pyx_n_s_x0, __pyx_k_x0, sizeof(__pyx_k_x0), 0, 0, 1, 1},
64033  {&__pyx_n_s_xfocus, __pyx_k_xfocus, sizeof(__pyx_k_xfocus), 0, 0, 1, 1},
64034  {&__pyx_n_s_xx, __pyx_k_xx, sizeof(__pyx_k_xx), 0, 0, 1, 1},
64035  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
64036  {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
64037  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
64038  {0, 0, 0, 0, 0, 0, 0}
64039 };
64040 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
64041  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2571, __pyx_L1_error)
64042  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 344, __pyx_L1_error)
64043  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
64044  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 1380, __pyx_L1_error)
64045  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 2161, __pyx_L1_error)
64046  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 2674, __pyx_L1_error)
64047  __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 2730, __pyx_L1_error)
64048  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 272, __pyx_L1_error)
64049  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 285, __pyx_L1_error)
64050  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 856, __pyx_L1_error)
64051  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1038, __pyx_L1_error)
64052  return 0;
64053  __pyx_L1_error:;
64054  return -1;
64055 }
64056 
64057 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
64058  __Pyx_RefNannyDeclarations
64059  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
64060 
64061  /* "WaveTools.py":254
64062  * #print self.dircheck
64063  * if dircheck > 1e-10:
64064  * logEvent("Wave direction is not perpendicular to gravity vector. Check input",level=0) # <<<<<<<<<<<<<<
64065  * return sys.exit(1)
64066  * else:
64067  */
64068  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Wave_direction_is_not_perpendicu); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 254, __pyx_L1_error)
64069  __Pyx_GOTREF(__pyx_tuple_);
64070  __Pyx_GIVEREF(__pyx_tuple_);
64071 
64072  /* "WaveTools.py":277
64073  *
64074  * """
64075  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist() # <<<<<<<<<<<<<<
64076  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df])
64077  * def returnRectangles(a,x):
64078  */
64079  __pyx_slice__2 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 277, __pyx_L1_error)
64080  __Pyx_GOTREF(__pyx_slice__2);
64081  __Pyx_GIVEREF(__pyx_slice__2);
64082  __pyx_slice__3 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 277, __pyx_L1_error)
64083  __Pyx_GOTREF(__pyx_slice__3);
64084  __Pyx_GIVEREF(__pyx_slice__3);
64085 
64086  /* "WaveTools.py":319
64087  * numpy.ndarray
64088  * """
64089  * ai = 0.5*(a[1:,:]+a[:-1,:]) # <<<<<<<<<<<<<<
64090  * ai = 0.5*(ai[:,1:]+ai[:,:-1])
64091  * for ii in range(len(x)-1):
64092  */
64093  __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(0, 319, __pyx_L1_error)
64094  __Pyx_GOTREF(__pyx_slice__4);
64095  __Pyx_GIVEREF(__pyx_slice__4);
64096  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_slice__2, __pyx_slice__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 319, __pyx_L1_error)
64097  __Pyx_GOTREF(__pyx_tuple__5);
64098  __Pyx_GIVEREF(__pyx_tuple__5);
64099  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_slice__3, __pyx_slice__4); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 319, __pyx_L1_error)
64100  __Pyx_GOTREF(__pyx_tuple__6);
64101  __Pyx_GIVEREF(__pyx_tuple__6);
64102 
64103  /* "WaveTools.py":320
64104  * """
64105  * ai = 0.5*(a[1:,:]+a[:-1,:])
64106  * ai = 0.5*(ai[:,1:]+ai[:,:-1]) # <<<<<<<<<<<<<<
64107  * for ii in range(len(x)-1):
64108  * ai[ii,:] *= (y[1:]-y[:-1])
64109  */
64110  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_slice__4, __pyx_slice__2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 320, __pyx_L1_error)
64111  __Pyx_GOTREF(__pyx_tuple__7);
64112  __Pyx_GIVEREF(__pyx_tuple__7);
64113  __pyx_tuple__8 = PyTuple_Pack(2, __pyx_slice__4, __pyx_slice__3); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 320, __pyx_L1_error)
64114  __Pyx_GOTREF(__pyx_tuple__8);
64115  __Pyx_GIVEREF(__pyx_tuple__8);
64116 
64117  /* "WaveTools.py":529
64118  *
64119  * """
64120  * return (old_div(5.0,16.0))*Hs**2*(old_div(f0**4,f**5))*np.exp((old_div(-5.0,4.0))*(old_div(f0,f))**4) # <<<<<<<<<<<<<<
64121  *
64122  * def cos2s(theta,f,s=10):
64123  */
64124  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_float_5_0, __pyx_float_16_0); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 529, __pyx_L1_error)
64125  __Pyx_GOTREF(__pyx_tuple__9);
64126  __Pyx_GIVEREF(__pyx_tuple__9);
64127  __pyx_tuple__10 = PyTuple_Pack(2, __pyx_float_neg_5_0, __pyx_float_4_0); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 529, __pyx_L1_error)
64128  __Pyx_GOTREF(__pyx_tuple__10);
64129  __Pyx_GIVEREF(__pyx_tuple__10);
64130 
64131  /* "WaveTools.py":550
64132  * """
64133  * fun = np.zeros((len(theta),len(f)),)
64134  * for ii in range(len(fun[0,:])): # <<<<<<<<<<<<<<
64135  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
64136  * return fun
64137  */
64138  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_0, __pyx_slice__4); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 550, __pyx_L1_error)
64139  __Pyx_GOTREF(__pyx_tuple__11);
64140  __Pyx_GIVEREF(__pyx_tuple__11);
64141 
64142  /* "WaveTools.py":990
64143  * self.wavelength=wavelength
64144  * except:
64145  * logEvent("ERROR! Wavetools.py: Wavelenght is not defined for nonlinear waves. Enter wavelength in class arguments",level=0) # <<<<<<<<<<<<<<
64146  * sys.exit(1)
64147  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ):
64148  */
64149  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_Wavelenght_is); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 990, __pyx_L1_error)
64150  __Pyx_GOTREF(__pyx_tuple__16);
64151  __Pyx_GIVEREF(__pyx_tuple__16);
64152 
64153  /* "WaveTools.py":993
64154  * sys.exit(1)
64155  * if ( (len(self.Ycoeff)!=self.Nf) or (len(self.Bcoeff)!=self.Nf) or (Ycoeff[0]==0.) or (Bcoeff[0]==0.) ):
64156  * logEvent("ERROR! Wavetools.py: Ycoeff and Bcoeff must have the same length and equal to Nf and the 1st order harmonic must not be zero",level=0) # <<<<<<<<<<<<<<
64157  * sys.exit(1)
64158  * else:
64159  */
64160  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_Ycoeff_and_Bc); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 993, __pyx_L1_error)
64161  __Pyx_GOTREF(__pyx_tuple__17);
64162  __Pyx_GIVEREF(__pyx_tuple__17);
64163 
64164  /* "WaveTools.py":1043
64165  *
64166  * if(len(meanVelocity) != 3):
64167  * logEvent("ERROR! Wavetools.py: meanVelocity should be a vector with 3 components. ",level=0) # <<<<<<<<<<<<<<
64168  * sys.exit(1)
64169  * if(self.Nf > 1000):
64170  */
64171  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_meanVelocity); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 1043, __pyx_L1_error)
64172  __Pyx_GOTREF(__pyx_tuple__18);
64173  __Pyx_GIVEREF(__pyx_tuple__18);
64174 
64175  /* "WaveTools.py":1046
64176  * sys.exit(1)
64177  * if(self.Nf > 1000):
64178  * logEvent("ERROR! Wavetools.py: You are not really using more than 1000 Fourier modes for a regular wave, right? ",level=0) # <<<<<<<<<<<<<<
64179  * sys.exit(1)
64180  *
64181  */
64182  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_You_are_not_r); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1046, __pyx_L1_error)
64183  __Pyx_GOTREF(__pyx_tuple__19);
64184  __Pyx_GIVEREF(__pyx_tuple__19);
64185 
64186  /* "(tree fragment)":2
64187  * def __reduce_cython__(self):
64188  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
64189  * def __setstate_cython__(self, __pyx_state):
64190  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
64191  */
64192  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_self_Bcoeff__self_Ycoeff__self); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 2, __pyx_L1_error)
64193  __Pyx_GOTREF(__pyx_tuple__20);
64194  __Pyx_GIVEREF(__pyx_tuple__20);
64195 
64196  /* "(tree fragment)":4
64197  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
64198  * def __setstate_cython__(self, __pyx_state):
64199  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
64200  */
64201  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_self_Bcoeff__self_Ycoeff__self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 4, __pyx_L1_error)
64202  __Pyx_GOTREF(__pyx_tuple__21);
64203  __Pyx_GIVEREF(__pyx_tuple__21);
64204 
64205  /* "WaveTools.py":1263
64206  * self.kDir[:,ii] = self.ki[:] * self.waveDir[ii]
64207  * if(self.N > 10000):
64208  * logEvent("ERROR! Wavetools.py: Maximum number of frequencies for Random Waves is 10000 ",level=0) # <<<<<<<<<<<<<<
64209  * self.phi= -sum(self.kDir[:,j]*xfocus[j] for j in range(3))+tfocus*self.omega
64210  *
64211  */
64212  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 1263, __pyx_L1_error)
64213  __Pyx_GOTREF(__pyx_tuple__23);
64214  __Pyx_GIVEREF(__pyx_tuple__23);
64215 
64216  /* "WaveTools.py":1389
64217  * np.savetxt(fname,list(zip(time,etaR)))
64218  * series = np.zeros((len(time),2),)
64219  * series[:,0] = time # <<<<<<<<<<<<<<
64220  * series[:,1] = etaR
64221  *
64222  */
64223  __pyx_tuple__25 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_0); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1389, __pyx_L1_error)
64224  __Pyx_GOTREF(__pyx_tuple__25);
64225  __Pyx_GIVEREF(__pyx_tuple__25);
64226 
64227  /* "WaveTools.py":1390
64228  * series = np.zeros((len(time),2),)
64229  * series[:,0] = time
64230  * series[:,1] = etaR # <<<<<<<<<<<<<<
64231  *
64232  * return series
64233  */
64234  __pyx_tuple__26 = PyTuple_Pack(2, __pyx_slice__4, __pyx_int_1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1390, __pyx_L1_error)
64235  __Pyx_GOTREF(__pyx_tuple__26);
64236  __Pyx_GIVEREF(__pyx_tuple__26);
64237 
64238  /* "(tree fragment)":2
64239  * def __reduce_cython__(self):
64240  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64241  * def __setstate_cython__(self, __pyx_state):
64242  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64243  */
64244  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error)
64245  __Pyx_GOTREF(__pyx_tuple__27);
64246  __Pyx_GIVEREF(__pyx_tuple__27);
64247 
64248  /* "(tree fragment)":4
64249  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64250  * def __setstate_cython__(self, __pyx_state):
64251  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64252  */
64253  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error)
64254  __Pyx_GOTREF(__pyx_tuple__28);
64255  __Pyx_GIVEREF(__pyx_tuple__28);
64256 
64257  /* "(tree fragment)":2
64258  * def __reduce_cython__(self):
64259  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64260  * def __setstate_cython__(self, __pyx_state):
64261  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64262  */
64263  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
64264  __Pyx_GOTREF(__pyx_tuple__30);
64265  __Pyx_GIVEREF(__pyx_tuple__30);
64266 
64267  /* "(tree fragment)":4
64268  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64269  * def __setstate_cython__(self, __pyx_state):
64270  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64271  */
64272  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
64273  __Pyx_GOTREF(__pyx_tuple__31);
64274  __Pyx_GIVEREF(__pyx_tuple__31);
64275 
64276  /* "WaveTools.py":1709
64277  * self.Nall+=nn
64278  * if(self.Nall > 10000):
64279  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for MultispectraRandomWaves is 10000 ",level=0) # <<<<<<<<<<<<<<
64280  *
64281  *
64282  */
64283  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe_2); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1709, __pyx_L1_error)
64284  __Pyx_GOTREF(__pyx_tuple__32);
64285  __Pyx_GIVEREF(__pyx_tuple__32);
64286 
64287  /* "WaveTools.py":1744
64288  * self.kiM[NN1:NN] = RW.ki
64289  * self.aiM[NN1:NN] = RW.ai
64290  * self.kDirM[NN1:NN,:] =RW.kDir[:,:] # <<<<<<<<<<<<<<
64291  * self.phiM[NN1:NN] = RW.phi
64292  * for ij in range(3):
64293  */
64294  __pyx_tuple__33 = PyTuple_Pack(2, __pyx_slice__4, __pyx_slice__4); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1744, __pyx_L1_error)
64295  __Pyx_GOTREF(__pyx_tuple__33);
64296  __Pyx_GIVEREF(__pyx_tuple__33);
64297 
64298  /* "(tree fragment)":2
64299  * def __reduce_cython__(self):
64300  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64301  * def __setstate_cython__(self, __pyx_state):
64302  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64303  */
64304  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
64305  __Pyx_GOTREF(__pyx_tuple__34);
64306  __Pyx_GIVEREF(__pyx_tuple__34);
64307 
64308  /* "(tree fragment)":4
64309  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64310  * def __setstate_cython__(self, __pyx_state):
64311  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64312  */
64313  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
64314  __Pyx_GOTREF(__pyx_tuple__35);
64315  __Pyx_GIVEREF(__pyx_tuple__35);
64316 
64317  /* "WaveTools.py":1899
64318  * self.vDir = setVertDir(g)
64319  * if(self.Nall > 100000):
64320  * logEvent("ERROR! Wavetools.py: Maximum (number of frequencies) x (No of spectra) for DirectionalWaves is 100000 ",level=0) # <<<<<<<<<<<<<<
64321  *
64322  *
64323  */
64324  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_Maximum_numbe_3); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1899, __pyx_L1_error)
64325  __Pyx_GOTREF(__pyx_tuple__36);
64326  __Pyx_GIVEREF(__pyx_tuple__36);
64327 
64328  /* "WaveTools.py":1929
64329  * self.gAbs = sqrt(g[0]*g[0]+g[1]*g[1]+g[2]*g[2])
64330  *
64331  * temp_array = np.zeros((1,3),) # <<<<<<<<<<<<<<
64332  * temp_array[0,:] = waveDir0
64333  * directions = list(range(0,self.Mtot))
64334  */
64335  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_3); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1929, __pyx_L1_error)
64336  __Pyx_GOTREF(__pyx_tuple__37);
64337  __Pyx_GIVEREF(__pyx_tuple__37);
64338 
64339  /* "(tree fragment)":2
64340  * def __reduce_cython__(self):
64341  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64342  * def __setstate_cython__(self, __pyx_state):
64343  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64344  */
64345  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 2, __pyx_L1_error)
64346  __Pyx_GOTREF(__pyx_tuple__38);
64347  __Pyx_GIVEREF(__pyx_tuple__38);
64348 
64349  /* "(tree fragment)":4
64350  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
64351  * def __setstate_cython__(self, __pyx_state):
64352  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
64353  */
64354  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 4, __pyx_L1_error)
64355  __Pyx_GOTREF(__pyx_tuple__39);
64356  __Pyx_GIVEREF(__pyx_tuple__39);
64357 
64358  /* "WaveTools.py":2138
64359  * self.x0 = timeSeriesPosition
64360  * else:
64361  * logEvent("ERROR! Wavetools.py: Location vector for timeSeries must have three-components",level=0) # <<<<<<<<<<<<<<
64362  * sys.exit(1)
64363  *
64364  */
64365  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_ERROR_Wavetools_py_Location_vect_2); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 2138, __pyx_L1_error)
64366  __Pyx_GOTREF(__pyx_tuple__41);
64367  __Pyx_GIVEREF(__pyx_tuple__41);
64368 
64369  /* "WaveTools.py":2160
64370  * tdata = seriesArray
64371  * else:
64372  * filetype = timeSeriesFile[-4:] # <<<<<<<<<<<<<<
64373  * fid = open(timeSeriesFile,"r")
64374  * if (filetype !=".txt") and (filetype != ".csv"):
64375  */
64376  __pyx_slice__42 = PySlice_New(__pyx_int_neg_4, Py_None, Py_None); if (unlikely(!__pyx_slice__42)) __PYX_ERR(0, 2160, __pyx_L1_error)
64377  __Pyx_GOTREF(__pyx_slice__42);
64378  __Pyx_GIVEREF(__pyx_slice__42);
64379 
64380  /* "WaveTools.py":2193
64381  * doInterp = True
64382  * if(doInterp):
64383  * logEvent("INFO WaveTools.py: Not constant sampling rate found, proceeding to signal interpolation to a constant sampling rate",level=0) # <<<<<<<<<<<<<<
64384  * self.time = np.linspace(time_temp[0],time_temp[-1],len(time_temp))
64385  * self.etaS = np.interp(self.time,time_temp,tdata[:,1])
64386  */
64387  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_INFO_WaveTools_py_Not_constant_s); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 2193, __pyx_L1_error)
64388  __Pyx_GOTREF(__pyx_tuple__44);
64389  __Pyx_GIVEREF(__pyx_tuple__44);
64390 
64391  /* "WaveTools.py":2318
64392  * # Setting where each window starts and ends
64393  * for jj in range(self.Nwindows):
64394  * span = np.zeros(2,"d") # <<<<<<<<<<<<<<
64395  * tfirst = self.time[0] + self.Twindow
64396  * tlast = self.time[-1] - self.Twindow
64397  */
64398  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_int_2, __pyx_n_s_d); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 2318, __pyx_L1_error)
64399  __Pyx_GOTREF(__pyx_tuple__45);
64400  __Pyx_GIVEREF(__pyx_tuple__45);
64401 
64402  /* "WaveTools.py":2381
64403  * for ii in range(len(self.windows_handover)):
64404  * self.whand_c[ii] = self.windows_handover[ii]
64405  * self.T0[ii] = self.windows_rec[ii][0,0] # <<<<<<<<<<<<<<
64406  * self.whand_ = self.whand_c
64407  * self.T0_ = self.T0
64408  */
64409  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 2381, __pyx_L1_error)
64410  __Pyx_GOTREF(__pyx_tuple__46);
64411  __Pyx_GIVEREF(__pyx_tuple__46);
64412 
64413  /* "(tree fragment)":2
64414  * def __reduce_cython__(self):
64415  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
64416  * def __setstate_cython__(self, __pyx_state):
64417  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
64418  */
64419  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_self_T0__self__cpp_eta_self__cpp); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 2, __pyx_L1_error)
64420  __Pyx_GOTREF(__pyx_tuple__47);
64421  __Pyx_GIVEREF(__pyx_tuple__47);
64422 
64423  /* "(tree fragment)":4
64424  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
64425  * def __setstate_cython__(self, __pyx_state):
64426  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
64427  */
64428  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_self_T0__self__cpp_eta_self__cpp); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 4, __pyx_L1_error)
64429  __Pyx_GOTREF(__pyx_tuple__48);
64430  __Pyx_GIVEREF(__pyx_tuple__48);
64431 
64432  /* "WaveTools.py":2669
64433  * self.series = RW.writeEtaSeries(Tstart,Tend,x0,fname,4.*self.Lgen)
64434  * self.cutoff = max(0.2*self.Tp , cutoff_win*Nwaves*Tp)
64435  * duration = (self.series[-1,0]-self.series[0,0]) # <<<<<<<<<<<<<<
64436  * self.cutoff = old_div(self.cutoff, duration)
64437  * Tm = old_div(self.Tp,1.1)
64438  */
64439  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 2669, __pyx_L1_error)
64440  __Pyx_GOTREF(__pyx_tuple__49);
64441  __Pyx_GIVEREF(__pyx_tuple__49);
64442 
64443  /* "WaveTools.py":2718
64444  * self.er1 = old_div(max(errors[:]),self.Hs)
64445  * if self.er1 > 0.01 and checkAcc:
64446  * logEvent('ERROR!: WaveTools.py: Found large errors error={s}) during window reconstruction at RandomWavesFast. Please a) Increase Nfreq, b) Decrease waves per window to decrease error < 1%. You can set checkAcc = False if you want to proceed with these errors',level=0) # <<<<<<<<<<<<<<
64447  * sys.exit(1)
64448  *
64449  */
64450  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_ERROR_WaveTools_py_Found_large_e); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 2718, __pyx_L1_error)
64451  __Pyx_GOTREF(__pyx_tuple__50);
64452  __Pyx_GIVEREF(__pyx_tuple__50);
64453 
64454  /* "WaveTools.py":3097
64455  * """
64456  *
64457  * logEvent("ERROR! Wavetools.py: eta and u functions not available for this class. Please use RandomNLWavesFast for generating random waves with nonlinear correction",0) # <<<<<<<<<<<<<<
64458  * sys.exit(1)
64459  *
64460  */
64461  __pyx_tuple__53 = PyTuple_Pack(2, __pyx_kp_s_ERROR_Wavetools_py_eta_and_u_fun, __pyx_int_0); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 3097, __pyx_L1_error)
64462  __Pyx_GOTREF(__pyx_tuple__53);
64463  __Pyx_GIVEREF(__pyx_tuple__53);
64464 
64465  /* "(tree fragment)":2
64466  * def __reduce_cython__(self):
64467  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
64468  * def __setstate_cython__(self, __pyx_state):
64469  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
64470  */
64471  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_self_ai__self_kDir__self_ki__sel); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 2, __pyx_L1_error)
64472  __Pyx_GOTREF(__pyx_tuple__54);
64473  __Pyx_GIVEREF(__pyx_tuple__54);
64474 
64475  /* "(tree fragment)":4
64476  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
64477  * def __setstate_cython__(self, __pyx_state):
64478  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
64479  */
64480  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_self_ai__self_kDir__self_ki__sel); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 4, __pyx_L1_error)
64481  __Pyx_GOTREF(__pyx_tuple__55);
64482  __Pyx_GIVEREF(__pyx_tuple__55);
64483 
64484  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
64485  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
64486  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
64487  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
64488  *
64489  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
64490  */
64491  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(3, 272, __pyx_L1_error)
64492  __Pyx_GOTREF(__pyx_tuple__56);
64493  __Pyx_GIVEREF(__pyx_tuple__56);
64494 
64495  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
64496  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
64497  * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
64498  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
64499  *
64500  * info.buf = PyArray_DATA(self)
64501  */
64502  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(3, 276, __pyx_L1_error)
64503  __Pyx_GOTREF(__pyx_tuple__57);
64504  __Pyx_GIVEREF(__pyx_tuple__57);
64505 
64506  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":306
64507  * if ((descr.byteorder == c'>' and little_endian) or
64508  * (descr.byteorder == c'<' and not little_endian)):
64509  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
64510  * if t == NPY_BYTE: f = "b"
64511  * elif t == NPY_UBYTE: f = "B"
64512  */
64513  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(3, 306, __pyx_L1_error)
64514  __Pyx_GOTREF(__pyx_tuple__58);
64515  __Pyx_GIVEREF(__pyx_tuple__58);
64516 
64517  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
64518  *
64519  * if (end - f) - <int>(new_offset - offset[0]) < 15:
64520  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
64521  *
64522  * if ((child.byteorder == c'>' and little_endian) or
64523  */
64524  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(3, 856, __pyx_L1_error)
64525  __Pyx_GOTREF(__pyx_tuple__59);
64526  __Pyx_GIVEREF(__pyx_tuple__59);
64527 
64528  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":880
64529  * t = child.type_num
64530  * if end - f < 5:
64531  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
64532  *
64533  * # Until ticket #99 is fixed, use integers to avoid warnings
64534  */
64535  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(3, 880, __pyx_L1_error)
64536  __Pyx_GOTREF(__pyx_tuple__60);
64537  __Pyx_GIVEREF(__pyx_tuple__60);
64538 
64539  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1038
64540  * _import_array()
64541  * except Exception:
64542  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
64543  *
64544  * cdef inline int import_umath() except -1:
64545  */
64546  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(3, 1038, __pyx_L1_error)
64547  __Pyx_GOTREF(__pyx_tuple__61);
64548  __Pyx_GIVEREF(__pyx_tuple__61);
64549 
64550  /* "linux/lib/python3.7/site-packages/Cython/Includes/numpy/__init__.pxd":1044
64551  * _import_umath()
64552  * except Exception:
64553  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
64554  *
64555  * cdef inline int import_ufunc() except -1:
64556  */
64557  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(3, 1044, __pyx_L1_error)
64558  __Pyx_GOTREF(__pyx_tuple__62);
64559  __Pyx_GIVEREF(__pyx_tuple__62);
64560 
64561  /* "WaveTools.py":67
64562  *
64563  *
64564  * def fastcos_test(phase,sinus=False): # <<<<<<<<<<<<<<
64565  * """Fast cosine function with Taylor approximation - TO BE USED FOR TESTING"
64566  * Parameters
64567  */
64568  __pyx_tuple__63 = PyTuple_Pack(2, __pyx_n_s_phase, __pyx_n_s_sinus); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 67, __pyx_L1_error)
64569  __Pyx_GOTREF(__pyx_tuple__63);
64570  __Pyx_GIVEREF(__pyx_tuple__63);
64571  __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_fastcos_test, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 67, __pyx_L1_error)
64572  __pyx_tuple__65 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 67, __pyx_L1_error)
64573  __Pyx_GOTREF(__pyx_tuple__65);
64574  __Pyx_GIVEREF(__pyx_tuple__65);
64575 
64576  /* "WaveTools.py":84
64577  * phase = old_div(np.pi,2.) - phase
64578  * return fastcos(phase,True)
64579  * def fastcosh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
64580  * """Fast hyperbolic cosine function with Taylor approximation - TO BE USED FOR TESTING"
64581  * Parameters
64582  */
64583  __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_k, __pyx_n_s_Z, __pyx_n_s_fast, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 84, __pyx_L1_error)
64584  __Pyx_GOTREF(__pyx_tuple__66);
64585  __Pyx_GIVEREF(__pyx_tuple__66);
64586  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_fastcosh_test, 84, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 84, __pyx_L1_error)
64587  __pyx_tuple__68 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 84, __pyx_L1_error)
64588  __Pyx_GOTREF(__pyx_tuple__68);
64589  __Pyx_GIVEREF(__pyx_tuple__68);
64590 
64591  /* "WaveTools.py":100
64592  * fastcosh(xx,k,Z,fast)
64593  * return xx[0]
64594  * def fastsinh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
64595  * """Fast hyperbolic sine function with Taylor approximation - TO BE USED FOR TESTING"
64596  * Parameters
64597  */
64598  __pyx_tuple__69 = PyTuple_Pack(4, __pyx_n_s_k, __pyx_n_s_Z, __pyx_n_s_fast, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 100, __pyx_L1_error)
64599  __Pyx_GOTREF(__pyx_tuple__69);
64600  __Pyx_GIVEREF(__pyx_tuple__69);
64601  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_fastsinh_test, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 100, __pyx_L1_error)
64602  __pyx_tuple__71 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 100, __pyx_L1_error)
64603  __Pyx_GOTREF(__pyx_tuple__71);
64604  __Pyx_GIVEREF(__pyx_tuple__71);
64605 
64606  /* "WaveTools.py":118
64607  *
64608  *
64609  * def coshkzd_test(k,Z,d, fast=True): # <<<<<<<<<<<<<<
64610  * """Calculation of u horizontal profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
64611  * and hyp trig relation cosh(a+b) = cosha*coshb+sinha*sinhb
64612  */
64613  __pyx_tuple__72 = PyTuple_Pack(4, __pyx_n_s_k, __pyx_n_s_Z, __pyx_n_s_d, __pyx_n_s_fast); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 118, __pyx_L1_error)
64614  __Pyx_GOTREF(__pyx_tuple__72);
64615  __Pyx_GIVEREF(__pyx_tuple__72);
64616  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_coshkzd_test, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 118, __pyx_L1_error)
64617  __pyx_tuple__74 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 118, __pyx_L1_error)
64618  __Pyx_GOTREF(__pyx_tuple__74);
64619  __Pyx_GIVEREF(__pyx_tuple__74);
64620 
64621  /* "WaveTools.py":140
64622  * return 0.
64623  *
64624  * def sinhkzd_test(k,Z,d,fast=True): # <<<<<<<<<<<<<<
64625  * """Calculation of v vertical profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
64626  * and hyp trig relation sinh(a+b) = sinha*coshb+cosha*sinhb
64627  */
64628  __pyx_tuple__75 = PyTuple_Pack(4, __pyx_n_s_k, __pyx_n_s_Z, __pyx_n_s_d, __pyx_n_s_fast); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 140, __pyx_L1_error)
64629  __Pyx_GOTREF(__pyx_tuple__75);
64630  __Pyx_GIVEREF(__pyx_tuple__75);
64631  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_sinhkzd_test, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 140, __pyx_L1_error)
64632  __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 140, __pyx_L1_error)
64633  __Pyx_GOTREF(__pyx_tuple__77);
64634  __Pyx_GIVEREF(__pyx_tuple__77);
64635 
64636  /* "WaveTools.py":163
64637  * return 0.
64638  *
64639  * def loadExistingFunction(funcName, validFunctions): # <<<<<<<<<<<<<<
64640  * """Checks if a function name is known function and returns it
64641  *
64642  */
64643  __pyx_tuple__78 = PyTuple_Pack(5, __pyx_n_s_funcName, __pyx_n_s_validFunctions, __pyx_n_s_funcNames, __pyx_n_s_func, __pyx_n_s_func_ret); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 163, __pyx_L1_error)
64644  __Pyx_GOTREF(__pyx_tuple__78);
64645  __Pyx_GIVEREF(__pyx_tuple__78);
64646  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_loadExistingFunction, 163, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 163, __pyx_L1_error)
64647 
64648  /* "WaveTools.py":198
64649  *
64650  *
64651  * def setVertDir(g): # <<<<<<<<<<<<<<
64652  * """ Returns the unit vector for the vertical direction
64653  *
64654  */
64655  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_n_s_g); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 198, __pyx_L1_error)
64656  __Pyx_GOTREF(__pyx_tuple__80);
64657  __Pyx_GIVEREF(__pyx_tuple__80);
64658  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_setVertDir, 198, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 198, __pyx_L1_error)
64659 
64660  /* "WaveTools.py":216
64661  *
64662  *
64663  * def setDirVector(vector): # <<<<<<<<<<<<<<
64664  * """ Returns the direction of a vector in the form of a unit vector
64665  *
64666  */
64667  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_vector); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 216, __pyx_L1_error)
64668  __Pyx_GOTREF(__pyx_tuple__82);
64669  __Pyx_GIVEREF(__pyx_tuple__82);
64670  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_setDirVector, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 216, __pyx_L1_error)
64671 
64672  /* "WaveTools.py":231
64673  * return old_div(vector,(sqrt(vector[0]**2 + vector[1]**2 + vector[2]**2)))
64674  *
64675  * def dirCheck(v1, v2): # <<<<<<<<<<<<<<
64676  * """ Checks if two vectors are vertical raises SystemError if True
64677  *
64678  */
64679  __pyx_tuple__84 = PyTuple_Pack(3, __pyx_n_s_v1, __pyx_n_s_v2, __pyx_n_s_dircheck); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 231, __pyx_L1_error)
64680  __Pyx_GOTREF(__pyx_tuple__84);
64681  __Pyx_GIVEREF(__pyx_tuple__84);
64682  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_dirCheck, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 231, __pyx_L1_error)
64683 
64684  /* "WaveTools.py":258
64685  * else:
64686  * return None
64687  * def reduceToIntervals(fi,df): # <<<<<<<<<<<<<<
64688  * """ Prepares the x-axis array with N elements for numerical integration
64689  *
64690  */
64691  __pyx_tuple__86 = PyTuple_Pack(3, __pyx_n_s_fi, __pyx_n_s_df, __pyx_n_s_fim_tmp); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 258, __pyx_L1_error)
64692  __Pyx_GOTREF(__pyx_tuple__86);
64693  __Pyx_GIVEREF(__pyx_tuple__86);
64694  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_reduceToIntervals, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 258, __pyx_L1_error)
64695 
64696  /* "WaveTools.py":279
64697  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist()
64698  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df])
64699  * def returnRectangles(a,x): # <<<<<<<<<<<<<<
64700  * """ Returns 2D discrete integral array using the rectangle method
64701  *
64702  */
64703  __pyx_tuple__88 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_x); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 279, __pyx_L1_error)
64704  __Pyx_GOTREF(__pyx_tuple__88);
64705  __Pyx_GIVEREF(__pyx_tuple__88);
64706  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_returnRectangles, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 279, __pyx_L1_error)
64707 
64708  /* "WaveTools.py":299
64709  * """
64710  * return 0.5*(a[1:]+a[:-1])*(x[1:]-x[:-1])
64711  * def returnRectangles3D(a,x,y): # <<<<<<<<<<<<<<
64712  * """ Returns 3D discrete integrals using the rectangle method
64713  *
64714  */
64715  __pyx_tuple__90 = PyTuple_Pack(6, __pyx_n_s_a, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_ai, __pyx_n_s_ii, __pyx_n_s_jj); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 299, __pyx_L1_error)
64716  __Pyx_GOTREF(__pyx_tuple__90);
64717  __Pyx_GIVEREF(__pyx_tuple__90);
64718  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_returnRectangles3D, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 299, __pyx_L1_error)
64719 
64720  /* "WaveTools.py":326
64721  * ai[:,jj] *= (x[1:]-x[:-1])
64722  * return ai
64723  * def normIntegral(f,dom): # <<<<<<<<<<<<<<
64724  * """Returns a normalised 2D function
64725  *
64726  */
64727  __pyx_tuple__92 = PyTuple_Pack(3, __pyx_n_s_f, __pyx_n_s_dom, __pyx_n_s_G0); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 326, __pyx_L1_error)
64728  __Pyx_GOTREF(__pyx_tuple__92);
64729  __Pyx_GIVEREF(__pyx_tuple__92);
64730  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_normIntegral, 326, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 326, __pyx_L1_error)
64731 
64732  /* "WaveTools.py":349
64733  *
64734  *
64735  * def eta_mode(x, t, kDir, omega, phi, amplitude): # <<<<<<<<<<<<<<
64736  * """Calculates the free surface elevation for a single frequency mode
64737  *
64738  */
64739  __pyx_tuple__94 = PyTuple_Pack(7, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_kDir, __pyx_n_s_omega, __pyx_n_s_phi, __pyx_n_s_amplitude, __pyx_n_s_phase); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 349, __pyx_L1_error)
64740  __Pyx_GOTREF(__pyx_tuple__94);
64741  __Pyx_GIVEREF(__pyx_tuple__94);
64742  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(6, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__94, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta_mode, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 349, __pyx_L1_error)
64743 
64744  /* "WaveTools.py":375
64745  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
64746  * return amplitude*cos(phase)
64747  * def Udrift(amp,gAbs,c,d): # <<<<<<<<<<<<<<
64748  * """Calculates the 2nd order Stokes drift for a linear mode
64749  *
64750  */
64751  __pyx_tuple__96 = PyTuple_Pack(4, __pyx_n_s_amp, __pyx_n_s_gAbs, __pyx_n_s_c, __pyx_n_s_d); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(0, 375, __pyx_L1_error)
64752  __Pyx_GOTREF(__pyx_tuple__96);
64753  __Pyx_GIVEREF(__pyx_tuple__96);
64754  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__96, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_Udrift, 375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 375, __pyx_L1_error)
64755 
64756  /* "WaveTools.py":397
64757  * return 0.5*gAbs*amp*amp/c/d
64758  *
64759  * def vel_mode(x, t, kDir, kAbs, omega, phi, amplitude, mwl, depth, vDir, gAbs): # <<<<<<<<<<<<<<
64760  * """Calculates the wave velocity components for a single frequency mode
64761  *
64762  */
64763  __pyx_tuple__98 = PyTuple_Pack(18, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_kDir, __pyx_n_s_kAbs, __pyx_n_s_omega, __pyx_n_s_phi, __pyx_n_s_amplitude, __pyx_n_s_mwl, __pyx_n_s_depth, __pyx_n_s_vDir, __pyx_n_s_gAbs, __pyx_n_s_phase, __pyx_n_s_Z, __pyx_n_s_UH, __pyx_n_s_UV, __pyx_n_s_ii, __pyx_n_s_waveDir, __pyx_n_s_V); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(0, 397, __pyx_L1_error)
64764  __Pyx_GOTREF(__pyx_tuple__98);
64765  __Pyx_GIVEREF(__pyx_tuple__98);
64766  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(11, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__98, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_vel_mode, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 397, __pyx_L1_error)
64767 
64768  /* "WaveTools.py":447
64769  *
64770  *
64771  * def sigma(omega,omega0): # <<<<<<<<<<<<<<
64772  * """Calculates sigma function for JONSWAP spectrum
64773  *
64774  */
64775  __pyx_tuple__100 = PyTuple_Pack(3, __pyx_n_s_omega, __pyx_n_s_omega0, __pyx_n_s_sigmaReturn); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(0, 447, __pyx_L1_error)
64776  __Pyx_GOTREF(__pyx_tuple__100);
64777  __Pyx_GIVEREF(__pyx_tuple__100);
64778  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__100, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_sigma, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 447, __pyx_L1_error)
64779 
64780  /* "WaveTools.py":467
64781  *
64782  *
64783  * def JONSWAP(f,f0,Hs,gamma=3.3,TMA=False, depth = None): # <<<<<<<<<<<<<<
64784  * """Calculates the JONSWAP frequency spectrum (Goda 2009)
64785  *
64786  */
64787  __pyx_tuple__102 = PyTuple_Pack(11, __pyx_n_s_f, __pyx_n_s_f0, __pyx_n_s_Hs, __pyx_n_s_gamma, __pyx_n_s_TMA, __pyx_n_s_depth, __pyx_n_s_Tp, __pyx_n_s_bj, __pyx_n_s_r, __pyx_n_s_tma, __pyx_n_s_k); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(0, 467, __pyx_L1_error)
64788  __Pyx_GOTREF(__pyx_tuple__102);
64789  __Pyx_GIVEREF(__pyx_tuple__102);
64790  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(6, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__102, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_JONSWAP, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 467, __pyx_L1_error)
64791  __pyx_tuple__104 = PyTuple_Pack(3, ((PyObject*)__pyx_float_3_3), ((PyObject *)Py_False), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 467, __pyx_L1_error)
64792  __Pyx_GOTREF(__pyx_tuple__104);
64793  __Pyx_GIVEREF(__pyx_tuple__104);
64794 
64795  /* "WaveTools.py":507
64796  * return tma * bj*(Hs**2)*(old_div(1.,((Tp**4) *(f**5))))*np.exp(-1.25*(old_div(1.,(Tp*f)**(4.))))*(gamma**r)
64797  *
64798  * def PM_mod(f,f0,Hs): # <<<<<<<<<<<<<<
64799  * """Calculates the Pierson-Moskovitz spectrum (or Bretschneider or ISSC)
64800  *
64801  */
64802  __pyx_tuple__105 = PyTuple_Pack(3, __pyx_n_s_f, __pyx_n_s_f0, __pyx_n_s_Hs); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 507, __pyx_L1_error)
64803  __Pyx_GOTREF(__pyx_tuple__105);
64804  __Pyx_GIVEREF(__pyx_tuple__105);
64805  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_PM_mod, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 507, __pyx_L1_error)
64806 
64807  /* "WaveTools.py":531
64808  * return (old_div(5.0,16.0))*Hs**2*(old_div(f0**4,f**5))*np.exp((old_div(-5.0,4.0))*(old_div(f0,f))**4)
64809  *
64810  * def cos2s(theta,f,s=10): # <<<<<<<<<<<<<<
64811  * """Calculates the cos-2s directional spreading function
64812  * see USACE - CETN-I-28 http://chl.erdc.usace.army.mil/library/publications/chetn/pdf/cetn-i-28.pdf
64813  */
64814  __pyx_tuple__107 = PyTuple_Pack(5, __pyx_n_s_theta, __pyx_n_s_f, __pyx_n_s_s, __pyx_n_s_fun, __pyx_n_s_ii); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 531, __pyx_L1_error)
64815  __Pyx_GOTREF(__pyx_tuple__107);
64816  __Pyx_GIVEREF(__pyx_tuple__107);
64817  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_cos2s, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 531, __pyx_L1_error)
64818  __pyx_tuple__109 = PyTuple_Pack(1, ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 531, __pyx_L1_error)
64819  __Pyx_GOTREF(__pyx_tuple__109);
64820  __Pyx_GIVEREF(__pyx_tuple__109);
64821 
64822  /* "WaveTools.py":553
64823  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
64824  * return fun
64825  * def mitsuyasu(theta,fi,f0,smax=10): # <<<<<<<<<<<<<<
64826  * """The cos2s wave directional spread with wave frequency dependency
64827  *
64828  */
64829  __pyx_tuple__110 = PyTuple_Pack(7, __pyx_n_s_theta, __pyx_n_s_fi, __pyx_n_s_f0, __pyx_n_s_smax, __pyx_n_s_s, __pyx_n_s_ii, __pyx_n_s_fun); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 553, __pyx_L1_error)
64830  __Pyx_GOTREF(__pyx_tuple__110);
64831  __Pyx_GIVEREF(__pyx_tuple__110);
64832  __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_mitsuyasu, 553, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 553, __pyx_L1_error)
64833  __pyx_tuple__112 = PyTuple_Pack(1, ((PyObject *)__pyx_int_10)); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 553, __pyx_L1_error)
64834  __Pyx_GOTREF(__pyx_tuple__112);
64835  __Pyx_GIVEREF(__pyx_tuple__112);
64836 
64837  /* "WaveTools.py":587
64838  *
64839  *
64840  * def dispersion(w,d, g = 9.81,niter = 1000): # <<<<<<<<<<<<<<
64841  * """Calculates the wave number for single or multiple frequencies using linear dispersion relation.
64842  *
64843  */
64844  __pyx_tuple__113 = PyTuple_Pack(7, __pyx_n_s_w, __pyx_n_s_d, __pyx_n_s_g, __pyx_n_s_niter, __pyx_n_s_w_aux, __pyx_n_s_K, __pyx_n_s_jj); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 587, __pyx_L1_error)
64845  __Pyx_GOTREF(__pyx_tuple__113);
64846  __Pyx_GIVEREF(__pyx_tuple__113);
64847  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_dispersion, 587, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 587, __pyx_L1_error)
64848  __pyx_tuple__115 = PyTuple_Pack(2, ((PyObject*)__pyx_float_9_81), ((PyObject *)__pyx_int_1000)); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 587, __pyx_L1_error)
64849  __Pyx_GOTREF(__pyx_tuple__115);
64850  __Pyx_GIVEREF(__pyx_tuple__115);
64851 
64852  /* "WaveTools.py":616
64853  *
64854  *
64855  * def tophat(l,cutoff): # <<<<<<<<<<<<<<
64856  * """ Calculates and returns a top hat filter array
64857  *
64858  */
64859  __pyx_tuple__116 = PyTuple_Pack(4, __pyx_n_s_l, __pyx_n_s_cutoff, __pyx_n_s_a, __pyx_n_s_cut); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(0, 616, __pyx_L1_error)
64860  __Pyx_GOTREF(__pyx_tuple__116);
64861  __Pyx_GIVEREF(__pyx_tuple__116);
64862  __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__116, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_tophat, 616, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 616, __pyx_L1_error)
64863 
64864  /* "WaveTools.py":636
64865  * return a
64866  *
64867  * def costap(l,cutoff=0.1): # <<<<<<<<<<<<<<
64868  * """ Calculates and returns a top hat filter array
64869  *
64870  */
64871  __pyx_tuple__118 = PyTuple_Pack(5, __pyx_n_s_l, __pyx_n_s_cutoff, __pyx_n_s_npoints, __pyx_n_s_wind, __pyx_n_s_k); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 636, __pyx_L1_error)
64872  __Pyx_GOTREF(__pyx_tuple__118);
64873  __Pyx_GIVEREF(__pyx_tuple__118);
64874  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_costap, 636, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 636, __pyx_L1_error)
64875  __pyx_tuple__120 = PyTuple_Pack(1, ((PyObject*)__pyx_float_0_1)); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 636, __pyx_L1_error)
64876  __Pyx_GOTREF(__pyx_tuple__120);
64877  __Pyx_GIVEREF(__pyx_tuple__120);
64878 
64879  /* "WaveTools.py":659
64880  * return wind
64881  *
64882  * def decompose_tseries(time,eta,dt): # <<<<<<<<<<<<<<
64883  * """ Performs spectral analysis and calculates angular frequency components, amplitude, phase and mean level power
64884  * of a time series with constant sampling.
64885  */
64886  __pyx_tuple__121 = PyTuple_Pack(13, __pyx_n_s_time, __pyx_n_s_eta, __pyx_n_s_dt, __pyx_n_s_nfft, __pyx_n_s_results, __pyx_n_s_fft_x, __pyx_n_s_freq, __pyx_n_s_iend, __pyx_n_s_setup, __pyx_n_s_aa, __pyx_n_s_ww, __pyx_n_s_pp, __pyx_n_s_k); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 659, __pyx_L1_error)
64887  __Pyx_GOTREF(__pyx_tuple__121);
64888  __Pyx_GIVEREF(__pyx_tuple__121);
64889  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(3, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_decompose_tseries, 659, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 659, __pyx_L1_error)
64890 
64891  /* "WaveTools.py":735
64892  * self.ramp = rampTime
64893  *
64894  * def eta(self,x,t): # <<<<<<<<<<<<<<
64895  * """Calculates free surface elevation (SolitaryWave class)
64896  * Parameters
64897  */
64898  __pyx_tuple__123 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 735, __pyx_L1_error)
64899  __Pyx_GOTREF(__pyx_tuple__123);
64900  __Pyx_GIVEREF(__pyx_tuple__123);
64901  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 735, __pyx_L1_error)
64902 
64903  /* "WaveTools.py":751
64904  * """
64905  * return 0.
64906  * def u(self,x,t): # <<<<<<<<<<<<<<
64907  * """Calculates wave velocity vector (SolitaryWave class).
64908  * Parameters
64909  */
64910  __pyx_tuple__125 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_U); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 751, __pyx_L1_error)
64911  __Pyx_GOTREF(__pyx_tuple__125);
64912  __Pyx_GIVEREF(__pyx_tuple__125);
64913  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 751, __pyx_L1_error)
64914 
64915  /* "(tree fragment)":1
64916  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
64917  * cdef tuple state
64918  * cdef object _dict
64919  */
64920  __pyx_tuple__127 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(1, 1, __pyx_L1_error)
64921  __Pyx_GOTREF(__pyx_tuple__127);
64922  __Pyx_GIVEREF(__pyx_tuple__127);
64923  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(1, 1, __pyx_L1_error)
64924 
64925  /* "(tree fragment)":16
64926  * else:
64927  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state)
64928  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
64929  * __pyx_unpickle_SteadyCurrent__set_state(self, __pyx_state)
64930  */
64931  __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(1, 16, __pyx_L1_error)
64932  __Pyx_GOTREF(__pyx_tuple__129);
64933  __Pyx_GIVEREF(__pyx_tuple__129);
64934  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(1, 16, __pyx_L1_error)
64935 
64936  /* "WaveTools.py":803
64937  * g,
64938  * waveDir,
64939  * trans = np.zeros(3,"d"), # <<<<<<<<<<<<<<
64940  * fast = True):
64941  *
64942  */
64943  __pyx_tuple__131 = PyTuple_Pack(2, __pyx_int_3, __pyx_n_s_d); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 803, __pyx_L1_error)
64944  __Pyx_GOTREF(__pyx_tuple__131);
64945  __Pyx_GIVEREF(__pyx_tuple__131);
64946 
64947  /* "WaveTools.py":822
64948  * dirCheck(self.waveDir,self.vDir)
64949  *
64950  * def eta(self,x,t): # <<<<<<<<<<<<<<
64951  * """Calculates free surface elevation (SolitaryWave class)
64952  * Parameters
64953  */
64954  __pyx_tuple__132 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_phase, __pyx_n_s_a1); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 822, __pyx_L1_error)
64955  __Pyx_GOTREF(__pyx_tuple__132);
64956  __Pyx_GIVEREF(__pyx_tuple__132);
64957  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 822, __pyx_L1_error)
64958 
64959  /* "WaveTools.py":840
64960  * a1 = self.K*phase
64961  * return self.H*1.0/ cosh(a1)**2
64962  * def u(self,x,t): # <<<<<<<<<<<<<<
64963  * """Calculates wave velocity vector (SolitaryWave class).
64964  * Parameters
64965  */
64966  __pyx_tuple__134 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_phase, __pyx_n_s_a1, __pyx_n_s_a2, __pyx_n_s_Z, __pyx_n_s_Uhorz, __pyx_n_s_Uvert); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 840, __pyx_L1_error)
64967  __Pyx_GOTREF(__pyx_tuple__134);
64968  __Pyx_GIVEREF(__pyx_tuple__134);
64969  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 840, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 840, __pyx_L1_error)
64970 
64971  /* "(tree fragment)":1
64972  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
64973  * cdef tuple state
64974  * cdef object _dict
64975  */
64976  __pyx_tuple__136 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(1, 1, __pyx_L1_error)
64977  __Pyx_GOTREF(__pyx_tuple__136);
64978  __Pyx_GIVEREF(__pyx_tuple__136);
64979  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(1, 1, __pyx_L1_error)
64980 
64981  /* "(tree fragment)":16
64982  * else:
64983  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state)
64984  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
64985  * __pyx_unpickle_SolitaryWave__set_state(self, __pyx_state)
64986  */
64987  __pyx_tuple__138 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 16, __pyx_L1_error)
64988  __Pyx_GOTREF(__pyx_tuple__138);
64989  __Pyx_GIVEREF(__pyx_tuple__138);
64990  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(1, 16, __pyx_L1_error)
64991 
64992  /* "WaveTools.py":951
64993  * autoFenton=True,
64994  * autoFentonOpts=None,
64995  * Ycoeff = np.zeros(1000,), # <<<<<<<<<<<<<<
64996  * Bcoeff =np.zeros(1000,),
64997  * Nf = 1000,
64998  */
64999  __pyx_tuple__140 = PyTuple_Pack(1, __pyx_int_1000); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 951, __pyx_L1_error)
65000  __Pyx_GOTREF(__pyx_tuple__140);
65001  __Pyx_GIVEREF(__pyx_tuple__140);
65002 
65003  /* "WaveTools.py":1102
65004  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast)
65005  *
65006  * def eta(self,x,t): # <<<<<<<<<<<<<<
65007  * """Calculates free surface elevation (MonochromaticWaves class)
65008  * Parameters
65009  */
65010  __pyx_tuple__141 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 1102, __pyx_L1_error)
65011  __Pyx_GOTREF(__pyx_tuple__141);
65012  __Pyx_GIVEREF(__pyx_tuple__141);
65013  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 1102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 1102, __pyx_L1_error)
65014 
65015  /* "WaveTools.py":1126
65016  * return self.etaFenton(xx,t)
65017  *
65018  * def u(self,x,t): # <<<<<<<<<<<<<<
65019  * """Calculates wave velocity vector (MonochromaticWaves class).
65020  * Parameters
65021  */
65022  __pyx_tuple__143 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 1126, __pyx_L1_error)
65023  __Pyx_GOTREF(__pyx_tuple__143);
65024  __Pyx_GIVEREF(__pyx_tuple__143);
65025  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 1126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 1126, __pyx_L1_error)
65026 
65027  /* "(tree fragment)":1
65028  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65029  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
65030  * def __setstate_cython__(self, __pyx_state):
65031  */
65032  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(1, 1, __pyx_L1_error)
65033  __Pyx_GOTREF(__pyx_tuple__145);
65034  __Pyx_GIVEREF(__pyx_tuple__145);
65035  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(1, 1, __pyx_L1_error)
65036 
65037  /* "(tree fragment)":3
65038  * def __reduce_cython__(self):
65039  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
65040  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65041  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
65042  */
65043  __pyx_tuple__147 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(1, 3, __pyx_L1_error)
65044  __Pyx_GOTREF(__pyx_tuple__147);
65045  __Pyx_GIVEREF(__pyx_tuple__147);
65046  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(1, 3, __pyx_L1_error)
65047 
65048  /* "WaveTools.py":1295
65049  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
65050  *
65051  * def eta(self, x, t): # <<<<<<<<<<<<<<
65052  * """Calculates free surface elevation (RandomWaves class)
65053  * Parameters
65054  */
65055  __pyx_tuple__149 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 1295, __pyx_L1_error)
65056  __Pyx_GOTREF(__pyx_tuple__149);
65057  __Pyx_GIVEREF(__pyx_tuple__149);
65058  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 1295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 1295, __pyx_L1_error)
65059 
65060  /* "WaveTools.py":1319
65061  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
65062  *
65063  * def u(self, x, t): # <<<<<<<<<<<<<<
65064  * """Calculates wave velocity vector (RandomWaves class)
65065  * Parameters
65066  */
65067  __pyx_tuple__151 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 1319, __pyx_L1_error)
65068  __Pyx_GOTREF(__pyx_tuple__151);
65069  __Pyx_GIVEREF(__pyx_tuple__151);
65070  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 1319, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 1319, __pyx_L1_error)
65071 
65072  /* "WaveTools.py":1347
65073  *
65074  * return U
65075  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
65076  * """Writes a timeseries of the free-surface elevation
65077  *
65078  */
65079  __pyx_tuple__153 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_Tstart, __pyx_n_s_Tend, __pyx_n_s_x0, __pyx_n_s_fname, __pyx_n_s_Lgen, __pyx_n_s_dt, __pyx_n_s_Tlag, __pyx_n_s_j, __pyx_n_s_Np, __pyx_n_s_time, __pyx_n_s_etaR, __pyx_n_s_jj, __pyx_n_s_series); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 1347, __pyx_L1_error)
65080  __Pyx_GOTREF(__pyx_tuple__153);
65081  __Pyx_GIVEREF(__pyx_tuple__153);
65082  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_writeEtaSeries, 1347, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 1347, __pyx_L1_error)
65083 
65084  /* "(tree fragment)":1
65085  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65086  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65087  * def __setstate_cython__(self, __pyx_state):
65088  */
65089  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(1, 1, __pyx_L1_error)
65090  __Pyx_GOTREF(__pyx_tuple__155);
65091  __Pyx_GIVEREF(__pyx_tuple__155);
65092  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(1, 1, __pyx_L1_error)
65093 
65094  /* "(tree fragment)":3
65095  * def __reduce_cython__(self):
65096  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65097  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65098  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65099  */
65100  __pyx_tuple__157 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(1, 3, __pyx_L1_error)
65101  __Pyx_GOTREF(__pyx_tuple__157);
65102  __Pyx_GIVEREF(__pyx_tuple__157);
65103  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(1, 3, __pyx_L1_error)
65104 
65105  /* "WaveTools.py":1532
65106  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
65107  *
65108  * def eta(self, x, t): # <<<<<<<<<<<<<<
65109  * """Calculates free surface elevation (RandomWaves class)
65110  * Parameters
65111  */
65112  __pyx_tuple__159 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 1532, __pyx_L1_error)
65113  __Pyx_GOTREF(__pyx_tuple__159);
65114  __Pyx_GIVEREF(__pyx_tuple__159);
65115  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 1532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 1532, __pyx_L1_error)
65116 
65117  /* "WaveTools.py":1556
65118  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
65119  *
65120  * def u(self, x, t): # <<<<<<<<<<<<<<
65121  * """Calculates wave velocity vector (RandomWaves class)
65122  * Parameters
65123  */
65124  __pyx_tuple__161 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 1556, __pyx_L1_error)
65125  __Pyx_GOTREF(__pyx_tuple__161);
65126  __Pyx_GIVEREF(__pyx_tuple__161);
65127  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 1556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 1556, __pyx_L1_error)
65128 
65129  /* "WaveTools.py":1584
65130  *
65131  * return U
65132  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
65133  * """Writes a timeseries of the free-surface elevation
65134  *
65135  */
65136  __pyx_tuple__163 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_Tstart, __pyx_n_s_Tend, __pyx_n_s_x0, __pyx_n_s_fname, __pyx_n_s_Lgen, __pyx_n_s_dt, __pyx_n_s_Tlag, __pyx_n_s_j, __pyx_n_s_Np, __pyx_n_s_time, __pyx_n_s_etaR, __pyx_n_s_jj, __pyx_n_s_series); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 1584, __pyx_L1_error)
65137  __Pyx_GOTREF(__pyx_tuple__163);
65138  __Pyx_GIVEREF(__pyx_tuple__163);
65139  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(6, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_writeEtaSeries, 1584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 1584, __pyx_L1_error)
65140 
65141  /* "(tree fragment)":1
65142  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65143  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65144  * def __setstate_cython__(self, __pyx_state):
65145  */
65146  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(1, 1, __pyx_L1_error)
65147  __Pyx_GOTREF(__pyx_tuple__165);
65148  __Pyx_GIVEREF(__pyx_tuple__165);
65149  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(1, 1, __pyx_L1_error)
65150 
65151  /* "(tree fragment)":3
65152  * def __reduce_cython__(self):
65153  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65154  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65155  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65156  */
65157  __pyx_tuple__167 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(1, 3, __pyx_L1_error)
65158  __Pyx_GOTREF(__pyx_tuple__167);
65159  __Pyx_GIVEREF(__pyx_tuple__167);
65160  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(1, 3, __pyx_L1_error)
65161 
65162  /* "WaveTools.py":1774
65163  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast)
65164  *
65165  * def eta(self, x, t): # <<<<<<<<<<<<<<
65166  * """Calculates free surface elevation (RandomWaves class)
65167  * Parameters
65168  */
65169  __pyx_tuple__169 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 1774, __pyx_L1_error)
65170  __Pyx_GOTREF(__pyx_tuple__169);
65171  __Pyx_GIVEREF(__pyx_tuple__169);
65172  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 1774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 1774, __pyx_L1_error)
65173 
65174  /* "WaveTools.py":1799
65175  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast)
65176  *
65177  * def u(self, x, t): # <<<<<<<<<<<<<<
65178  * """Calculates wave velocity vector (RandomWaves class)
65179  * Parameters
65180  */
65181  __pyx_tuple__171 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 1799, __pyx_L1_error)
65182  __Pyx_GOTREF(__pyx_tuple__171);
65183  __Pyx_GIVEREF(__pyx_tuple__171);
65184  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 1799, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 1799, __pyx_L1_error)
65185 
65186  /* "(tree fragment)":1
65187  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65188  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65189  * def __setstate_cython__(self, __pyx_state):
65190  */
65191  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(1, 1, __pyx_L1_error)
65192  __Pyx_GOTREF(__pyx_tuple__173);
65193  __Pyx_GIVEREF(__pyx_tuple__173);
65194  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(1, 1, __pyx_L1_error)
65195 
65196  /* "(tree fragment)":3
65197  * def __reduce_cython__(self):
65198  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65199  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65200  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65201  */
65202  __pyx_tuple__175 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(1, 3, __pyx_L1_error)
65203  __Pyx_GOTREF(__pyx_tuple__175);
65204  __Pyx_GIVEREF(__pyx_tuple__175);
65205  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(1, 3, __pyx_L1_error)
65206 
65207  /* "WaveTools.py":2011
65208  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast)
65209  *
65210  * def eta(self, x, t): # <<<<<<<<<<<<<<
65211  * """Calculates free surface elevation (RandomWaves class)
65212  * Parameters
65213  */
65214  __pyx_tuple__177 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 2011, __pyx_L1_error)
65215  __Pyx_GOTREF(__pyx_tuple__177);
65216  __Pyx_GIVEREF(__pyx_tuple__177);
65217  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 2011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 2011, __pyx_L1_error)
65218 
65219  /* "WaveTools.py":2036
65220  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
65221  *
65222  * def u(self, x, t): # <<<<<<<<<<<<<<
65223  * """Calculates wave velocity vector (RandomWaves class)
65224  * Parameters
65225  */
65226  __pyx_tuple__179 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 2036, __pyx_L1_error)
65227  __Pyx_GOTREF(__pyx_tuple__179);
65228  __Pyx_GIVEREF(__pyx_tuple__179);
65229  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 2036, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 2036, __pyx_L1_error)
65230 
65231  /* "(tree fragment)":1
65232  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65233  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65234  * def __setstate_cython__(self, __pyx_state):
65235  */
65236  __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(1, 1, __pyx_L1_error)
65237  __Pyx_GOTREF(__pyx_tuple__181);
65238  __Pyx_GIVEREF(__pyx_tuple__181);
65239  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(1, 1, __pyx_L1_error)
65240 
65241  /* "(tree fragment)":3
65242  * def __reduce_cython__(self):
65243  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65244  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65245  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
65246  */
65247  __pyx_tuple__183 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(1, 3, __pyx_L1_error)
65248  __Pyx_GOTREF(__pyx_tuple__183);
65249  __Pyx_GIVEREF(__pyx_tuple__183);
65250  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(1, 3, __pyx_L1_error)
65251 
65252  /* "WaveTools.py":2434
65253  * self._cpp_u = self._cpp_uWindow
65254  *
65255  * def windOut(self): # <<<<<<<<<<<<<<
65256  * return {"TWindow":self.Twindow,"TOverlap":self.Toverlap,"Tlag":self.Tlag, "rec_direct":self.rec_direct}
65257  *
65258  */
65259  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 2434, __pyx_L1_error)
65260  __Pyx_GOTREF(__pyx_tuple__185);
65261  __Pyx_GIVEREF(__pyx_tuple__185);
65262  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_windOut, 2434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 2434, __pyx_L1_error)
65263 
65264  /* "WaveTools.py":2443
65265  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
65266  *
65267  * def etaDirect(self, x, t): # <<<<<<<<<<<<<<
65268  *
65269  * """Calculates free surface elevation(Timeseries class-direct method
65270  */
65271  __pyx_tuple__187 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 2443, __pyx_L1_error)
65272  __Pyx_GOTREF(__pyx_tuple__187);
65273  __Pyx_GIVEREF(__pyx_tuple__187);
65274  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_etaDirect, 2443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 2443, __pyx_L1_error)
65275 
65276  /* "WaveTools.py":2465
65277  * return self._cpp_etaDirect(xx,t)
65278  *
65279  * def uDirect(self, x, t): # <<<<<<<<<<<<<<
65280  * """Calculates wave velocity vector (Timeseries class-direct method)
65281  * Parameters
65282  */
65283  __pyx_tuple__189 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 2465, __pyx_L1_error)
65284  __Pyx_GOTREF(__pyx_tuple__189);
65285  __Pyx_GIVEREF(__pyx_tuple__189);
65286  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_uDirect, 2465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 2465, __pyx_L1_error)
65287 
65288  /* "WaveTools.py":2494
65289  * return U
65290  *
65291  * def findWindow(self,t): # <<<<<<<<<<<<<<
65292  * """Returns the current spectral window in TimeSeries class."
65293  *
65294  */
65295  __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_t); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 2494, __pyx_L1_error)
65296  __Pyx_GOTREF(__pyx_tuple__191);
65297  __Pyx_GIVEREF(__pyx_tuple__191);
65298  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_findWindow, 2494, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 2494, __pyx_L1_error)
65299 
65300  /* "WaveTools.py":2519
65301  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
65302  *
65303  * def etaWindow(self, x, t): # <<<<<<<<<<<<<<
65304  * """Calculates free surface elevation(Timeseries class-window method
65305  * Parameters
65306  */
65307  __pyx_tuple__193 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 2519, __pyx_L1_error)
65308  __Pyx_GOTREF(__pyx_tuple__193);
65309  __Pyx_GIVEREF(__pyx_tuple__193);
65310  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_etaWindow, 2519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 2519, __pyx_L1_error)
65311 
65312  /* "WaveTools.py":2541
65313  *
65314  *
65315  * def uWindow(self, x, t): # <<<<<<<<<<<<<<
65316  * """Calculates wave velocity vector (Timeseries class-window method)
65317  * Parameters
65318  */
65319  __pyx_tuple__195 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx, __pyx_n_s_cppU, __pyx_n_s_ii, __pyx_n_s_U); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 2541, __pyx_L1_error)
65320  __Pyx_GOTREF(__pyx_tuple__195);
65321  __Pyx_GIVEREF(__pyx_tuple__195);
65322  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_uWindow, 2541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 2541, __pyx_L1_error)
65323 
65324  /* "(tree fragment)":1
65325  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65326  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
65327  * def __setstate_cython__(self, __pyx_state):
65328  */
65329  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(1, 1, __pyx_L1_error)
65330  __Pyx_GOTREF(__pyx_tuple__197);
65331  __Pyx_GIVEREF(__pyx_tuple__197);
65332  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(1, 1, __pyx_L1_error)
65333 
65334  /* "(tree fragment)":3
65335  * def __reduce_cython__(self):
65336  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
65337  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65338  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
65339  */
65340  __pyx_tuple__199 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(1, 3, __pyx_L1_error)
65341  __Pyx_GOTREF(__pyx_tuple__199);
65342  __Pyx_GIVEREF(__pyx_tuple__199);
65343  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(1, 3, __pyx_L1_error)
65344 
65345  /* "WaveTools.py":2571
65346  *
65347  *
65348  * class RandomWavesFast(object): # <<<<<<<<<<<<<<
65349  * """
65350  * This class is used for generating plane random waves in an optimised manner
65351  */
65352  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 2571, __pyx_L1_error)
65353  __Pyx_GOTREF(__pyx_tuple__201);
65354  __Pyx_GIVEREF(__pyx_tuple__201);
65355 
65356  /* "WaveTools.py":2622
65357  * """
65358  *
65359  * def __init__(self, # <<<<<<<<<<<<<<
65360  * Tstart,
65361  * Tend,
65362  */
65363  __pyx_tuple__202 = PyTuple_Pack(35, __pyx_n_s_self, __pyx_n_s_Tstart, __pyx_n_s_Tend, __pyx_n_s_x0, __pyx_n_s_Tp, __pyx_n_s_Hs, __pyx_n_s_mwl, __pyx_n_s_depth, __pyx_n_s_waveDir, __pyx_n_s_g, __pyx_n_s_N, __pyx_n_s_bandFactor, __pyx_n_s_spectName, __pyx_n_s_spectral_params, __pyx_n_s_phi, __pyx_n_s_Lgen, __pyx_n_s_Nwaves, __pyx_n_s_Nfreq, __pyx_n_s_checkAcc, __pyx_n_s_fast, __pyx_n_s_RW, __pyx_n_s_cutoff_win, __pyx_n_s_overl, __pyx_n_s_fname, __pyx_n_s_duration, __pyx_n_s_Tm, __pyx_n_s_Nwaves_tot, __pyx_n_s_TS, __pyx_n_s_cut, __pyx_n_s_ts, __pyx_n_s_te, __pyx_n_s_i1, __pyx_n_s_i2, __pyx_n_s_errors, __pyx_n_s_ii); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 2622, __pyx_L1_error)
65364  __Pyx_GOTREF(__pyx_tuple__202);
65365  __Pyx_GIVEREF(__pyx_tuple__202);
65366  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(20, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_init, 2622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 2622, __pyx_L1_error)
65367  __pyx_tuple__204 = PyTuple_Pack(7, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)__pyx_int_15), ((PyObject *)__pyx_int_32), ((PyObject *)Py_True), ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 2622, __pyx_L1_error)
65368  __Pyx_GOTREF(__pyx_tuple__204);
65369  __Pyx_GIVEREF(__pyx_tuple__204);
65370 
65371  /* "WaveTools.py":2725
65372  * self.windOut = TS.windOut
65373  *
65374  * def printOut(self): # <<<<<<<<<<<<<<
65375  * """Prints some properties of the time series - ONLY FOR TESTING
65376  *
65377  */
65378  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 2725, __pyx_L1_error)
65379  __Pyx_GOTREF(__pyx_tuple__205);
65380  __Pyx_GIVEREF(__pyx_tuple__205);
65381  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_printOut, 2725, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 2725, __pyx_L1_error)
65382 
65383  /* "WaveTools.py":2834
65384  * def _cpp_eta_2ndOrder(self,x,t):
65385  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast)
65386  * def eta_2ndOrder(self,x,t): # <<<<<<<<<<<<<<
65387  * """Calculates the free surface elevation for 2nd-order terms
65388  *
65389  */
65390  __pyx_tuple__207 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 2834, __pyx_L1_error)
65391  __Pyx_GOTREF(__pyx_tuple__207);
65392  __Pyx_GIVEREF(__pyx_tuple__207);
65393  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta_2ndOrder, 2834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 2834, __pyx_L1_error)
65394 
65395  /* "WaveTools.py":2872
65396  *
65397  * #higher harmonics
65398  * def eta_short(self,x,t): # <<<<<<<<<<<<<<
65399  * """Calculates the free surface elevation for higher-order terms
65400  *
65401  */
65402  __pyx_tuple__209 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 2872, __pyx_L1_error)
65403  __Pyx_GOTREF(__pyx_tuple__209);
65404  __Pyx_GIVEREF(__pyx_tuple__209);
65405  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta_short, 2872, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 2872, __pyx_L1_error)
65406 
65407  /* "WaveTools.py":2913
65408  *
65409  * #lower harmonics
65410  * def eta_long(self,x,t): # <<<<<<<<<<<<<<
65411  * """Calculates the free surface elevation for lower-order terms
65412  *
65413  */
65414  __pyx_tuple__211 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_xx); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 2913, __pyx_L1_error)
65415  __Pyx_GOTREF(__pyx_tuple__211);
65416  __Pyx_GIVEREF(__pyx_tuple__211);
65417  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta_long, 2913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 2913, __pyx_L1_error)
65418 
65419  /* "WaveTools.py":2951
65420  *
65421  * #set-up calculation
65422  * def eta_setUp(self,x,t): # <<<<<<<<<<<<<<
65423  * """Calculates the free surface elevation set up
65424  *
65425  */
65426  __pyx_tuple__213 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_EtasetUp, __pyx_n_s_i, __pyx_n_s_wwi_setUp); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 2951, __pyx_L1_error)
65427  __Pyx_GOTREF(__pyx_tuple__213);
65428  __Pyx_GIVEREF(__pyx_tuple__213);
65429  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta_setUp, 2951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(0, 2951, __pyx_L1_error)
65430 
65431  /* "WaveTools.py":2980
65432  *
65433  * #overall free surface elevation
65434  * def eta_overall(self,x,t,setUp=False): # <<<<<<<<<<<<<<
65435  * """Calculates the free surface elevation with 2nd order corrections
65436  *
65437  */
65438  __pyx_tuple__215 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_setUp, __pyx_n_s_xx, __pyx_n_s_Etaoverall); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 2980, __pyx_L1_error)
65439  __Pyx_GOTREF(__pyx_tuple__215);
65440  __Pyx_GIVEREF(__pyx_tuple__215);
65441  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta_overall, 2980, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(0, 2980, __pyx_L1_error)
65442 
65443  /* "WaveTools.py":3009
65444  *
65445  *
65446  * def writeEtaSeries(self,Tstart,Tend,dt,x0,fname, mode="all",setUp=False, Lgen=np.zeros(3,)): # <<<<<<<<<<<<<<
65447  * """Writes a timeseries of the free-surface elevation
65448  *
65449  */
65450  __pyx_tuple__217 = PyTuple_Pack(1, __pyx_int_3); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(0, 3009, __pyx_L1_error)
65451  __Pyx_GOTREF(__pyx_tuple__217);
65452  __Pyx_GIVEREF(__pyx_tuple__217);
65453  __pyx_tuple__218 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_Tstart, __pyx_n_s_Tend, __pyx_n_s_dt, __pyx_n_s_x0, __pyx_n_s_fname, __pyx_n_s_mode, __pyx_n_s_setUp, __pyx_n_s_Lgen, __pyx_n_s_Tlag, __pyx_n_s_j, __pyx_n_s_Nseries, __pyx_n_s_timelst, __pyx_n_s_series, __pyx_n_s_i, __pyx_n_s_time, __pyx_n_s_delimiter); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 3009, __pyx_L1_error)
65454  __Pyx_GOTREF(__pyx_tuple__218);
65455  __Pyx_GIVEREF(__pyx_tuple__218);
65456  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(9, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_writeEtaSeries, 3009, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 3009, __pyx_L1_error)
65457 
65458  /* "WaveTools.py":3076
65459  * return series
65460  *
65461  * def wtError(self,x,t): # <<<<<<<<<<<<<<
65462  * """Raises error for using RandomNLWavesFast class instead
65463  *
65464  */
65465  __pyx_tuple__220 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(0, 3076, __pyx_L1_error)
65466  __Pyx_GOTREF(__pyx_tuple__220);
65467  __Pyx_GIVEREF(__pyx_tuple__220);
65468  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_wtError, 3076, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 3076, __pyx_L1_error)
65469 
65470  /* "(tree fragment)":1
65471  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
65472  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
65473  * def __setstate_cython__(self, __pyx_state):
65474  */
65475  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(1, 1, __pyx_L1_error)
65476  __Pyx_GOTREF(__pyx_tuple__222);
65477  __Pyx_GIVEREF(__pyx_tuple__222);
65478  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(1, 1, __pyx_L1_error)
65479 
65480  /* "(tree fragment)":3
65481  * def __reduce_cython__(self):
65482  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
65483  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
65484  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
65485  */
65486  __pyx_tuple__224 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(1, 3, __pyx_L1_error)
65487  __Pyx_GOTREF(__pyx_tuple__224);
65488  __Pyx_GIVEREF(__pyx_tuple__224);
65489  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(1, 3, __pyx_L1_error)
65490 
65491  /* "WaveTools.py":3102
65492  *
65493  *
65494  * class RandomNLWavesFast(object): # <<<<<<<<<<<<<<
65495  * """
65496  * This class is used for generating plane random waves with 2ns order correction in an optimised manner
65497  */
65498  __pyx_tuple__226 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 3102, __pyx_L1_error)
65499  __Pyx_GOTREF(__pyx_tuple__226);
65500  __Pyx_GIVEREF(__pyx_tuple__226);
65501 
65502  /* "WaveTools.py":3152
65503  * Switch for enabling optimised functions
65504  * """
65505  * def __init__(self, # <<<<<<<<<<<<<<
65506  * Tstart,
65507  * Tend,
65508  */
65509  __pyx_tuple__227 = PyTuple_Pack(35, __pyx_n_s_self, __pyx_n_s_Tstart, __pyx_n_s_Tend, __pyx_n_s_x0, __pyx_n_s_Tp, __pyx_n_s_Hs, __pyx_n_s_mwl, __pyx_n_s_depth, __pyx_n_s_waveDir, __pyx_n_s_g, __pyx_n_s_N, __pyx_n_s_bandFactor, __pyx_n_s_spectName, __pyx_n_s_spectral_params, __pyx_n_s_phi, __pyx_n_s_Lgen, __pyx_n_s_Nwaves, __pyx_n_s_Nfreq, __pyx_n_s_NLongW, __pyx_n_s_fast, __pyx_n_s_aR, __pyx_n_s_aRN, __pyx_n_s_Tmax, __pyx_n_s_modes, __pyx_n_s_periods, __pyx_n_s_ii, __pyx_n_s_mode, __pyx_n_s_fname, __pyx_n_s_dt, __pyx_n_s_series, __pyx_n_s_Tstart_temp, __pyx_n_s_cutoff, __pyx_n_s_Nwaves_tot, __pyx_n_s_Nwind, __pyx_n_s_rec_d); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 3152, __pyx_L1_error)
65510  __Pyx_GOTREF(__pyx_tuple__227);
65511  __Pyx_GIVEREF(__pyx_tuple__227);
65512  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(20, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_init, 3152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 3152, __pyx_L1_error)
65513 
65514  /* "WaveTools.py":3221
65515  *
65516  *
65517  * def eta(self,x,t): # <<<<<<<<<<<<<<
65518  * """Calculates free surface elevation (RandomNLWavesFast class)
65519  * Parameters
65520  */
65521  __pyx_tuple__229 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_etaR); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 3221, __pyx_L1_error)
65522  __Pyx_GOTREF(__pyx_tuple__229);
65523  __Pyx_GIVEREF(__pyx_tuple__229);
65524  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 3221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 3221, __pyx_L1_error)
65525 
65526  /* "WaveTools.py":3240
65527  *
65528  *
65529  * def u(self,x,t): # <<<<<<<<<<<<<<
65530  * """Calculates wave velocity vector (RandomNLWavesFast class)
65531  * Parameters
65532  */
65533  __pyx_tuple__231 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_uR); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 3240, __pyx_L1_error)
65534  __Pyx_GOTREF(__pyx_tuple__231);
65535  __Pyx_GIVEREF(__pyx_tuple__231);
65536  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 3240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 3240, __pyx_L1_error)
65537 
65538  /* "WaveTools.py":3258
65539  * return uR
65540  *
65541  * class CombineWaves(object): # <<<<<<<<<<<<<<
65542  * """
65543  * This class is used for combining multiple waveTools classes, thus allowing for the generation of complex wave conditions
65544  */
65545  __pyx_tuple__233 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 3258, __pyx_L1_error)
65546  __Pyx_GOTREF(__pyx_tuple__233);
65547  __Pyx_GIVEREF(__pyx_tuple__233);
65548 
65549  /* "WaveTools.py":3267
65550  * List of wave classes
65551  * """
65552  * def __init__(self,waveList): # <<<<<<<<<<<<<<
65553  * try:
65554  * for condition in waveList:
65555  */
65556  __pyx_tuple__234 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_waveList, __pyx_n_s_condition, __pyx_n_s_etaCheck, __pyx_n_s_uCheck); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 3267, __pyx_L1_error)
65557  __Pyx_GOTREF(__pyx_tuple__234);
65558  __Pyx_GIVEREF(__pyx_tuple__234);
65559  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_init, 3267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 3267, __pyx_L1_error)
65560 
65561  /* "WaveTools.py":3282
65562  * self.waveList = waveList
65563  * self.mwl = waveList[0].mwl
65564  * def eta(self,x,t): # <<<<<<<<<<<<<<
65565  * """
65566  * Calculates free surface elevation (combineWaves class)
65567  */
65568  __pyx_tuple__236 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_eta, __pyx_n_s_cond); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 3282, __pyx_L1_error)
65569  __Pyx_GOTREF(__pyx_tuple__236);
65570  __Pyx_GIVEREF(__pyx_tuple__236);
65571  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_eta, 3282, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 3282, __pyx_L1_error)
65572 
65573  /* "WaveTools.py":3303
65574  * return eta
65575  *
65576  * def u(self,x,t): # <<<<<<<<<<<<<<
65577  * """
65578  * Calculates wave particle velocity (combineWaves class)
65579  */
65580  __pyx_tuple__238 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t, __pyx_n_s_u, __pyx_n_s_cond); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 3303, __pyx_L1_error)
65581  __Pyx_GOTREF(__pyx_tuple__238);
65582  __Pyx_GIVEREF(__pyx_tuple__238);
65583  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_WaveTools_py, __pyx_n_s_u, 3303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 3303, __pyx_L1_error)
65584 
65585  /* "(tree fragment)":1
65586  * def __pyx_unpickle_SteadyCurrent(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
65587  * cdef object __pyx_PickleError
65588  * cdef object __pyx_result
65589  */
65590  __pyx_tuple__240 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(1, 1, __pyx_L1_error)
65591  __Pyx_GOTREF(__pyx_tuple__240);
65592  __Pyx_GIVEREF(__pyx_tuple__240);
65593  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SteadyCurrent, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(1, 1, __pyx_L1_error)
65594  __pyx_tuple__242 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(1, 1, __pyx_L1_error)
65595  __Pyx_GOTREF(__pyx_tuple__242);
65596  __Pyx_GIVEREF(__pyx_tuple__242);
65597  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SolitaryWave, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(1, 1, __pyx_L1_error)
65598  __Pyx_RefNannyFinishContext();
65599  return 0;
65600  __pyx_L1_error:;
65601  __Pyx_RefNannyFinishContext();
65602  return -1;
65603 }
65604 
65605 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
65606  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 2, __pyx_L1_error);
65607  __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 2, __pyx_L1_error)
65608  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 2, __pyx_L1_error)
65609  __pyx_float_2_ = PyFloat_FromDouble(2.); if (unlikely(!__pyx_float_2_)) __PYX_ERR(0, 2, __pyx_L1_error)
65610  __pyx_float_4_ = PyFloat_FromDouble(4.); if (unlikely(!__pyx_float_4_)) __PYX_ERR(0, 2, __pyx_L1_error)
65611  __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(0, 2, __pyx_L1_error)
65612  __pyx_float_0_2 = PyFloat_FromDouble(0.2); if (unlikely(!__pyx_float_0_2)) __PYX_ERR(0, 2, __pyx_L1_error)
65613  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 2, __pyx_L1_error)
65614  __pyx_float_0_7 = PyFloat_FromDouble(0.7); if (unlikely(!__pyx_float_0_7)) __PYX_ERR(0, 2, __pyx_L1_error)
65615  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65616  __pyx_float_1_1 = PyFloat_FromDouble(1.1); if (unlikely(!__pyx_float_1_1)) __PYX_ERR(0, 2, __pyx_L1_error)
65617  __pyx_float_1_5 = PyFloat_FromDouble(1.5); if (unlikely(!__pyx_float_1_5)) __PYX_ERR(0, 2, __pyx_L1_error)
65618  __pyx_float_1_9 = PyFloat_FromDouble(1.9); if (unlikely(!__pyx_float_1_9)) __PYX_ERR(0, 2, __pyx_L1_error)
65619  __pyx_float_10_ = PyFloat_FromDouble(10.); if (unlikely(!__pyx_float_10_)) __PYX_ERR(0, 2, __pyx_L1_error)
65620  __pyx_float_16_ = PyFloat_FromDouble(16.); if (unlikely(!__pyx_float_16_)) __PYX_ERR(0, 2, __pyx_L1_error)
65621  __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65622  __pyx_float_3_0 = PyFloat_FromDouble(3.0); if (unlikely(!__pyx_float_3_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65623  __pyx_float_3_3 = PyFloat_FromDouble(3.3); if (unlikely(!__pyx_float_3_3)) __PYX_ERR(0, 2, __pyx_L1_error)
65624  __pyx_float_4_0 = PyFloat_FromDouble(4.0); if (unlikely(!__pyx_float_4_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65625  __pyx_float_5_0 = PyFloat_FromDouble(5.0); if (unlikely(!__pyx_float_5_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65626  __pyx_float_50_ = PyFloat_FromDouble(50.); if (unlikely(!__pyx_float_50_)) __PYX_ERR(0, 2, __pyx_L1_error)
65627  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(0, 2, __pyx_L1_error)
65628  __pyx_float_0_07 = PyFloat_FromDouble(0.07); if (unlikely(!__pyx_float_0_07)) __PYX_ERR(0, 2, __pyx_L1_error)
65629  __pyx_float_0_09 = PyFloat_FromDouble(0.09); if (unlikely(!__pyx_float_0_09)) __PYX_ERR(0, 2, __pyx_L1_error)
65630  __pyx_float_0_23 = PyFloat_FromDouble(0.23); if (unlikely(!__pyx_float_0_23)) __PYX_ERR(0, 2, __pyx_L1_error)
65631  __pyx_float_16_0 = PyFloat_FromDouble(16.0); if (unlikely(!__pyx_float_16_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65632  __pyx_float_9_81 = PyFloat_FromDouble(9.81); if (unlikely(!__pyx_float_9_81)) __PYX_ERR(0, 2, __pyx_L1_error)
65633  __pyx_float_0_185 = PyFloat_FromDouble(0.185); if (unlikely(!__pyx_float_0_185)) __PYX_ERR(0, 2, __pyx_L1_error)
65634  __pyx_float_1eneg_05 = PyFloat_FromDouble(1e-05); if (unlikely(!__pyx_float_1eneg_05)) __PYX_ERR(0, 2, __pyx_L1_error)
65635  __pyx_float_1eneg_10 = PyFloat_FromDouble(1e-10); if (unlikely(!__pyx_float_1eneg_10)) __PYX_ERR(0, 2, __pyx_L1_error)
65636  __pyx_float_0_0336 = PyFloat_FromDouble(0.0336); if (unlikely(!__pyx_float_0_0336)) __PYX_ERR(0, 2, __pyx_L1_error)
65637  __pyx_float_neg_2_5 = PyFloat_FromDouble(-2.5); if (unlikely(!__pyx_float_neg_2_5)) __PYX_ERR(0, 2, __pyx_L1_error)
65638  __pyx_float_neg_5_0 = PyFloat_FromDouble(-5.0); if (unlikely(!__pyx_float_neg_5_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65639  __pyx_float_neg_1_25 = PyFloat_FromDouble(-1.25); if (unlikely(!__pyx_float_neg_1_25)) __PYX_ERR(0, 2, __pyx_L1_error)
65640  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 2, __pyx_L1_error)
65641  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 2, __pyx_L1_error)
65642  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 2, __pyx_L1_error)
65643  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 2, __pyx_L1_error)
65644  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 2, __pyx_L1_error)
65645  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 2, __pyx_L1_error)
65646  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 2, __pyx_L1_error)
65647  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 2, __pyx_L1_error)
65648  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) __PYX_ERR(0, 2, __pyx_L1_error)
65649  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 2, __pyx_L1_error)
65650  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) __PYX_ERR(0, 2, __pyx_L1_error)
65651  __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 2, __pyx_L1_error)
65652  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 2, __pyx_L1_error)
65653  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 2, __pyx_L1_error)
65654  __pyx_int_161707632 = PyInt_FromLong(161707632L); if (unlikely(!__pyx_int_161707632)) __PYX_ERR(0, 2, __pyx_L1_error)
65655  __pyx_int_237135047 = PyInt_FromLong(237135047L); if (unlikely(!__pyx_int_237135047)) __PYX_ERR(0, 2, __pyx_L1_error)
65656  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 2, __pyx_L1_error)
65657  __pyx_int_neg_4 = PyInt_FromLong(-4); if (unlikely(!__pyx_int_neg_4)) __PYX_ERR(0, 2, __pyx_L1_error)
65658  return 0;
65659  __pyx_L1_error:;
65660  return -1;
65661 }
65662 
65663 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
65664 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
65665 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
65666 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
65667 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
65668 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
65669 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
65670 
65671 static int __Pyx_modinit_global_init_code(void) {
65672  __Pyx_RefNannyDeclarations
65673  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
65674  /*--- Global init code ---*/
65675  __Pyx_RefNannyFinishContext();
65676  return 0;
65677 }
65678 
65679 static int __Pyx_modinit_variable_export_code(void) {
65680  __Pyx_RefNannyDeclarations
65681  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
65682  /*--- Variable export code ---*/
65683  __Pyx_RefNannyFinishContext();
65684  return 0;
65685 }
65686 
65687 static int __Pyx_modinit_function_export_code(void) {
65688  __Pyx_RefNannyDeclarations
65689  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
65690  /*--- Function export code ---*/
65691  __Pyx_RefNannyFinishContext();
65692  return 0;
65693 }
65694 
65695 static int __Pyx_modinit_type_init_code(void) {
65696  __Pyx_RefNannyDeclarations
65697  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
65698  /*--- Type init code ---*/
65699  if (PyType_Ready(&__pyx_type_9WaveTools_SteadyCurrent) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
65700  __pyx_type_9WaveTools_SteadyCurrent.tp_print = 0;
65701  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_SteadyCurrent.tp_dictoffset && __pyx_type_9WaveTools_SteadyCurrent.tp_getattro == PyObject_GenericGetAttr)) {
65702  __pyx_type_9WaveTools_SteadyCurrent.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65703  }
65704  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SteadyCurrent, (PyObject *)&__pyx_type_9WaveTools_SteadyCurrent) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
65705  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_SteadyCurrent) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
65706  __pyx_ptype_9WaveTools_SteadyCurrent = &__pyx_type_9WaveTools_SteadyCurrent;
65707  if (PyType_Ready(&__pyx_type_9WaveTools_SolitaryWave) < 0) __PYX_ERR(0, 775, __pyx_L1_error)
65708  __pyx_type_9WaveTools_SolitaryWave.tp_print = 0;
65709  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_SolitaryWave.tp_dictoffset && __pyx_type_9WaveTools_SolitaryWave.tp_getattro == PyObject_GenericGetAttr)) {
65710  __pyx_type_9WaveTools_SolitaryWave.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65711  }
65712  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SolitaryWave, (PyObject *)&__pyx_type_9WaveTools_SolitaryWave) < 0) __PYX_ERR(0, 775, __pyx_L1_error)
65713  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_SolitaryWave) < 0) __PYX_ERR(0, 775, __pyx_L1_error)
65714  __pyx_ptype_9WaveTools_SolitaryWave = &__pyx_type_9WaveTools_SolitaryWave;
65715  __pyx_vtabptr_9WaveTools_MonochromaticWaves = &__pyx_vtable_9WaveTools_MonochromaticWaves;
65716  __pyx_vtable_9WaveTools_MonochromaticWaves.etaLinear = (double (*)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double))__pyx_f_9WaveTools_18MonochromaticWaves_etaLinear;
65717  __pyx_vtable_9WaveTools_MonochromaticWaves.etaFenton = (double (*)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double))__pyx_f_9WaveTools_18MonochromaticWaves_etaFenton;
65718  __pyx_vtable_9WaveTools_MonochromaticWaves.uLinear = (void (*)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double))__pyx_f_9WaveTools_18MonochromaticWaves_uLinear;
65719  __pyx_vtable_9WaveTools_MonochromaticWaves.uFenton = (void (*)(struct __pyx_obj_9WaveTools_MonochromaticWaves *, double *, double *, double))__pyx_f_9WaveTools_18MonochromaticWaves_uFenton;
65720  if (PyType_Ready(&__pyx_type_9WaveTools_MonochromaticWaves) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
65721  __pyx_type_9WaveTools_MonochromaticWaves.tp_print = 0;
65722  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_MonochromaticWaves.tp_dictoffset && __pyx_type_9WaveTools_MonochromaticWaves.tp_getattro == PyObject_GenericGetAttr)) {
65723  __pyx_type_9WaveTools_MonochromaticWaves.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65724  }
65725  if (__Pyx_SetVtable(__pyx_type_9WaveTools_MonochromaticWaves.tp_dict, __pyx_vtabptr_9WaveTools_MonochromaticWaves) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
65726  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MonochromaticWaves, (PyObject *)&__pyx_type_9WaveTools_MonochromaticWaves) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
65727  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_MonochromaticWaves) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
65728  __pyx_ptype_9WaveTools_MonochromaticWaves = &__pyx_type_9WaveTools_MonochromaticWaves;
65729  __pyx_vtabptr_9WaveTools_NewWave = &__pyx_vtable_9WaveTools_NewWave;
65730  __pyx_vtable_9WaveTools_NewWave._cpp_eta = (double (*)(struct __pyx_obj_9WaveTools_NewWave *, double *, double))__pyx_f_9WaveTools_7NewWave__cpp_eta;
65731  __pyx_vtable_9WaveTools_NewWave._cpp_u = (void (*)(struct __pyx_obj_9WaveTools_NewWave *, double *, double *, double))__pyx_f_9WaveTools_7NewWave__cpp_u;
65732  if (PyType_Ready(&__pyx_type_9WaveTools_NewWave) < 0) __PYX_ERR(0, 1161, __pyx_L1_error)
65733  __pyx_type_9WaveTools_NewWave.tp_print = 0;
65734  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_NewWave.tp_dictoffset && __pyx_type_9WaveTools_NewWave.tp_getattro == PyObject_GenericGetAttr)) {
65735  __pyx_type_9WaveTools_NewWave.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65736  }
65737  if (__Pyx_SetVtable(__pyx_type_9WaveTools_NewWave.tp_dict, __pyx_vtabptr_9WaveTools_NewWave) < 0) __PYX_ERR(0, 1161, __pyx_L1_error)
65738  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NewWave, (PyObject *)&__pyx_type_9WaveTools_NewWave) < 0) __PYX_ERR(0, 1161, __pyx_L1_error)
65739  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_NewWave) < 0) __PYX_ERR(0, 1161, __pyx_L1_error)
65740  __pyx_ptype_9WaveTools_NewWave = &__pyx_type_9WaveTools_NewWave;
65741  __pyx_vtabptr_9WaveTools_RandomWaves = &__pyx_vtable_9WaveTools_RandomWaves;
65742  __pyx_vtable_9WaveTools_RandomWaves._cpp_eta = (double (*)(struct __pyx_obj_9WaveTools_RandomWaves *, double *, double))__pyx_f_9WaveTools_11RandomWaves__cpp_eta;
65743  __pyx_vtable_9WaveTools_RandomWaves._cpp_u = (void (*)(struct __pyx_obj_9WaveTools_RandomWaves *, double *, double *, double))__pyx_f_9WaveTools_11RandomWaves__cpp_u;
65744  if (PyType_Ready(&__pyx_type_9WaveTools_RandomWaves) < 0) __PYX_ERR(0, 1394, __pyx_L1_error)
65745  __pyx_type_9WaveTools_RandomWaves.tp_print = 0;
65746  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_RandomWaves.tp_dictoffset && __pyx_type_9WaveTools_RandomWaves.tp_getattro == PyObject_GenericGetAttr)) {
65747  __pyx_type_9WaveTools_RandomWaves.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65748  }
65749  if (__Pyx_SetVtable(__pyx_type_9WaveTools_RandomWaves.tp_dict, __pyx_vtabptr_9WaveTools_RandomWaves) < 0) __PYX_ERR(0, 1394, __pyx_L1_error)
65750  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RandomWaves, (PyObject *)&__pyx_type_9WaveTools_RandomWaves) < 0) __PYX_ERR(0, 1394, __pyx_L1_error)
65751  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_RandomWaves) < 0) __PYX_ERR(0, 1394, __pyx_L1_error)
65752  __pyx_ptype_9WaveTools_RandomWaves = &__pyx_type_9WaveTools_RandomWaves;
65753  __pyx_vtabptr_9WaveTools_MultiSpectraRandomWaves = &__pyx_vtable_9WaveTools_MultiSpectraRandomWaves;
65754  __pyx_vtable_9WaveTools_MultiSpectraRandomWaves._cpp_eta = (double (*)(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *, double *, double))__pyx_f_9WaveTools_23MultiSpectraRandomWaves__cpp_eta;
65755  __pyx_vtable_9WaveTools_MultiSpectraRandomWaves._cpp_u = (void (*)(struct __pyx_obj_9WaveTools_MultiSpectraRandomWaves *, double *, double *, double))__pyx_f_9WaveTools_23MultiSpectraRandomWaves__cpp_u;
65756  if (PyType_Ready(&__pyx_type_9WaveTools_MultiSpectraRandomWaves) < 0) __PYX_ERR(0, 1633, __pyx_L1_error)
65757  __pyx_type_9WaveTools_MultiSpectraRandomWaves.tp_print = 0;
65758  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_MultiSpectraRandomWaves.tp_dictoffset && __pyx_type_9WaveTools_MultiSpectraRandomWaves.tp_getattro == PyObject_GenericGetAttr)) {
65759  __pyx_type_9WaveTools_MultiSpectraRandomWaves.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65760  }
65761  if (__Pyx_SetVtable(__pyx_type_9WaveTools_MultiSpectraRandomWaves.tp_dict, __pyx_vtabptr_9WaveTools_MultiSpectraRandomWaves) < 0) __PYX_ERR(0, 1633, __pyx_L1_error)
65762  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MultiSpectraRandomWaves, (PyObject *)&__pyx_type_9WaveTools_MultiSpectraRandomWaves) < 0) __PYX_ERR(0, 1633, __pyx_L1_error)
65763  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_MultiSpectraRandomWaves) < 0) __PYX_ERR(0, 1633, __pyx_L1_error)
65764  __pyx_ptype_9WaveTools_MultiSpectraRandomWaves = &__pyx_type_9WaveTools_MultiSpectraRandomWaves;
65765  __pyx_vtabptr_9WaveTools_DirectionalWaves = &__pyx_vtable_9WaveTools_DirectionalWaves;
65766  __pyx_vtable_9WaveTools_DirectionalWaves._cpp_eta = (double (*)(struct __pyx_obj_9WaveTools_DirectionalWaves *, double *, double))__pyx_f_9WaveTools_16DirectionalWaves__cpp_eta;
65767  __pyx_vtable_9WaveTools_DirectionalWaves._cpp_u = (void (*)(struct __pyx_obj_9WaveTools_DirectionalWaves *, double *, double *, double))__pyx_f_9WaveTools_16DirectionalWaves__cpp_u;
65768  if (PyType_Ready(&__pyx_type_9WaveTools_DirectionalWaves) < 0) __PYX_ERR(0, 1828, __pyx_L1_error)
65769  __pyx_type_9WaveTools_DirectionalWaves.tp_print = 0;
65770  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_DirectionalWaves.tp_dictoffset && __pyx_type_9WaveTools_DirectionalWaves.tp_getattro == PyObject_GenericGetAttr)) {
65771  __pyx_type_9WaveTools_DirectionalWaves.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65772  }
65773  if (__Pyx_SetVtable(__pyx_type_9WaveTools_DirectionalWaves.tp_dict, __pyx_vtabptr_9WaveTools_DirectionalWaves) < 0) __PYX_ERR(0, 1828, __pyx_L1_error)
65774  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DirectionalWaves, (PyObject *)&__pyx_type_9WaveTools_DirectionalWaves) < 0) __PYX_ERR(0, 1828, __pyx_L1_error)
65775  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_DirectionalWaves) < 0) __PYX_ERR(0, 1828, __pyx_L1_error)
65776  __pyx_ptype_9WaveTools_DirectionalWaves = &__pyx_type_9WaveTools_DirectionalWaves;
65777  __pyx_vtabptr_9WaveTools_TimeSeries = &__pyx_vtable_9WaveTools_TimeSeries;
65778  __pyx_vtable_9WaveTools_TimeSeries._cpp_etaDirect = (double (*)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double))__pyx_f_9WaveTools_10TimeSeries__cpp_etaDirect;
65779  __pyx_vtable_9WaveTools_TimeSeries._cpp_etaWindow = (double (*)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double))__pyx_f_9WaveTools_10TimeSeries__cpp_etaWindow;
65780  __pyx_vtable_9WaveTools_TimeSeries._cpp_uDirect = (void (*)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double))__pyx_f_9WaveTools_10TimeSeries__cpp_uDirect;
65781  __pyx_vtable_9WaveTools_TimeSeries._cpp_uWindow = (void (*)(struct __pyx_obj_9WaveTools_TimeSeries *, double *, double *, double))__pyx_f_9WaveTools_10TimeSeries__cpp_uWindow;
65782  if (PyType_Ready(&__pyx_type_9WaveTools_TimeSeries) < 0) __PYX_ERR(0, 2071, __pyx_L1_error)
65783  __pyx_type_9WaveTools_TimeSeries.tp_print = 0;
65784  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_TimeSeries.tp_dictoffset && __pyx_type_9WaveTools_TimeSeries.tp_getattro == PyObject_GenericGetAttr)) {
65785  __pyx_type_9WaveTools_TimeSeries.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65786  }
65787  if (__Pyx_SetVtable(__pyx_type_9WaveTools_TimeSeries.tp_dict, __pyx_vtabptr_9WaveTools_TimeSeries) < 0) __PYX_ERR(0, 2071, __pyx_L1_error)
65788  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimeSeries, (PyObject *)&__pyx_type_9WaveTools_TimeSeries) < 0) __PYX_ERR(0, 2071, __pyx_L1_error)
65789  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_TimeSeries) < 0) __PYX_ERR(0, 2071, __pyx_L1_error)
65790  __pyx_ptype_9WaveTools_TimeSeries = &__pyx_type_9WaveTools_TimeSeries;
65791  __pyx_vtabptr_9WaveTools_RandomNLWaves = &__pyx_vtable_9WaveTools_RandomNLWaves;
65792  __pyx_vtable_9WaveTools_RandomNLWaves._cpp_eta_2ndOrder = (double (*)(struct __pyx_obj_9WaveTools_RandomNLWaves *, double *, double))__pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_2ndOrder;
65793  __pyx_vtable_9WaveTools_RandomNLWaves._cpp_eta_short = (double (*)(struct __pyx_obj_9WaveTools_RandomNLWaves *, double *, double))__pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_short;
65794  __pyx_vtable_9WaveTools_RandomNLWaves._cpp_eta_long = (double (*)(struct __pyx_obj_9WaveTools_RandomNLWaves *, double *, double))__pyx_f_9WaveTools_13RandomNLWaves__cpp_eta_long;
65795  if (PyType_Ready(&__pyx_type_9WaveTools_RandomNLWaves) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
65796  __pyx_type_9WaveTools_RandomNLWaves.tp_print = 0;
65797  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools_RandomNLWaves.tp_dictoffset && __pyx_type_9WaveTools_RandomNLWaves.tp_getattro == PyObject_GenericGetAttr)) {
65798  __pyx_type_9WaveTools_RandomNLWaves.tp_getattro = __Pyx_PyObject_GenericGetAttr;
65799  }
65800  if (__Pyx_SetVtable(__pyx_type_9WaveTools_RandomNLWaves.tp_dict, __pyx_vtabptr_9WaveTools_RandomNLWaves) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
65801  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RandomNLWaves, (PyObject *)&__pyx_type_9WaveTools_RandomNLWaves) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
65802  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9WaveTools_RandomNLWaves) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
65803  __pyx_ptype_9WaveTools_RandomNLWaves = &__pyx_type_9WaveTools_RandomNLWaves;
65804  if (PyType_Ready(&__pyx_type_9WaveTools___pyx_scope_struct____cinit__) < 0) __PYX_ERR(0, 1200, __pyx_L1_error)
65805  __pyx_type_9WaveTools___pyx_scope_struct____cinit__.tp_print = 0;
65806  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools___pyx_scope_struct____cinit__.tp_dictoffset && __pyx_type_9WaveTools___pyx_scope_struct____cinit__.tp_getattro == PyObject_GenericGetAttr)) {
65807  __pyx_type_9WaveTools___pyx_scope_struct____cinit__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
65808  }
65809  __pyx_ptype_9WaveTools___pyx_scope_struct____cinit__ = &__pyx_type_9WaveTools___pyx_scope_struct____cinit__;
65810  if (PyType_Ready(&__pyx_type_9WaveTools___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 1264, __pyx_L1_error)
65811  __pyx_type_9WaveTools___pyx_scope_struct_1_genexpr.tp_print = 0;
65812  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9WaveTools___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_9WaveTools___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
65813  __pyx_type_9WaveTools___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
65814  }
65815  __pyx_ptype_9WaveTools___pyx_scope_struct_1_genexpr = &__pyx_type_9WaveTools___pyx_scope_struct_1_genexpr;
65816  __Pyx_RefNannyFinishContext();
65817  return 0;
65818  __pyx_L1_error:;
65819  __Pyx_RefNannyFinishContext();
65820  return -1;
65821 }
65822 
65823 static int __Pyx_modinit_type_import_code(void) {
65824  __Pyx_RefNannyDeclarations
65825  PyObject *__pyx_t_1 = NULL;
65826  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
65827  /*--- Type import code ---*/
65828  __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
65829  __Pyx_GOTREF(__pyx_t_1);
65830  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
65831  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
65832  sizeof(PyTypeObject),
65833  #else
65834  sizeof(PyHeapTypeObject),
65835  #endif
65836  __Pyx_ImportType_CheckSize_Warn);
65837  if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
65838  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
65839  __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
65840  __Pyx_GOTREF(__pyx_t_1);
65841  __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
65842  if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(3, 206, __pyx_L1_error)
65843  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
65844  if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(3, 229, __pyx_L1_error)
65845  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
65846  if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(3, 233, __pyx_L1_error)
65847  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
65848  if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(3, 242, __pyx_L1_error)
65849  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
65850  if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(3, 918, __pyx_L1_error)
65851  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
65852  __Pyx_RefNannyFinishContext();
65853  return 0;
65854  __pyx_L1_error:;
65855  __Pyx_XDECREF(__pyx_t_1);
65856  __Pyx_RefNannyFinishContext();
65857  return -1;
65858 }
65859 
65860 static int __Pyx_modinit_variable_import_code(void) {
65861  __Pyx_RefNannyDeclarations
65862  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
65863  /*--- Variable import code ---*/
65864  __Pyx_RefNannyFinishContext();
65865  return 0;
65866 }
65867 
65868 static int __Pyx_modinit_function_import_code(void) {
65869  __Pyx_RefNannyDeclarations
65870  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
65871  /*--- Function import code ---*/
65872  __Pyx_RefNannyFinishContext();
65873  return 0;
65874 }
65875 
65876 
65877 #if PY_MAJOR_VERSION < 3
65878 #ifdef CYTHON_NO_PYINIT_EXPORT
65879 #define __Pyx_PyMODINIT_FUNC void
65880 #else
65881 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
65882 #endif
65883 #else
65884 #ifdef CYTHON_NO_PYINIT_EXPORT
65885 #define __Pyx_PyMODINIT_FUNC PyObject *
65886 #else
65887 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
65888 #endif
65889 #endif
65890 
65891 
65892 #if PY_MAJOR_VERSION < 3
65893 __Pyx_PyMODINIT_FUNC initWaveTools(void) CYTHON_SMALL_CODE; /*proto*/
65894 __Pyx_PyMODINIT_FUNC initWaveTools(void)
65895 #else
65896 __Pyx_PyMODINIT_FUNC PyInit_WaveTools(void) CYTHON_SMALL_CODE; /*proto*/
65897 __Pyx_PyMODINIT_FUNC PyInit_WaveTools(void)
65898 #if CYTHON_PEP489_MULTI_PHASE_INIT
65899 {
65900  return PyModuleDef_Init(&__pyx_moduledef);
65901 }
65902 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
65903  #if PY_VERSION_HEX >= 0x030700A1
65904  static PY_INT64_T main_interpreter_id = -1;
65905  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
65906  if (main_interpreter_id == -1) {
65907  main_interpreter_id = current_id;
65908  return (unlikely(current_id == -1)) ? -1 : 0;
65909  } else if (unlikely(main_interpreter_id != current_id))
65910  #else
65911  static PyInterpreterState *main_interpreter = NULL;
65912  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
65913  if (!main_interpreter) {
65914  main_interpreter = current_interpreter;
65915  } else if (unlikely(main_interpreter != current_interpreter))
65916  #endif
65917  {
65918  PyErr_SetString(
65919  PyExc_ImportError,
65920  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
65921  return -1;
65922  }
65923  return 0;
65924 }
65925 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
65926  PyObject *value = PyObject_GetAttrString(spec, from_name);
65927  int result = 0;
65928  if (likely(value)) {
65929  if (allow_none || value != Py_None) {
65930  result = PyDict_SetItemString(moddict, to_name, value);
65931  }
65932  Py_DECREF(value);
65933  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
65934  PyErr_Clear();
65935  } else {
65936  result = -1;
65937  }
65938  return result;
65939 }
65940 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
65941  PyObject *module = NULL, *moddict, *modname;
65942  if (__Pyx_check_single_interpreter())
65943  return NULL;
65944  if (__pyx_m)
65945  return __Pyx_NewRef(__pyx_m);
65946  modname = PyObject_GetAttrString(spec, "name");
65947  if (unlikely(!modname)) goto bad;
65948  module = PyModule_NewObject(modname);
65949  Py_DECREF(modname);
65950  if (unlikely(!module)) goto bad;
65951  moddict = PyModule_GetDict(module);
65952  if (unlikely(!moddict)) goto bad;
65953  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
65954  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
65955  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
65956  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
65957  return module;
65958 bad:
65959  Py_XDECREF(module);
65960  return NULL;
65961 }
65962 
65963 
65964 static CYTHON_SMALL_CODE int __pyx_pymod_exec_WaveTools(PyObject *__pyx_pyinit_module)
65965 #endif
65966 #endif
65967 {
65968  PyObject *__pyx_t_1 = NULL;
65969  PyObject *__pyx_t_2 = NULL;
65970  PyObject *__pyx_t_3 = NULL;
65971  PyObject *__pyx_t_4 = NULL;
65972  PyObject *__pyx_t_5 = NULL;
65973  PyObject *__pyx_t_6 = NULL;
65974  __Pyx_RefNannyDeclarations
65975  #if CYTHON_PEP489_MULTI_PHASE_INIT
65976  if (__pyx_m) {
65977  if (__pyx_m == __pyx_pyinit_module) return 0;
65978  PyErr_SetString(PyExc_RuntimeError, "Module 'WaveTools' has already been imported. Re-initialisation is not supported.");
65979  return -1;
65980  }
65981  #elif PY_MAJOR_VERSION >= 3
65982  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
65983  #endif
65984  #if CYTHON_REFNANNY
65985 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
65986 if (!__Pyx_RefNanny) {
65987  PyErr_Clear();
65988  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
65989  if (!__Pyx_RefNanny)
65990  Py_FatalError("failed to import 'refnanny' module");
65991 }
65992 #endif
65993  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_WaveTools(void)", 0);
65994  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
65995  #ifdef __Pxy_PyFrame_Initialize_Offsets
65996  __Pxy_PyFrame_Initialize_Offsets();
65997  #endif
65998  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 2, __pyx_L1_error)
65999  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 2, __pyx_L1_error)
66000  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 2, __pyx_L1_error)
66001  #ifdef __Pyx_CyFunction_USED
66002  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66003  #endif
66004  #ifdef __Pyx_FusedFunction_USED
66005  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66006  #endif
66007  #ifdef __Pyx_Coroutine_USED
66008  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66009  #endif
66010  #ifdef __Pyx_Generator_USED
66011  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66012  #endif
66013  #ifdef __Pyx_AsyncGen_USED
66014  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66015  #endif
66016  #ifdef __Pyx_StopAsyncIteration_USED
66017  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66018  #endif
66019  /*--- Library function declarations ---*/
66020  /*--- Threads initialization code ---*/
66021  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
66022  #ifdef WITH_THREAD /* Python build with threading support? */
66023  PyEval_InitThreads();
66024  #endif
66025  #endif
66026  /*--- Module creation code ---*/
66027  #if CYTHON_PEP489_MULTI_PHASE_INIT
66028  __pyx_m = __pyx_pyinit_module;
66029  Py_INCREF(__pyx_m);
66030  #else
66031  #if PY_MAJOR_VERSION < 3
66032  __pyx_m = Py_InitModule4("WaveTools", __pyx_methods, __pyx_k_Tools_for_working_with_water_wav, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
66033  #else
66034  __pyx_m = PyModule_Create(&__pyx_moduledef);
66035  #endif
66036  if (unlikely(!__pyx_m)) __PYX_ERR(0, 2, __pyx_L1_error)
66037  #endif
66038  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 2, __pyx_L1_error)
66039  Py_INCREF(__pyx_d);
66040  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 2, __pyx_L1_error)
66041  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 2, __pyx_L1_error)
66042  #if CYTHON_COMPILING_IN_PYPY
66043  Py_INCREF(__pyx_b);
66044  #endif
66045  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 2, __pyx_L1_error);
66046  /*--- Initialize various global constants etc. ---*/
66047  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66048  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
66049  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66050  #endif
66051  if (__pyx_module_is_main_WaveTools) {
66052  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66053  }
66054  #if PY_MAJOR_VERSION >= 3
66055  {
66056  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 2, __pyx_L1_error)
66057  if (!PyDict_GetItemString(modules, "WaveTools")) {
66058  if (unlikely(PyDict_SetItemString(modules, "WaveTools", __pyx_m) < 0)) __PYX_ERR(0, 2, __pyx_L1_error)
66059  }
66060  }
66061  #endif
66062  /*--- Builtin init code ---*/
66063  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66064  /*--- Constants init code ---*/
66065  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66066  /*--- Global type/function init code ---*/
66067  (void)__Pyx_modinit_global_init_code();
66068  (void)__Pyx_modinit_variable_export_code();
66069  (void)__Pyx_modinit_function_export_code();
66070  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
66071  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
66072  (void)__Pyx_modinit_variable_import_code();
66073  (void)__Pyx_modinit_function_import_code();
66074  /*--- Execution code ---*/
66075  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
66076  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 2, __pyx_L1_error)
66077  #endif
66078 
66079  /* "WaveTools.py":13
66080  * from __future__ import division
66081  *
66082  * from builtins import str # <<<<<<<<<<<<<<
66083  * from builtins import zip
66084  * from builtins import range
66085  */
66086  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
66087  __Pyx_GOTREF(__pyx_t_1);
66088  __Pyx_INCREF(__pyx_n_s_str);
66089  __Pyx_GIVEREF(__pyx_n_s_str);
66090  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_str);
66091  __pyx_t_2 = __Pyx_Import(__pyx_n_s_builtins, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
66092  __Pyx_GOTREF(__pyx_t_2);
66093  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66094  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
66095  __Pyx_GOTREF(__pyx_t_1);
66096  if (PyDict_SetItem(__pyx_d, __pyx_n_s_str, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
66097  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66098  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66099 
66100  /* "WaveTools.py":14
66101  *
66102  * from builtins import str
66103  * from builtins import zip # <<<<<<<<<<<<<<
66104  * from builtins import range
66105  * #from builtins import object
66106  */
66107  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
66108  __Pyx_GOTREF(__pyx_t_2);
66109  __Pyx_INCREF(__pyx_n_s_zip);
66110  __Pyx_GIVEREF(__pyx_n_s_zip);
66111  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_zip);
66112  __pyx_t_1 = __Pyx_Import(__pyx_n_s_builtins, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
66113  __Pyx_GOTREF(__pyx_t_1);
66114  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66115  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_zip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
66116  __Pyx_GOTREF(__pyx_t_2);
66117  if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
66118  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66119  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66120 
66121  /* "WaveTools.py":15
66122  * from builtins import str
66123  * from builtins import zip
66124  * from builtins import range # <<<<<<<<<<<<<<
66125  * #from builtins import object
66126  * from past.utils import old_div
66127  */
66128  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
66129  __Pyx_GOTREF(__pyx_t_1);
66130  __Pyx_INCREF(__pyx_n_s_range);
66131  __Pyx_GIVEREF(__pyx_n_s_range);
66132  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_range);
66133  __pyx_t_2 = __Pyx_Import(__pyx_n_s_builtins, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
66134  __Pyx_GOTREF(__pyx_t_2);
66135  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66136  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
66137  __Pyx_GOTREF(__pyx_t_1);
66138  if (PyDict_SetItem(__pyx_d, __pyx_n_s_range, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
66139  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66140  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66141 
66142  /* "WaveTools.py":17
66143  * from builtins import range
66144  * #from builtins import object
66145  * from past.utils import old_div # <<<<<<<<<<<<<<
66146  * import cython
66147  * import numpy as np
66148  */
66149  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
66150  __Pyx_GOTREF(__pyx_t_2);
66151  __Pyx_INCREF(__pyx_n_s_old_div);
66152  __Pyx_GIVEREF(__pyx_n_s_old_div);
66153  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_old_div);
66154  __pyx_t_1 = __Pyx_Import(__pyx_n_s_past_utils, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
66155  __Pyx_GOTREF(__pyx_t_1);
66156  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66157  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_old_div); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
66158  __Pyx_GOTREF(__pyx_t_2);
66159  if (PyDict_SetItem(__pyx_d, __pyx_n_s_old_div, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
66160  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66161  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66162 
66163  /* "WaveTools.py":19
66164  * from past.utils import old_div
66165  * import cython
66166  * import numpy as np # <<<<<<<<<<<<<<
66167  * import cmath as cmat
66168  * from .Profiling import logEvent, logFile
66169  */
66170  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
66171  __Pyx_GOTREF(__pyx_t_1);
66172  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
66173  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66174 
66175  /* "WaveTools.py":20
66176  * import cython
66177  * import numpy as np
66178  * import cmath as cmat # <<<<<<<<<<<<<<
66179  * from .Profiling import logEvent, logFile
66180  * from proteus import Comm
66181  */
66182  __pyx_t_1 = __Pyx_Import(__pyx_n_s_cmath, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
66183  __Pyx_GOTREF(__pyx_t_1);
66184  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cmat, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
66185  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66186 
66187  /* "WaveTools.py":21
66188  * import numpy as np
66189  * import cmath as cmat
66190  * from .Profiling import logEvent, logFile # <<<<<<<<<<<<<<
66191  * from proteus import Comm
66192  * import time as tt
66193  */
66194  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
66195  __Pyx_GOTREF(__pyx_t_1);
66196  __Pyx_INCREF(__pyx_n_s_logEvent);
66197  __Pyx_GIVEREF(__pyx_n_s_logEvent);
66198  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_logEvent);
66199  __Pyx_INCREF(__pyx_n_s_logFile);
66200  __Pyx_GIVEREF(__pyx_n_s_logFile);
66201  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_logFile);
66202  __pyx_t_2 = __Pyx_Import(__pyx_n_s_Profiling, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
66203  __Pyx_GOTREF(__pyx_t_2);
66204  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66205  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_logEvent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
66206  __Pyx_GOTREF(__pyx_t_1);
66207  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logEvent, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
66208  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66209  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_logFile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
66210  __Pyx_GOTREF(__pyx_t_1);
66211  if (PyDict_SetItem(__pyx_d, __pyx_n_s_logFile, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
66212  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66213  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66214 
66215  /* "WaveTools.py":22
66216  * import cmath as cmat
66217  * from .Profiling import logEvent, logFile
66218  * from proteus import Comm # <<<<<<<<<<<<<<
66219  * import time as tt
66220  * import sys as sys
66221  */
66222  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
66223  __Pyx_GOTREF(__pyx_t_2);
66224  __Pyx_INCREF(__pyx_n_s_Comm);
66225  __Pyx_GIVEREF(__pyx_n_s_Comm);
66226  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Comm);
66227  __pyx_t_1 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
66228  __Pyx_GOTREF(__pyx_t_1);
66229  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66230  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Comm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
66231  __Pyx_GOTREF(__pyx_t_2);
66232  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Comm, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
66233  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66234  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66235 
66236  /* "WaveTools.py":23
66237  * from .Profiling import logEvent, logFile
66238  * from proteus import Comm
66239  * import time as tt # <<<<<<<<<<<<<<
66240  * import sys as sys
66241  *
66242  */
66243  __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
66244  __Pyx_GOTREF(__pyx_t_1);
66245  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tt, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
66246  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66247 
66248  /* "WaveTools.py":24
66249  * from proteus import Comm
66250  * import time as tt
66251  * import sys as sys # <<<<<<<<<<<<<<
66252  *
66253  * __all__ = ['SteadyCurrent',
66254  */
66255  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
66256  __Pyx_GOTREF(__pyx_t_1);
66257  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
66258  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66259 
66260  /* "WaveTools.py":26
66261  * import sys as sys
66262  *
66263  * __all__ = ['SteadyCurrent', # <<<<<<<<<<<<<<
66264  * 'SolitaryWave',
66265  * 'MonochromaticWaves',
66266  */
66267  __pyx_t_1 = PyList_New(39); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
66268  __Pyx_GOTREF(__pyx_t_1);
66269  __Pyx_INCREF(__pyx_n_s_SteadyCurrent);
66270  __Pyx_GIVEREF(__pyx_n_s_SteadyCurrent);
66271  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_SteadyCurrent);
66272  __Pyx_INCREF(__pyx_n_s_SolitaryWave);
66273  __Pyx_GIVEREF(__pyx_n_s_SolitaryWave);
66274  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_SolitaryWave);
66275  __Pyx_INCREF(__pyx_n_s_MonochromaticWaves);
66276  __Pyx_GIVEREF(__pyx_n_s_MonochromaticWaves);
66277  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_MonochromaticWaves);
66278  __Pyx_INCREF(__pyx_n_s_NewWave);
66279  __Pyx_GIVEREF(__pyx_n_s_NewWave);
66280  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_NewWave);
66281  __Pyx_INCREF(__pyx_n_s_RandomWaves);
66282  __Pyx_GIVEREF(__pyx_n_s_RandomWaves);
66283  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_RandomWaves);
66284  __Pyx_INCREF(__pyx_n_s_MultiSpectraRandomWaves);
66285  __Pyx_GIVEREF(__pyx_n_s_MultiSpectraRandomWaves);
66286  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_MultiSpectraRandomWaves);
66287  __Pyx_INCREF(__pyx_n_s_DirectionalWaves);
66288  __Pyx_GIVEREF(__pyx_n_s_DirectionalWaves);
66289  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_DirectionalWaves);
66290  __Pyx_INCREF(__pyx_n_s_TimeSeries);
66291  __Pyx_GIVEREF(__pyx_n_s_TimeSeries);
66292  PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_TimeSeries);
66293  __Pyx_INCREF(__pyx_n_s_RandomWavesFast);
66294  __Pyx_GIVEREF(__pyx_n_s_RandomWavesFast);
66295  PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_RandomWavesFast);
66296  __Pyx_INCREF(__pyx_n_s_RandomNLWaves);
66297  __Pyx_GIVEREF(__pyx_n_s_RandomNLWaves);
66298  PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_RandomNLWaves);
66299  __Pyx_INCREF(__pyx_n_s_RandomNLWavesFast);
66300  __Pyx_GIVEREF(__pyx_n_s_RandomNLWavesFast);
66301  PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_RandomNLWavesFast);
66302  __Pyx_INCREF(__pyx_n_s_CombineWaves);
66303  __Pyx_GIVEREF(__pyx_n_s_CombineWaves);
66304  PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_CombineWaves);
66305  __Pyx_INCREF(__pyx_n_s_fastcos_test);
66306  __Pyx_GIVEREF(__pyx_n_s_fastcos_test);
66307  PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_s_fastcos_test);
66308  __Pyx_INCREF(__pyx_n_s_fastcosh_test);
66309  __Pyx_GIVEREF(__pyx_n_s_fastcosh_test);
66310  PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_s_fastcosh_test);
66311  __Pyx_INCREF(__pyx_n_s_fastsinh_test);
66312  __Pyx_GIVEREF(__pyx_n_s_fastsinh_test);
66313  PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_s_fastsinh_test);
66314  __Pyx_INCREF(__pyx_n_s_coshkzd_test);
66315  __Pyx_GIVEREF(__pyx_n_s_coshkzd_test);
66316  PyList_SET_ITEM(__pyx_t_1, 15, __pyx_n_s_coshkzd_test);
66317  __Pyx_INCREF(__pyx_n_s_sinhkzd_test);
66318  __Pyx_GIVEREF(__pyx_n_s_sinhkzd_test);
66319  PyList_SET_ITEM(__pyx_t_1, 16, __pyx_n_s_sinhkzd_test);
66320  __Pyx_INCREF(__pyx_n_s_loadExistingFunction);
66321  __Pyx_GIVEREF(__pyx_n_s_loadExistingFunction);
66322  PyList_SET_ITEM(__pyx_t_1, 17, __pyx_n_s_loadExistingFunction);
66323  __Pyx_INCREF(__pyx_n_s_setVertDir);
66324  __Pyx_GIVEREF(__pyx_n_s_setVertDir);
66325  PyList_SET_ITEM(__pyx_t_1, 18, __pyx_n_s_setVertDir);
66326  __Pyx_INCREF(__pyx_n_s_loadExistingFunction);
66327  __Pyx_GIVEREF(__pyx_n_s_loadExistingFunction);
66328  PyList_SET_ITEM(__pyx_t_1, 19, __pyx_n_s_loadExistingFunction);
66329  __Pyx_INCREF(__pyx_n_s_setVertDir);
66330  __Pyx_GIVEREF(__pyx_n_s_setVertDir);
66331  PyList_SET_ITEM(__pyx_t_1, 20, __pyx_n_s_setVertDir);
66332  __Pyx_INCREF(__pyx_n_s_setDirVector);
66333  __Pyx_GIVEREF(__pyx_n_s_setDirVector);
66334  PyList_SET_ITEM(__pyx_t_1, 21, __pyx_n_s_setDirVector);
66335  __Pyx_INCREF(__pyx_n_s_dirCheck);
66336  __Pyx_GIVEREF(__pyx_n_s_dirCheck);
66337  PyList_SET_ITEM(__pyx_t_1, 22, __pyx_n_s_dirCheck);
66338  __Pyx_INCREF(__pyx_n_s_reduceToIntervals);
66339  __Pyx_GIVEREF(__pyx_n_s_reduceToIntervals);
66340  PyList_SET_ITEM(__pyx_t_1, 23, __pyx_n_s_reduceToIntervals);
66341  __Pyx_INCREF(__pyx_n_s_returnRectangles);
66342  __Pyx_GIVEREF(__pyx_n_s_returnRectangles);
66343  PyList_SET_ITEM(__pyx_t_1, 24, __pyx_n_s_returnRectangles);
66344  __Pyx_INCREF(__pyx_n_s_returnRectangles3D);
66345  __Pyx_GIVEREF(__pyx_n_s_returnRectangles3D);
66346  PyList_SET_ITEM(__pyx_t_1, 25, __pyx_n_s_returnRectangles3D);
66347  __Pyx_INCREF(__pyx_n_s_normIntegral);
66348  __Pyx_GIVEREF(__pyx_n_s_normIntegral);
66349  PyList_SET_ITEM(__pyx_t_1, 26, __pyx_n_s_normIntegral);
66350  __Pyx_INCREF(__pyx_n_s_eta_mode);
66351  __Pyx_GIVEREF(__pyx_n_s_eta_mode);
66352  PyList_SET_ITEM(__pyx_t_1, 27, __pyx_n_s_eta_mode);
66353  __Pyx_INCREF(__pyx_n_s_Udrift);
66354  __Pyx_GIVEREF(__pyx_n_s_Udrift);
66355  PyList_SET_ITEM(__pyx_t_1, 28, __pyx_n_s_Udrift);
66356  __Pyx_INCREF(__pyx_n_s_vel_mode);
66357  __Pyx_GIVEREF(__pyx_n_s_vel_mode);
66358  PyList_SET_ITEM(__pyx_t_1, 29, __pyx_n_s_vel_mode);
66359  __Pyx_INCREF(__pyx_n_s_sigma);
66360  __Pyx_GIVEREF(__pyx_n_s_sigma);
66361  PyList_SET_ITEM(__pyx_t_1, 30, __pyx_n_s_sigma);
66362  __Pyx_INCREF(__pyx_n_s_JONSWAP);
66363  __Pyx_GIVEREF(__pyx_n_s_JONSWAP);
66364  PyList_SET_ITEM(__pyx_t_1, 31, __pyx_n_s_JONSWAP);
66365  __Pyx_INCREF(__pyx_n_s_PM_mod);
66366  __Pyx_GIVEREF(__pyx_n_s_PM_mod);
66367  PyList_SET_ITEM(__pyx_t_1, 32, __pyx_n_s_PM_mod);
66368  __Pyx_INCREF(__pyx_n_s_cos2s);
66369  __Pyx_GIVEREF(__pyx_n_s_cos2s);
66370  PyList_SET_ITEM(__pyx_t_1, 33, __pyx_n_s_cos2s);
66371  __Pyx_INCREF(__pyx_n_s_mitsuyasu);
66372  __Pyx_GIVEREF(__pyx_n_s_mitsuyasu);
66373  PyList_SET_ITEM(__pyx_t_1, 34, __pyx_n_s_mitsuyasu);
66374  __Pyx_INCREF(__pyx_n_s_dispersion);
66375  __Pyx_GIVEREF(__pyx_n_s_dispersion);
66376  PyList_SET_ITEM(__pyx_t_1, 35, __pyx_n_s_dispersion);
66377  __Pyx_INCREF(__pyx_n_s_tophat);
66378  __Pyx_GIVEREF(__pyx_n_s_tophat);
66379  PyList_SET_ITEM(__pyx_t_1, 36, __pyx_n_s_tophat);
66380  __Pyx_INCREF(__pyx_n_s_costap);
66381  __Pyx_GIVEREF(__pyx_n_s_costap);
66382  PyList_SET_ITEM(__pyx_t_1, 37, __pyx_n_s_costap);
66383  __Pyx_INCREF(__pyx_n_s_decompose_tseries);
66384  __Pyx_GIVEREF(__pyx_n_s_decompose_tseries);
66385  PyList_SET_ITEM(__pyx_t_1, 38, __pyx_n_s_decompose_tseries);
66386  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all_2, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
66387  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66388 
66389  /* "WaveTools.py":67
66390  *
66391  *
66392  * def fastcos_test(phase,sinus=False): # <<<<<<<<<<<<<<
66393  * """Fast cosine function with Taylor approximation - TO BE USED FOR TESTING"
66394  * Parameters
66395  */
66396  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_1fastcos_test, 0, __pyx_n_s_fastcos_test, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
66397  __Pyx_GOTREF(__pyx_t_1);
66398  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__65);
66399  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fastcos_test, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
66400  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66401 
66402  /* "WaveTools.py":84
66403  * phase = old_div(np.pi,2.) - phase
66404  * return fastcos(phase,True)
66405  * def fastcosh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
66406  * """Fast hyperbolic cosine function with Taylor approximation - TO BE USED FOR TESTING"
66407  * Parameters
66408  */
66409  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_3fastcosh_test, 0, __pyx_n_s_fastcosh_test, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
66410  __Pyx_GOTREF(__pyx_t_1);
66411  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__68);
66412  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fastcosh_test, __pyx_t_1) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
66413  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66414 
66415  /* "WaveTools.py":100
66416  * fastcosh(xx,k,Z,fast)
66417  * return xx[0]
66418  * def fastsinh_test(k,Z,fast=True): # <<<<<<<<<<<<<<
66419  * """Fast hyperbolic sine function with Taylor approximation - TO BE USED FOR TESTING"
66420  * Parameters
66421  */
66422  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_5fastsinh_test, 0, __pyx_n_s_fastsinh_test, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
66423  __Pyx_GOTREF(__pyx_t_1);
66424  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__71);
66425  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fastsinh_test, __pyx_t_1) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
66426  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66427 
66428  /* "WaveTools.py":118
66429  *
66430  *
66431  * def coshkzd_test(k,Z,d, fast=True): # <<<<<<<<<<<<<<
66432  * """Calculation of u horizontal profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
66433  * and hyp trig relation cosh(a+b) = cosha*coshb+sinha*sinhb
66434  */
66435  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_7coshkzd_test, 0, __pyx_n_s_coshkzd_test, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
66436  __Pyx_GOTREF(__pyx_t_1);
66437  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__74);
66438  if (PyDict_SetItem(__pyx_d, __pyx_n_s_coshkzd_test, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
66439  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66440 
66441  /* "WaveTools.py":140
66442  * return 0.
66443  *
66444  * def sinhkzd_test(k,Z,d,fast=True): # <<<<<<<<<<<<<<
66445  * """Calculation of v vertical profile cosh(k(d+Z))/sinh(kd) using fast appoximaitons
66446  * and hyp trig relation sinh(a+b) = sinha*coshb+cosha*sinhb
66447  */
66448  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_9sinhkzd_test, 0, __pyx_n_s_sinhkzd_test, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
66449  __Pyx_GOTREF(__pyx_t_1);
66450  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__77);
66451  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sinhkzd_test, __pyx_t_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
66452  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66453 
66454  /* "WaveTools.py":163
66455  * return 0.
66456  *
66457  * def loadExistingFunction(funcName, validFunctions): # <<<<<<<<<<<<<<
66458  * """Checks if a function name is known function and returns it
66459  *
66460  */
66461  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_11loadExistingFunction, 0, __pyx_n_s_loadExistingFunction, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
66462  __Pyx_GOTREF(__pyx_t_1);
66463  if (PyDict_SetItem(__pyx_d, __pyx_n_s_loadExistingFunction, __pyx_t_1) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
66464  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66465 
66466  /* "WaveTools.py":198
66467  *
66468  *
66469  * def setVertDir(g): # <<<<<<<<<<<<<<
66470  * """ Returns the unit vector for the vertical direction
66471  *
66472  */
66473  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13setVertDir, 0, __pyx_n_s_setVertDir, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error)
66474  __Pyx_GOTREF(__pyx_t_1);
66475  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVertDir, __pyx_t_1) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
66476  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66477 
66478  /* "WaveTools.py":216
66479  *
66480  *
66481  * def setDirVector(vector): # <<<<<<<<<<<<<<
66482  * """ Returns the direction of a vector in the form of a unit vector
66483  *
66484  */
66485  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_15setDirVector, 0, __pyx_n_s_setDirVector, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
66486  __Pyx_GOTREF(__pyx_t_1);
66487  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setDirVector, __pyx_t_1) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
66488  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66489 
66490  /* "WaveTools.py":231
66491  * return old_div(vector,(sqrt(vector[0]**2 + vector[1]**2 + vector[2]**2)))
66492  *
66493  * def dirCheck(v1, v2): # <<<<<<<<<<<<<<
66494  * """ Checks if two vectors are vertical raises SystemError if True
66495  *
66496  */
66497  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_17dirCheck, 0, __pyx_n_s_dirCheck, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
66498  __Pyx_GOTREF(__pyx_t_1);
66499  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dirCheck, __pyx_t_1) < 0) __PYX_ERR(0, 231, __pyx_L1_error)
66500  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66501 
66502  /* "WaveTools.py":258
66503  * else:
66504  * return None
66505  * def reduceToIntervals(fi,df): # <<<<<<<<<<<<<<
66506  * """ Prepares the x-axis array with N elements for numerical integration
66507  *
66508  */
66509  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_19reduceToIntervals, 0, __pyx_n_s_reduceToIntervals, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
66510  __Pyx_GOTREF(__pyx_t_1);
66511  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduceToIntervals, __pyx_t_1) < 0) __PYX_ERR(0, 258, __pyx_L1_error)
66512  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66513 
66514  /* "WaveTools.py":279
66515  * fim_tmp = (0.5*(fi[1:]+fi[:-1])).tolist()
66516  * return np.array([fim_tmp[0]-0.5*df]+fim_tmp+[fim_tmp[-1]+0.5*df])
66517  * def returnRectangles(a,x): # <<<<<<<<<<<<<<
66518  * """ Returns 2D discrete integral array using the rectangle method
66519  *
66520  */
66521  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_21returnRectangles, 0, __pyx_n_s_returnRectangles, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
66522  __Pyx_GOTREF(__pyx_t_1);
66523  if (PyDict_SetItem(__pyx_d, __pyx_n_s_returnRectangles, __pyx_t_1) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
66524  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66525 
66526  /* "WaveTools.py":299
66527  * """
66528  * return 0.5*(a[1:]+a[:-1])*(x[1:]-x[:-1])
66529  * def returnRectangles3D(a,x,y): # <<<<<<<<<<<<<<
66530  * """ Returns 3D discrete integrals using the rectangle method
66531  *
66532  */
66533  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_23returnRectangles3D, 0, __pyx_n_s_returnRectangles3D, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error)
66534  __Pyx_GOTREF(__pyx_t_1);
66535  if (PyDict_SetItem(__pyx_d, __pyx_n_s_returnRectangles3D, __pyx_t_1) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
66536  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66537 
66538  /* "WaveTools.py":326
66539  * ai[:,jj] *= (x[1:]-x[:-1])
66540  * return ai
66541  * def normIntegral(f,dom): # <<<<<<<<<<<<<<
66542  * """Returns a normalised 2D function
66543  *
66544  */
66545  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_25normIntegral, 0, __pyx_n_s_normIntegral, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error)
66546  __Pyx_GOTREF(__pyx_t_1);
66547  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normIntegral, __pyx_t_1) < 0) __PYX_ERR(0, 326, __pyx_L1_error)
66548  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66549 
66550  /* "WaveTools.py":349
66551  *
66552  *
66553  * def eta_mode(x, t, kDir, omega, phi, amplitude): # <<<<<<<<<<<<<<
66554  * """Calculates the free surface elevation for a single frequency mode
66555  *
66556  */
66557  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_27eta_mode, 0, __pyx_n_s_eta_mode, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
66558  __Pyx_GOTREF(__pyx_t_1);
66559  if (PyDict_SetItem(__pyx_d, __pyx_n_s_eta_mode, __pyx_t_1) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
66560  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66561 
66562  /* "WaveTools.py":375
66563  * phase = x[0]*kDir[0]+x[1]*kDir[1]+x[2]*kDir[2] - omega*t + phi
66564  * return amplitude*cos(phase)
66565  * def Udrift(amp,gAbs,c,d): # <<<<<<<<<<<<<<
66566  * """Calculates the 2nd order Stokes drift for a linear mode
66567  *
66568  */
66569  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_29Udrift, 0, __pyx_n_s_Udrift, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
66570  __Pyx_GOTREF(__pyx_t_1);
66571  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Udrift, __pyx_t_1) < 0) __PYX_ERR(0, 375, __pyx_L1_error)
66572  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66573 
66574  /* "WaveTools.py":397
66575  * return 0.5*gAbs*amp*amp/c/d
66576  *
66577  * def vel_mode(x, t, kDir, kAbs, omega, phi, amplitude, mwl, depth, vDir, gAbs): # <<<<<<<<<<<<<<
66578  * """Calculates the wave velocity components for a single frequency mode
66579  *
66580  */
66581  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_31vel_mode, 0, __pyx_n_s_vel_mode, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L1_error)
66582  __Pyx_GOTREF(__pyx_t_1);
66583  if (PyDict_SetItem(__pyx_d, __pyx_n_s_vel_mode, __pyx_t_1) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
66584  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66585 
66586  /* "WaveTools.py":447
66587  *
66588  *
66589  * def sigma(omega,omega0): # <<<<<<<<<<<<<<
66590  * """Calculates sigma function for JONSWAP spectrum
66591  *
66592  */
66593  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_33sigma, 0, __pyx_n_s_sigma, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
66594  __Pyx_GOTREF(__pyx_t_1);
66595  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sigma, __pyx_t_1) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
66596  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66597 
66598  /* "WaveTools.py":467
66599  *
66600  *
66601  * def JONSWAP(f,f0,Hs,gamma=3.3,TMA=False, depth = None): # <<<<<<<<<<<<<<
66602  * """Calculates the JONSWAP frequency spectrum (Goda 2009)
66603  *
66604  */
66605  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_35JONSWAP, 0, __pyx_n_s_JONSWAP, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
66606  __Pyx_GOTREF(__pyx_t_1);
66607  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__104);
66608  if (PyDict_SetItem(__pyx_d, __pyx_n_s_JONSWAP, __pyx_t_1) < 0) __PYX_ERR(0, 467, __pyx_L1_error)
66609  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66610 
66611  /* "WaveTools.py":507
66612  * return tma * bj*(Hs**2)*(old_div(1.,((Tp**4) *(f**5))))*np.exp(-1.25*(old_div(1.,(Tp*f)**(4.))))*(gamma**r)
66613  *
66614  * def PM_mod(f,f0,Hs): # <<<<<<<<<<<<<<
66615  * """Calculates the Pierson-Moskovitz spectrum (or Bretschneider or ISSC)
66616  *
66617  */
66618  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_37PM_mod, 0, __pyx_n_s_PM_mod, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
66619  __Pyx_GOTREF(__pyx_t_1);
66620  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PM_mod, __pyx_t_1) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
66621  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66622 
66623  /* "WaveTools.py":531
66624  * return (old_div(5.0,16.0))*Hs**2*(old_div(f0**4,f**5))*np.exp((old_div(-5.0,4.0))*(old_div(f0,f))**4)
66625  *
66626  * def cos2s(theta,f,s=10): # <<<<<<<<<<<<<<
66627  * """Calculates the cos-2s directional spreading function
66628  * see USACE - CETN-I-28 http://chl.erdc.usace.army.mil/library/publications/chetn/pdf/cetn-i-28.pdf
66629  */
66630  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_39cos2s, 0, __pyx_n_s_cos2s, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
66631  __Pyx_GOTREF(__pyx_t_1);
66632  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__109);
66633  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cos2s, __pyx_t_1) < 0) __PYX_ERR(0, 531, __pyx_L1_error)
66634  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66635 
66636  /* "WaveTools.py":553
66637  * fun[:,ii] = np.cos(old_div(theta,2))**(2*s)
66638  * return fun
66639  * def mitsuyasu(theta,fi,f0,smax=10): # <<<<<<<<<<<<<<
66640  * """The cos2s wave directional spread with wave frequency dependency
66641  *
66642  */
66643  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_41mitsuyasu, 0, __pyx_n_s_mitsuyasu, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
66644  __Pyx_GOTREF(__pyx_t_1);
66645  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__112);
66646  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mitsuyasu, __pyx_t_1) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
66647  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66648 
66649  /* "WaveTools.py":587
66650  *
66651  *
66652  * def dispersion(w,d, g = 9.81,niter = 1000): # <<<<<<<<<<<<<<
66653  * """Calculates the wave number for single or multiple frequencies using linear dispersion relation.
66654  *
66655  */
66656  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_43dispersion, 0, __pyx_n_s_dispersion, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error)
66657  __Pyx_GOTREF(__pyx_t_1);
66658  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__115);
66659  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dispersion, __pyx_t_1) < 0) __PYX_ERR(0, 587, __pyx_L1_error)
66660  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66661 
66662  /* "WaveTools.py":616
66663  *
66664  *
66665  * def tophat(l,cutoff): # <<<<<<<<<<<<<<
66666  * """ Calculates and returns a top hat filter array
66667  *
66668  */
66669  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_45tophat, 0, __pyx_n_s_tophat, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
66670  __Pyx_GOTREF(__pyx_t_1);
66671  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tophat, __pyx_t_1) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
66672  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66673 
66674  /* "WaveTools.py":636
66675  * return a
66676  *
66677  * def costap(l,cutoff=0.1): # <<<<<<<<<<<<<<
66678  * """ Calculates and returns a top hat filter array
66679  *
66680  */
66681  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_47costap, 0, __pyx_n_s_costap, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
66682  __Pyx_GOTREF(__pyx_t_1);
66683  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__120);
66684  if (PyDict_SetItem(__pyx_d, __pyx_n_s_costap, __pyx_t_1) < 0) __PYX_ERR(0, 636, __pyx_L1_error)
66685  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66686 
66687  /* "WaveTools.py":659
66688  * return wind
66689  *
66690  * def decompose_tseries(time,eta,dt): # <<<<<<<<<<<<<<
66691  * """ Performs spectral analysis and calculates angular frequency components, amplitude, phase and mean level power
66692  * of a time series with constant sampling.
66693  */
66694  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_49decompose_tseries, 0, __pyx_n_s_decompose_tseries, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
66695  __Pyx_GOTREF(__pyx_t_1);
66696  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompose_tseries, __pyx_t_1) < 0) __PYX_ERR(0, 659, __pyx_L1_error)
66697  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66698 
66699  /* "WaveTools.py":735
66700  * self.ramp = rampTime
66701  *
66702  * def eta(self,x,t): # <<<<<<<<<<<<<<
66703  * """Calculates free surface elevation (SolitaryWave class)
66704  * Parameters
66705  */
66706  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13SteadyCurrent_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SteadyCurrent_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error)
66707  __Pyx_GOTREF(__pyx_t_1);
66708  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_SteadyCurrent->tp_dict, __pyx_n_s_eta, __pyx_t_1) < 0) __PYX_ERR(0, 735, __pyx_L1_error)
66709  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66710  PyType_Modified(__pyx_ptype_9WaveTools_SteadyCurrent);
66711 
66712  /* "WaveTools.py":751
66713  * """
66714  * return 0.
66715  * def u(self,x,t): # <<<<<<<<<<<<<<
66716  * """Calculates wave velocity vector (SolitaryWave class).
66717  * Parameters
66718  */
66719  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13SteadyCurrent_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SteadyCurrent_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error)
66720  __Pyx_GOTREF(__pyx_t_1);
66721  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_SteadyCurrent->tp_dict, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
66722  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66723  PyType_Modified(__pyx_ptype_9WaveTools_SteadyCurrent);
66724 
66725  /* "(tree fragment)":1
66726  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
66727  * cdef tuple state
66728  * cdef object _dict
66729  */
66730  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13SteadyCurrent_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SteadyCurrent___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
66731  __Pyx_GOTREF(__pyx_t_1);
66732  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
66733  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66734 
66735  /* "(tree fragment)":16
66736  * else:
66737  * return __pyx_unpickle_SteadyCurrent, (type(self), 0xe2264c7, state)
66738  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
66739  * __pyx_unpickle_SteadyCurrent__set_state(self, __pyx_state)
66740  */
66741  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13SteadyCurrent_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SteadyCurrent___setstate_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
66742  __Pyx_GOTREF(__pyx_t_1);
66743  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
66744  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66745 
66746  /* "WaveTools.py":803
66747  * g,
66748  * waveDir,
66749  * trans = np.zeros(3,"d"), # <<<<<<<<<<<<<<
66750  * fast = True):
66751  *
66752  */
66753  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
66754  __Pyx_GOTREF(__pyx_t_1);
66755  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 803, __pyx_L1_error)
66756  __Pyx_GOTREF(__pyx_t_2);
66757  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66758  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__131, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
66759  __Pyx_GOTREF(__pyx_t_1);
66760  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66761  __pyx_k__12 = __pyx_t_1;
66762  __Pyx_GIVEREF(__pyx_t_1);
66763  __pyx_t_1 = 0;
66764 
66765  /* "WaveTools.py":822
66766  * dirCheck(self.waveDir,self.vDir)
66767  *
66768  * def eta(self,x,t): # <<<<<<<<<<<<<<
66769  * """Calculates free surface elevation (SolitaryWave class)
66770  * Parameters
66771  */
66772  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12SolitaryWave_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SolitaryWave_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error)
66773  __Pyx_GOTREF(__pyx_t_1);
66774  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_SolitaryWave->tp_dict, __pyx_n_s_eta, __pyx_t_1) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
66775  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66776  PyType_Modified(__pyx_ptype_9WaveTools_SolitaryWave);
66777 
66778  /* "WaveTools.py":840
66779  * a1 = self.K*phase
66780  * return self.H*1.0/ cosh(a1)**2
66781  * def u(self,x,t): # <<<<<<<<<<<<<<
66782  * """Calculates wave velocity vector (SolitaryWave class).
66783  * Parameters
66784  */
66785  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12SolitaryWave_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SolitaryWave_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error)
66786  __Pyx_GOTREF(__pyx_t_1);
66787  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_SolitaryWave->tp_dict, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 840, __pyx_L1_error)
66788  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66789  PyType_Modified(__pyx_ptype_9WaveTools_SolitaryWave);
66790 
66791  /* "(tree fragment)":1
66792  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
66793  * cdef tuple state
66794  * cdef object _dict
66795  */
66796  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12SolitaryWave_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SolitaryWave___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
66797  __Pyx_GOTREF(__pyx_t_1);
66798  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
66799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66800 
66801  /* "(tree fragment)":16
66802  * else:
66803  * return __pyx_unpickle_SolitaryWave, (type(self), 0x9a37670, state)
66804  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
66805  * __pyx_unpickle_SolitaryWave__set_state(self, __pyx_state)
66806  */
66807  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12SolitaryWave_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SolitaryWave___setstate_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
66808  __Pyx_GOTREF(__pyx_t_1);
66809  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
66810  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66811 
66812  /* "WaveTools.py":951
66813  * autoFenton=True,
66814  * autoFentonOpts=None,
66815  * Ycoeff = np.zeros(1000,), # <<<<<<<<<<<<<<
66816  * Bcoeff =np.zeros(1000,),
66817  * Nf = 1000,
66818  */
66819  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
66820  __Pyx_GOTREF(__pyx_t_1);
66821  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
66822  __Pyx_GOTREF(__pyx_t_2);
66823  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66824  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
66825  __Pyx_GOTREF(__pyx_t_1);
66826  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66827  __pyx_k__13 = __pyx_t_1;
66828  __Pyx_GIVEREF(__pyx_t_1);
66829  __pyx_t_1 = 0;
66830 
66831  /* "WaveTools.py":952
66832  * autoFentonOpts=None,
66833  * Ycoeff = np.zeros(1000,),
66834  * Bcoeff =np.zeros(1000,), # <<<<<<<<<<<<<<
66835  * Nf = 1000,
66836  * meanVelocity = np.array([0.,0,0.]),
66837  */
66838  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error)
66839  __Pyx_GOTREF(__pyx_t_1);
66840  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L1_error)
66841  __Pyx_GOTREF(__pyx_t_2);
66842  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66843  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__140, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error)
66844  __Pyx_GOTREF(__pyx_t_1);
66845  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66846  __pyx_k__14 = __pyx_t_1;
66847  __Pyx_GIVEREF(__pyx_t_1);
66848  __pyx_t_1 = 0;
66849 
66850  /* "WaveTools.py":954
66851  * Bcoeff =np.zeros(1000,),
66852  * Nf = 1000,
66853  * meanVelocity = np.array([0.,0,0.]), # <<<<<<<<<<<<<<
66854  * phi0 = 0.,
66855  * fast = True):
66856  */
66857  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
66858  __Pyx_GOTREF(__pyx_t_1);
66859  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error)
66860  __Pyx_GOTREF(__pyx_t_2);
66861  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66862  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error)
66863  __Pyx_GOTREF(__pyx_t_1);
66864  __Pyx_INCREF(__pyx_float_0_);
66865  __Pyx_GIVEREF(__pyx_float_0_);
66866  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_float_0_);
66867  __Pyx_INCREF(__pyx_int_0);
66868  __Pyx_GIVEREF(__pyx_int_0);
66869  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
66870  __Pyx_INCREF(__pyx_float_0_);
66871  __Pyx_GIVEREF(__pyx_float_0_);
66872  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_float_0_);
66873  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error)
66874  __Pyx_GOTREF(__pyx_t_3);
66875  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66876  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66877  __pyx_k__15 = __pyx_t_3;
66878  __Pyx_GIVEREF(__pyx_t_3);
66879  __pyx_t_3 = 0;
66880 
66881  /* "WaveTools.py":1102
66882  * __cpp_uFenton(U,x, t, self.kDir_,self.k,self.omega,self.phi0,self.amplitude,self.mwl, self.depth, self.gAbs,self.Nf, self.Bcoeff_, self.mV_,self.waveDir_,self.vDir_, self.tanhF_, self.fast)
66883  *
66884  * def eta(self,x,t): # <<<<<<<<<<<<<<
66885  * """Calculates free surface elevation (MonochromaticWaves class)
66886  * Parameters
66887  */
66888  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_18MonochromaticWaves_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MonochromaticWaves_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error)
66889  __Pyx_GOTREF(__pyx_t_3);
66890  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_MonochromaticWaves->tp_dict, __pyx_n_s_eta, __pyx_t_3) < 0) __PYX_ERR(0, 1102, __pyx_L1_error)
66891  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66892  PyType_Modified(__pyx_ptype_9WaveTools_MonochromaticWaves);
66893 
66894  /* "WaveTools.py":1126
66895  * return self.etaFenton(xx,t)
66896  *
66897  * def u(self,x,t): # <<<<<<<<<<<<<<
66898  * """Calculates wave velocity vector (MonochromaticWaves class).
66899  * Parameters
66900  */
66901  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_18MonochromaticWaves_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MonochromaticWaves_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error)
66902  __Pyx_GOTREF(__pyx_t_3);
66903  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_MonochromaticWaves->tp_dict, __pyx_n_s_u, __pyx_t_3) < 0) __PYX_ERR(0, 1126, __pyx_L1_error)
66904  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66905  PyType_Modified(__pyx_ptype_9WaveTools_MonochromaticWaves);
66906 
66907  /* "(tree fragment)":1
66908  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
66909  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
66910  * def __setstate_cython__(self, __pyx_state):
66911  */
66912  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_18MonochromaticWaves_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MonochromaticWaves___reduce_cyth, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
66913  __Pyx_GOTREF(__pyx_t_3);
66914  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
66915  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66916 
66917  /* "(tree fragment)":3
66918  * def __reduce_cython__(self):
66919  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
66920  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
66921  * raise TypeError("self.Bcoeff_,self.Ycoeff_,self._cpp_eta,self._cpp_u,self.kDir_,self.mV_,self.tanhF_,self.vDir_,self.waveDir_ cannot be converted to a Python object for pickling")
66922  */
66923  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_18MonochromaticWaves_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MonochromaticWaves___setstate_cy, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
66924  __Pyx_GOTREF(__pyx_t_3);
66925  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
66926  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66927 
66928  /* "WaveTools.py":1212
66929  * spectral_params = None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
66930  * crestFocus=True,
66931  * xfocus=np.array([0.,0.,0]), # <<<<<<<<<<<<<<
66932  * tfocus=0.,
66933  * fast = True,
66934  */
66935  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1212, __pyx_L1_error)
66936  __Pyx_GOTREF(__pyx_t_3);
66937  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
66938  __Pyx_GOTREF(__pyx_t_1);
66939  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66940  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1212, __pyx_L1_error)
66941  __Pyx_GOTREF(__pyx_t_3);
66942  __Pyx_INCREF(__pyx_float_0_);
66943  __Pyx_GIVEREF(__pyx_float_0_);
66944  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_);
66945  __Pyx_INCREF(__pyx_float_0_);
66946  __Pyx_GIVEREF(__pyx_float_0_);
66947  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_);
66948  __Pyx_INCREF(__pyx_int_0);
66949  __Pyx_GIVEREF(__pyx_int_0);
66950  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
66951  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1212, __pyx_L1_error)
66952  __Pyx_GOTREF(__pyx_t_2);
66953  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66954  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66955  __pyx_k__22 = __pyx_t_2;
66956  __Pyx_GIVEREF(__pyx_t_2);
66957  __pyx_t_2 = 0;
66958 
66959  /* "WaveTools.py":1295
66960  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
66961  *
66962  * def eta(self, x, t): # <<<<<<<<<<<<<<
66963  * """Calculates free surface elevation (RandomWaves class)
66964  * Parameters
66965  */
66966  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_7NewWave_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NewWave_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
66967  __Pyx_GOTREF(__pyx_t_2);
66968  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_NewWave->tp_dict, __pyx_n_s_eta, __pyx_t_2) < 0) __PYX_ERR(0, 1295, __pyx_L1_error)
66969  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66970  PyType_Modified(__pyx_ptype_9WaveTools_NewWave);
66971 
66972  /* "WaveTools.py":1319
66973  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
66974  *
66975  * def u(self, x, t): # <<<<<<<<<<<<<<
66976  * """Calculates wave velocity vector (RandomWaves class)
66977  * Parameters
66978  */
66979  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_7NewWave_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NewWave_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
66980  __Pyx_GOTREF(__pyx_t_2);
66981  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_NewWave->tp_dict, __pyx_n_s_u, __pyx_t_2) < 0) __PYX_ERR(0, 1319, __pyx_L1_error)
66982  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66983  PyType_Modified(__pyx_ptype_9WaveTools_NewWave);
66984 
66985  /* "WaveTools.py":1347
66986  *
66987  * return U
66988  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
66989  * """Writes a timeseries of the free-surface elevation
66990  *
66991  */
66992  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
66993  __Pyx_GOTREF(__pyx_t_2);
66994  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L1_error)
66995  __Pyx_GOTREF(__pyx_t_3);
66996  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
66997  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __pyx_L1_error)
66998  __Pyx_GOTREF(__pyx_t_2);
66999  __Pyx_INCREF(__pyx_float_0_);
67000  __Pyx_GIVEREF(__pyx_float_0_);
67001  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_float_0_);
67002  __Pyx_INCREF(__pyx_int_0);
67003  __Pyx_GIVEREF(__pyx_int_0);
67004  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
67005  __Pyx_INCREF(__pyx_int_0);
67006  __Pyx_GIVEREF(__pyx_int_0);
67007  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_int_0);
67008  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
67009  __Pyx_GOTREF(__pyx_t_1);
67010  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67011  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67012  __pyx_k__24 = __pyx_t_1;
67013  __Pyx_GIVEREF(__pyx_t_1);
67014  __pyx_t_1 = 0;
67015  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_7NewWave_7writeEtaSeries, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NewWave_writeEtaSeries, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
67016  __Pyx_GOTREF(__pyx_t_1);
67017  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_NewWave->tp_dict, __pyx_n_s_writeEtaSeries, __pyx_t_1) < 0) __PYX_ERR(0, 1347, __pyx_L1_error)
67018  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67019  PyType_Modified(__pyx_ptype_9WaveTools_NewWave);
67020 
67021  /* "(tree fragment)":1
67022  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
67023  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67024  * def __setstate_cython__(self, __pyx_state):
67025  */
67026  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_7NewWave_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NewWave___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
67027  __Pyx_GOTREF(__pyx_t_1);
67028  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67029  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67030 
67031  /* "(tree fragment)":3
67032  * def __reduce_cython__(self):
67033  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67034  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
67035  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67036  */
67037  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_7NewWave_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NewWave___setstate_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
67038  __Pyx_GOTREF(__pyx_t_1);
67039  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
67040  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67041 
67042  /* "WaveTools.py":1532
67043  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.N, self.fast)
67044  *
67045  * def eta(self, x, t): # <<<<<<<<<<<<<<
67046  * """Calculates free surface elevation (RandomWaves class)
67047  * Parameters
67048  */
67049  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_11RandomWaves_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomWaves_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1532, __pyx_L1_error)
67050  __Pyx_GOTREF(__pyx_t_1);
67051  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomWaves->tp_dict, __pyx_n_s_eta, __pyx_t_1) < 0) __PYX_ERR(0, 1532, __pyx_L1_error)
67052  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67053  PyType_Modified(__pyx_ptype_9WaveTools_RandomWaves);
67054 
67055  /* "WaveTools.py":1556
67056  * __cpp_uRandom(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.N, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
67057  *
67058  * def u(self, x, t): # <<<<<<<<<<<<<<
67059  * """Calculates wave velocity vector (RandomWaves class)
67060  * Parameters
67061  */
67062  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_11RandomWaves_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomWaves_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error)
67063  __Pyx_GOTREF(__pyx_t_1);
67064  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomWaves->tp_dict, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 1556, __pyx_L1_error)
67065  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67066  PyType_Modified(__pyx_ptype_9WaveTools_RandomWaves);
67067 
67068  /* "WaveTools.py":1584
67069  *
67070  * return U
67071  * def writeEtaSeries(self,Tstart,Tend,x0,fname,Lgen= np.array([0.,0,0])): # <<<<<<<<<<<<<<
67072  * """Writes a timeseries of the free-surface elevation
67073  *
67074  */
67075  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1584, __pyx_L1_error)
67076  __Pyx_GOTREF(__pyx_t_1);
67077  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1584, __pyx_L1_error)
67078  __Pyx_GOTREF(__pyx_t_2);
67079  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67080  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1584, __pyx_L1_error)
67081  __Pyx_GOTREF(__pyx_t_1);
67082  __Pyx_INCREF(__pyx_float_0_);
67083  __Pyx_GIVEREF(__pyx_float_0_);
67084  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_float_0_);
67085  __Pyx_INCREF(__pyx_int_0);
67086  __Pyx_GIVEREF(__pyx_int_0);
67087  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
67088  __Pyx_INCREF(__pyx_int_0);
67089  __Pyx_GIVEREF(__pyx_int_0);
67090  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_0);
67091  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
67092  __Pyx_GOTREF(__pyx_t_3);
67093  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67094  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67095  __pyx_k__29 = __pyx_t_3;
67096  __Pyx_GIVEREF(__pyx_t_3);
67097  __pyx_t_3 = 0;
67098  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_11RandomWaves_7writeEtaSeries, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomWaves_writeEtaSeries, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1584, __pyx_L1_error)
67099  __Pyx_GOTREF(__pyx_t_3);
67100  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomWaves->tp_dict, __pyx_n_s_writeEtaSeries, __pyx_t_3) < 0) __PYX_ERR(0, 1584, __pyx_L1_error)
67101  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67102  PyType_Modified(__pyx_ptype_9WaveTools_RandomWaves);
67103 
67104  /* "(tree fragment)":1
67105  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
67106  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67107  * def __setstate_cython__(self, __pyx_state):
67108  */
67109  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_11RandomWaves_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomWaves___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
67110  __Pyx_GOTREF(__pyx_t_3);
67111  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67112  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67113 
67114  /* "(tree fragment)":3
67115  * def __reduce_cython__(self):
67116  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67117  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
67118  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67119  */
67120  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_11RandomWaves_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomWaves___setstate_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
67121  __Pyx_GOTREF(__pyx_t_3);
67122  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
67123  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67124 
67125  /* "WaveTools.py":1774
67126  * return __cpp_etaRandom(x,t,self.kDirM_, self.omegaM_,self.phiM_,self.aiM_, self.Nall,self.fast)
67127  *
67128  * def eta(self, x, t): # <<<<<<<<<<<<<<
67129  * """Calculates free surface elevation (RandomWaves class)
67130  * Parameters
67131  */
67132  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiSpectraRandomWaves_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1774, __pyx_L1_error)
67133  __Pyx_GOTREF(__pyx_t_3);
67134  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_MultiSpectraRandomWaves->tp_dict, __pyx_n_s_eta, __pyx_t_3) < 0) __PYX_ERR(0, 1774, __pyx_L1_error)
67135  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67136  PyType_Modified(__pyx_ptype_9WaveTools_MultiSpectraRandomWaves);
67137 
67138  /* "WaveTools.py":1799
67139  * __cpp_uDir(U, x,t,self.kDirM_, self.kiM_, self.omegaM_,self.phiM_,self.aiM_,self.mwl,self.depth, self.Nall, self.waveDirM_, self.vDir_, self.tanhM_, self.gAbs, self.fast)
67140  *
67141  * def u(self, x, t): # <<<<<<<<<<<<<<
67142  * """Calculates wave velocity vector (RandomWaves class)
67143  * Parameters
67144  */
67145  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiSpectraRandomWaves_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error)
67146  __Pyx_GOTREF(__pyx_t_3);
67147  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_MultiSpectraRandomWaves->tp_dict, __pyx_n_s_u, __pyx_t_3) < 0) __PYX_ERR(0, 1799, __pyx_L1_error)
67148  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67149  PyType_Modified(__pyx_ptype_9WaveTools_MultiSpectraRandomWaves);
67150 
67151  /* "(tree fragment)":1
67152  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
67153  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67154  * def __setstate_cython__(self, __pyx_state):
67155  */
67156  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiSpectraRandomWaves___reduce, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
67157  __Pyx_GOTREF(__pyx_t_3);
67158  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67159  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67160 
67161  /* "(tree fragment)":3
67162  * def __reduce_cython__(self):
67163  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67164  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
67165  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67166  */
67167  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_23MultiSpectraRandomWaves_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultiSpectraRandomWaves___setsta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
67168  __Pyx_GOTREF(__pyx_t_3);
67169  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
67170  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67171 
67172  /* "WaveTools.py":2011
67173  * return __cpp_etaRandom(x,t,self.kDir_, self.omega_,self.phi_,self.ai_, self.Nall, self.fast)
67174  *
67175  * def eta(self, x, t): # <<<<<<<<<<<<<<
67176  * """Calculates free surface elevation (RandomWaves class)
67177  * Parameters
67178  */
67179  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_16DirectionalWaves_3eta, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DirectionalWaves_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error)
67180  __Pyx_GOTREF(__pyx_t_3);
67181  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_DirectionalWaves->tp_dict, __pyx_n_s_eta, __pyx_t_3) < 0) __PYX_ERR(0, 2011, __pyx_L1_error)
67182  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67183  PyType_Modified(__pyx_ptype_9WaveTools_DirectionalWaves);
67184 
67185  /* "WaveTools.py":2036
67186  * __cpp_uDir(U, x,t,self.kDir_, self.ki_, self.omega_,self.phi_,self.ai_,self.mwl,self.depth, self.Nall, self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
67187  *
67188  * def u(self, x, t): # <<<<<<<<<<<<<<
67189  * """Calculates wave velocity vector (RandomWaves class)
67190  * Parameters
67191  */
67192  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_16DirectionalWaves_5u, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DirectionalWaves_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2036, __pyx_L1_error)
67193  __Pyx_GOTREF(__pyx_t_3);
67194  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_DirectionalWaves->tp_dict, __pyx_n_s_u, __pyx_t_3) < 0) __PYX_ERR(0, 2036, __pyx_L1_error)
67195  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67196  PyType_Modified(__pyx_ptype_9WaveTools_DirectionalWaves);
67197 
67198  /* "(tree fragment)":1
67199  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
67200  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67201  * def __setstate_cython__(self, __pyx_state):
67202  */
67203  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_16DirectionalWaves_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DirectionalWaves___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
67204  __Pyx_GOTREF(__pyx_t_3);
67205  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67206  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67207 
67208  /* "(tree fragment)":3
67209  * def __reduce_cython__(self):
67210  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67211  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
67212  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
67213  */
67214  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_16DirectionalWaves_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_DirectionalWaves___setstate_cyth, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error)
67215  __Pyx_GOTREF(__pyx_t_3);
67216  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
67217  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67218 
67219  /* "WaveTools.py":2123
67220  * arrayData = False,
67221  * seriesArray = None,
67222  * Lgen = np.array([0.,0.,0]), # <<<<<<<<<<<<<<
67223  * fast = True
67224  * ):
67225  */
67226  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2123, __pyx_L1_error)
67227  __Pyx_GOTREF(__pyx_t_3);
67228  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2123, __pyx_L1_error)
67229  __Pyx_GOTREF(__pyx_t_1);
67230  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67231  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2123, __pyx_L1_error)
67232  __Pyx_GOTREF(__pyx_t_3);
67233  __Pyx_INCREF(__pyx_float_0_);
67234  __Pyx_GIVEREF(__pyx_float_0_);
67235  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_);
67236  __Pyx_INCREF(__pyx_float_0_);
67237  __Pyx_GIVEREF(__pyx_float_0_);
67238  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_);
67239  __Pyx_INCREF(__pyx_int_0);
67240  __Pyx_GIVEREF(__pyx_int_0);
67241  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
67242  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2123, __pyx_L1_error)
67243  __Pyx_GOTREF(__pyx_t_2);
67244  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67245  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67246  __pyx_k__40 = __pyx_t_2;
67247  __Pyx_GIVEREF(__pyx_t_2);
67248  __pyx_t_2 = 0;
67249 
67250  /* "WaveTools.py":2434
67251  * self._cpp_u = self._cpp_uWindow
67252  *
67253  * def windOut(self): # <<<<<<<<<<<<<<
67254  * return {"TWindow":self.Twindow,"TOverlap":self.Toverlap,"Tlag":self.Tlag, "rec_direct":self.rec_direct}
67255  *
67256  */
67257  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_3windOut, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries_windOut, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2434, __pyx_L1_error)
67258  __Pyx_GOTREF(__pyx_t_2);
67259  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_TimeSeries->tp_dict, __pyx_n_s_windOut, __pyx_t_2) < 0) __PYX_ERR(0, 2434, __pyx_L1_error)
67260  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67261  PyType_Modified(__pyx_ptype_9WaveTools_TimeSeries);
67262 
67263  /* "WaveTools.py":2443
67264  * __cpp_uDirect(U,x,self.x0_,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
67265  *
67266  * def etaDirect(self, x, t): # <<<<<<<<<<<<<<
67267  *
67268  * """Calculates free surface elevation(Timeseries class-direct method
67269  */
67270  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_5etaDirect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries_etaDirect, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2443, __pyx_L1_error)
67271  __Pyx_GOTREF(__pyx_t_2);
67272  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_TimeSeries->tp_dict, __pyx_n_s_etaDirect, __pyx_t_2) < 0) __PYX_ERR(0, 2443, __pyx_L1_error)
67273  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67274  PyType_Modified(__pyx_ptype_9WaveTools_TimeSeries);
67275 
67276  /* "WaveTools.py":2465
67277  * return self._cpp_etaDirect(xx,t)
67278  *
67279  * def uDirect(self, x, t): # <<<<<<<<<<<<<<
67280  * """Calculates wave velocity vector (Timeseries class-direct method)
67281  * Parameters
67282  */
67283  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_7uDirect, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries_uDirect, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error)
67284  __Pyx_GOTREF(__pyx_t_2);
67285  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_TimeSeries->tp_dict, __pyx_n_s_uDirect, __pyx_t_2) < 0) __PYX_ERR(0, 2465, __pyx_L1_error)
67286  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67287  PyType_Modified(__pyx_ptype_9WaveTools_TimeSeries);
67288 
67289  /* "WaveTools.py":2494
67290  * return U
67291  *
67292  * def findWindow(self,t): # <<<<<<<<<<<<<<
67293  * """Returns the current spectral window in TimeSeries class."
67294  *
67295  */
67296  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_9findWindow, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries_findWindow, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2494, __pyx_L1_error)
67297  __Pyx_GOTREF(__pyx_t_2);
67298  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_TimeSeries->tp_dict, __pyx_n_s_findWindow, __pyx_t_2) < 0) __PYX_ERR(0, 2494, __pyx_L1_error)
67299  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67300  PyType_Modified(__pyx_ptype_9WaveTools_TimeSeries);
67301 
67302  /* "WaveTools.py":2519
67303  * __cpp_uWindow(U,x,self.x0_,t,self.T0_,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.mwl,self.depth,self.Nf,Nw,self.waveDir_, self.vDir_, self.tanh_, self.gAbs, self.fast)
67304  *
67305  * def etaWindow(self, x, t): # <<<<<<<<<<<<<<
67306  * """Calculates free surface elevation(Timeseries class-window method
67307  * Parameters
67308  */
67309  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_11etaWindow, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries_etaWindow, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2519, __pyx_L1_error)
67310  __Pyx_GOTREF(__pyx_t_2);
67311  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_TimeSeries->tp_dict, __pyx_n_s_etaWindow, __pyx_t_2) < 0) __PYX_ERR(0, 2519, __pyx_L1_error)
67312  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67313  PyType_Modified(__pyx_ptype_9WaveTools_TimeSeries);
67314 
67315  /* "WaveTools.py":2541
67316  *
67317  *
67318  * def uWindow(self, x, t): # <<<<<<<<<<<<<<
67319  * """Calculates wave velocity vector (Timeseries class-window method)
67320  * Parameters
67321  */
67322  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_13uWindow, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries_uWindow, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2541, __pyx_L1_error)
67323  __Pyx_GOTREF(__pyx_t_2);
67324  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_TimeSeries->tp_dict, __pyx_n_s_uWindow, __pyx_t_2) < 0) __PYX_ERR(0, 2541, __pyx_L1_error)
67325  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67326  PyType_Modified(__pyx_ptype_9WaveTools_TimeSeries);
67327 
67328  /* "(tree fragment)":1
67329  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
67330  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
67331  * def __setstate_cython__(self, __pyx_state):
67332  */
67333  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_15__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
67334  __Pyx_GOTREF(__pyx_t_2);
67335  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67336  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67337 
67338  /* "(tree fragment)":3
67339  * def __reduce_cython__(self):
67340  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
67341  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
67342  * raise TypeError("self.T0_,self._cpp_eta,self._cpp_u,self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.tanh_,self.vDir_,self.waveDir_,self.whand_ cannot be converted to a Python object for pickling")
67343  */
67344  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_10TimeSeries_17__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TimeSeries___setstate_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
67345  __Pyx_GOTREF(__pyx_t_2);
67346  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
67347  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67348 
67349  /* "WaveTools.py":2571
67350  *
67351  *
67352  * class RandomWavesFast(object): # <<<<<<<<<<<<<<
67353  * """
67354  * This class is used for generating plane random waves in an optimised manner
67355  */
67356  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__201); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2571, __pyx_L1_error)
67357  __Pyx_GOTREF(__pyx_t_2);
67358  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__201, __pyx_n_s_RandomWavesFast, __pyx_n_s_RandomWavesFast, (PyObject *) NULL, __pyx_n_s_WaveTools, __pyx_kp_s_This_class_is_used_for_generati); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2571, __pyx_L1_error)
67359  __Pyx_GOTREF(__pyx_t_3);
67360 
67361  /* "WaveTools.py":2622
67362  * """
67363  *
67364  * def __init__(self, # <<<<<<<<<<<<<<
67365  * Tstart,
67366  * Tend,
67367  */
67368  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_15RandomWavesFast_1__init__, 0, __pyx_n_s_RandomWavesFast___init, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2622, __pyx_L1_error)
67369  __Pyx_GOTREF(__pyx_t_1);
67370  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__204);
67371  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 2622, __pyx_L1_error)
67372  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67373 
67374  /* "WaveTools.py":2725
67375  * self.windOut = TS.windOut
67376  *
67377  * def printOut(self): # <<<<<<<<<<<<<<
67378  * """Prints some properties of the time series - ONLY FOR TESTING
67379  *
67380  */
67381  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_15RandomWavesFast_3printOut, 0, __pyx_n_s_RandomWavesFast_printOut, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2725, __pyx_L1_error)
67382  __Pyx_GOTREF(__pyx_t_1);
67383  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_printOut, __pyx_t_1) < 0) __PYX_ERR(0, 2725, __pyx_L1_error)
67384  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67385 
67386  /* "WaveTools.py":2571
67387  *
67388  *
67389  * class RandomWavesFast(object): # <<<<<<<<<<<<<<
67390  * """
67391  * This class is used for generating plane random waves in an optimised manner
67392  */
67393  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RandomWavesFast, __pyx_tuple__201, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2571, __pyx_L1_error)
67394  __Pyx_GOTREF(__pyx_t_1);
67395  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandomWavesFast, __pyx_t_1) < 0) __PYX_ERR(0, 2571, __pyx_L1_error)
67396  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67397  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67398  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67399 
67400  /* "WaveTools.py":2834
67401  * def _cpp_eta_2ndOrder(self,x,t):
67402  * return __cpp_eta2nd(x,t,self.kDir_,self.ki_,self.omega_,self.phi_,self.ai_,self.N,self.sinhKd_,self.tanhKd_, self.fast)
67403  * def eta_2ndOrder(self,x,t): # <<<<<<<<<<<<<<
67404  * """Calculates the free surface elevation for 2nd-order terms
67405  *
67406  */
67407  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_3eta_2ndOrder, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_eta_2ndOrder, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error)
67408  __Pyx_GOTREF(__pyx_t_2);
67409  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_eta_2ndOrder, __pyx_t_2) < 0) __PYX_ERR(0, 2834, __pyx_L1_error)
67410  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67411  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67412 
67413  /* "WaveTools.py":2872
67414  *
67415  * #higher harmonics
67416  * def eta_short(self,x,t): # <<<<<<<<<<<<<<
67417  * """Calculates the free surface elevation for higher-order terms
67418  *
67419  */
67420  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_5eta_short, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_eta_short, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2872, __pyx_L1_error)
67421  __Pyx_GOTREF(__pyx_t_2);
67422  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_eta_short, __pyx_t_2) < 0) __PYX_ERR(0, 2872, __pyx_L1_error)
67423  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67424  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67425 
67426  /* "WaveTools.py":2913
67427  *
67428  * #lower harmonics
67429  * def eta_long(self,x,t): # <<<<<<<<<<<<<<
67430  * """Calculates the free surface elevation for lower-order terms
67431  *
67432  */
67433  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_7eta_long, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_eta_long, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2913, __pyx_L1_error)
67434  __Pyx_GOTREF(__pyx_t_2);
67435  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_eta_long, __pyx_t_2) < 0) __PYX_ERR(0, 2913, __pyx_L1_error)
67436  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67437  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67438 
67439  /* "WaveTools.py":2951
67440  *
67441  * #set-up calculation
67442  * def eta_setUp(self,x,t): # <<<<<<<<<<<<<<
67443  * """Calculates the free surface elevation set up
67444  *
67445  */
67446  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_9eta_setUp, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_eta_setUp, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2951, __pyx_L1_error)
67447  __Pyx_GOTREF(__pyx_t_2);
67448  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_eta_setUp, __pyx_t_2) < 0) __PYX_ERR(0, 2951, __pyx_L1_error)
67449  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67450  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67451 
67452  /* "WaveTools.py":2980
67453  *
67454  * #overall free surface elevation
67455  * def eta_overall(self,x,t,setUp=False): # <<<<<<<<<<<<<<
67456  * """Calculates the free surface elevation with 2nd order corrections
67457  *
67458  */
67459  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_11eta_overall, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_eta_overall, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2980, __pyx_L1_error)
67460  __Pyx_GOTREF(__pyx_t_2);
67461  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_eta_overall, __pyx_t_2) < 0) __PYX_ERR(0, 2980, __pyx_L1_error)
67462  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67463  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67464 
67465  /* "WaveTools.py":3009
67466  *
67467  *
67468  * def writeEtaSeries(self,Tstart,Tend,dt,x0,fname, mode="all",setUp=False, Lgen=np.zeros(3,)): # <<<<<<<<<<<<<<
67469  * """Writes a timeseries of the free-surface elevation
67470  *
67471  */
67472  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3009, __pyx_L1_error)
67473  __Pyx_GOTREF(__pyx_t_2);
67474  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3009, __pyx_L1_error)
67475  __Pyx_GOTREF(__pyx_t_3);
67476  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67477  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__217, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3009, __pyx_L1_error)
67478  __Pyx_GOTREF(__pyx_t_2);
67479  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67480  __pyx_k__51 = __pyx_t_2;
67481  __Pyx_GIVEREF(__pyx_t_2);
67482  __pyx_t_2 = 0;
67483  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_13writeEtaSeries, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_writeEtaSeries, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3009, __pyx_L1_error)
67484  __Pyx_GOTREF(__pyx_t_2);
67485  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_writeEtaSeries, __pyx_t_2) < 0) __PYX_ERR(0, 3009, __pyx_L1_error)
67486  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67487  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67488 
67489  /* "WaveTools.py":3076
67490  * return series
67491  *
67492  * def wtError(self,x,t): # <<<<<<<<<<<<<<
67493  * """Raises error for using RandomNLWavesFast class instead
67494  *
67495  */
67496  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_15wtError, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves_wtError, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3076, __pyx_L1_error)
67497  __Pyx_GOTREF(__pyx_t_2);
67498  if (PyDict_SetItem((PyObject *)__pyx_ptype_9WaveTools_RandomNLWaves->tp_dict, __pyx_n_s_wtError, __pyx_t_2) < 0) __PYX_ERR(0, 3076, __pyx_L1_error)
67499  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67500  PyType_Modified(__pyx_ptype_9WaveTools_RandomNLWaves);
67501 
67502  /* "(tree fragment)":1
67503  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
67504  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
67505  * def __setstate_cython__(self, __pyx_state):
67506  */
67507  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves___reduce_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
67508  __Pyx_GOTREF(__pyx_t_2);
67509  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67510  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67511 
67512  /* "(tree fragment)":3
67513  * def __reduce_cython__(self):
67514  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
67515  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
67516  * raise TypeError("self.ai_,self.kDir_,self.ki_,self.omega_,self.phi_,self.sinhKd_,self.tanhKd_ cannot be converted to a Python object for pickling")
67517  */
67518  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_13RandomNLWaves_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RandomNLWaves___setstate_cython, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
67519  __Pyx_GOTREF(__pyx_t_2);
67520  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
67521  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67522 
67523  /* "WaveTools.py":3102
67524  *
67525  *
67526  * class RandomNLWavesFast(object): # <<<<<<<<<<<<<<
67527  * """
67528  * This class is used for generating plane random waves with 2ns order correction in an optimised manner
67529  */
67530  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__226); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3102, __pyx_L1_error)
67531  __Pyx_GOTREF(__pyx_t_2);
67532  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__226, __pyx_n_s_RandomNLWavesFast, __pyx_n_s_RandomNLWavesFast, (PyObject *) NULL, __pyx_n_s_WaveTools, __pyx_kp_s_This_class_is_used_for_generati_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3102, __pyx_L1_error)
67533  __Pyx_GOTREF(__pyx_t_3);
67534 
67535  /* "WaveTools.py":3152
67536  * Switch for enabling optimised functions
67537  * """
67538  * def __init__(self, # <<<<<<<<<<<<<<
67539  * Tstart,
67540  * Tend,
67541  */
67542  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_17RandomNLWavesFast_1__init__, 0, __pyx_n_s_RandomNLWavesFast___init, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3152, __pyx_L1_error)
67543  __Pyx_GOTREF(__pyx_t_1);
67544  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 3152, __pyx_L1_error)
67545 
67546  /* "WaveTools.py":3167
67547  * spectral_params=None, #JONPARAMS = {"gamma": 3.3, "TMA":True,"depth": depth}
67548  * phi=None,
67549  * Lgen = np.array([0.,0.,0.]), #array of component phases # <<<<<<<<<<<<<<
67550  * Nwaves = 15,
67551  * Nfreq = 32,
67552  */
67553  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3167, __pyx_L1_error)
67554  __Pyx_GOTREF(__pyx_t_4);
67555  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3167, __pyx_L1_error)
67556  __Pyx_GOTREF(__pyx_t_5);
67557  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
67558  __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3167, __pyx_L1_error)
67559  __Pyx_GOTREF(__pyx_t_4);
67560  __Pyx_INCREF(__pyx_float_0_);
67561  __Pyx_GIVEREF(__pyx_float_0_);
67562  PyList_SET_ITEM(__pyx_t_4, 0, __pyx_float_0_);
67563  __Pyx_INCREF(__pyx_float_0_);
67564  __Pyx_GIVEREF(__pyx_float_0_);
67565  PyList_SET_ITEM(__pyx_t_4, 1, __pyx_float_0_);
67566  __Pyx_INCREF(__pyx_float_0_);
67567  __Pyx_GIVEREF(__pyx_float_0_);
67568  PyList_SET_ITEM(__pyx_t_4, 2, __pyx_float_0_);
67569  __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3167, __pyx_L1_error)
67570  __Pyx_GOTREF(__pyx_t_6);
67571  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
67572  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
67573  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_Lgen = __pyx_t_6;
67574  __Pyx_GIVEREF(__pyx_t_6);
67575  __pyx_t_6 = 0;
67576  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_9WaveTools_54__defaults__);
67577  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 3152, __pyx_L1_error)
67578  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67579 
67580  /* "WaveTools.py":3221
67581  *
67582  *
67583  * def eta(self,x,t): # <<<<<<<<<<<<<<
67584  * """Calculates free surface elevation (RandomNLWavesFast class)
67585  * Parameters
67586  */
67587  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_17RandomNLWavesFast_3eta, 0, __pyx_n_s_RandomNLWavesFast_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3221, __pyx_L1_error)
67588  __Pyx_GOTREF(__pyx_t_1);
67589  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_eta, __pyx_t_1) < 0) __PYX_ERR(0, 3221, __pyx_L1_error)
67590  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67591 
67592  /* "WaveTools.py":3240
67593  *
67594  *
67595  * def u(self,x,t): # <<<<<<<<<<<<<<
67596  * """Calculates wave velocity vector (RandomNLWavesFast class)
67597  * Parameters
67598  */
67599  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_17RandomNLWavesFast_5u, 0, __pyx_n_s_RandomNLWavesFast_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3240, __pyx_L1_error)
67600  __Pyx_GOTREF(__pyx_t_1);
67601  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 3240, __pyx_L1_error)
67602  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67603 
67604  /* "WaveTools.py":3102
67605  *
67606  *
67607  * class RandomNLWavesFast(object): # <<<<<<<<<<<<<<
67608  * """
67609  * This class is used for generating plane random waves with 2ns order correction in an optimised manner
67610  */
67611  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RandomNLWavesFast, __pyx_tuple__226, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3102, __pyx_L1_error)
67612  __Pyx_GOTREF(__pyx_t_1);
67613  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RandomNLWavesFast, __pyx_t_1) < 0) __PYX_ERR(0, 3102, __pyx_L1_error)
67614  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67615  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67616  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67617 
67618  /* "WaveTools.py":3258
67619  * return uR
67620  *
67621  * class CombineWaves(object): # <<<<<<<<<<<<<<
67622  * """
67623  * This class is used for combining multiple waveTools classes, thus allowing for the generation of complex wave conditions
67624  */
67625  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__233); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3258, __pyx_L1_error)
67626  __Pyx_GOTREF(__pyx_t_2);
67627  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__233, __pyx_n_s_CombineWaves, __pyx_n_s_CombineWaves, (PyObject *) NULL, __pyx_n_s_WaveTools, __pyx_kp_s_This_class_is_used_for_combinin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3258, __pyx_L1_error)
67628  __Pyx_GOTREF(__pyx_t_3);
67629 
67630  /* "WaveTools.py":3267
67631  * List of wave classes
67632  * """
67633  * def __init__(self,waveList): # <<<<<<<<<<<<<<
67634  * try:
67635  * for condition in waveList:
67636  */
67637  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12CombineWaves_1__init__, 0, __pyx_n_s_CombineWaves___init, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3267, __pyx_L1_error)
67638  __Pyx_GOTREF(__pyx_t_1);
67639  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 3267, __pyx_L1_error)
67640  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67641 
67642  /* "WaveTools.py":3282
67643  * self.waveList = waveList
67644  * self.mwl = waveList[0].mwl
67645  * def eta(self,x,t): # <<<<<<<<<<<<<<
67646  * """
67647  * Calculates free surface elevation (combineWaves class)
67648  */
67649  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12CombineWaves_3eta, 0, __pyx_n_s_CombineWaves_eta, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3282, __pyx_L1_error)
67650  __Pyx_GOTREF(__pyx_t_1);
67651  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_eta, __pyx_t_1) < 0) __PYX_ERR(0, 3282, __pyx_L1_error)
67652  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67653 
67654  /* "WaveTools.py":3303
67655  * return eta
67656  *
67657  * def u(self,x,t): # <<<<<<<<<<<<<<
67658  * """
67659  * Calculates wave particle velocity (combineWaves class)
67660  */
67661  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_12CombineWaves_5u, 0, __pyx_n_s_CombineWaves_u, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3303, __pyx_L1_error)
67662  __Pyx_GOTREF(__pyx_t_1);
67663  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_u, __pyx_t_1) < 0) __PYX_ERR(0, 3303, __pyx_L1_error)
67664  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67665 
67666  /* "WaveTools.py":3258
67667  * return uR
67668  *
67669  * class CombineWaves(object): # <<<<<<<<<<<<<<
67670  * """
67671  * This class is used for combining multiple waveTools classes, thus allowing for the generation of complex wave conditions
67672  */
67673  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CombineWaves, __pyx_tuple__233, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3258, __pyx_L1_error)
67674  __Pyx_GOTREF(__pyx_t_1);
67675  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CombineWaves, __pyx_t_1) < 0) __PYX_ERR(0, 3258, __pyx_L1_error)
67676  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67677  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
67678  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67679 
67680  /* "(tree fragment)":1
67681  * def __pyx_unpickle_SteadyCurrent(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
67682  * cdef object __pyx_PickleError
67683  * cdef object __pyx_result
67684  */
67685  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_51__pyx_unpickle_SteadyCurrent, 0, __pyx_n_s_pyx_unpickle_SteadyCurrent, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
67686  __Pyx_GOTREF(__pyx_t_2);
67687  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SteadyCurrent, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67688  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67689 
67690  /* "(tree fragment)":11
67691  * __pyx_unpickle_SteadyCurrent__set_state(<SteadyCurrent> __pyx_result, __pyx_state)
67692  * return __pyx_result
67693  * cdef __pyx_unpickle_SteadyCurrent__set_state(SteadyCurrent __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
67694  * __pyx_result.U = __pyx_state[0]; __pyx_result.mwl = __pyx_state[1]; __pyx_result.ramp = __pyx_state[2]
67695  * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
67696  */
67697  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9WaveTools_53__pyx_unpickle_SolitaryWave, 0, __pyx_n_s_pyx_unpickle_SolitaryWave, NULL, __pyx_n_s_WaveTools, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
67698  __Pyx_GOTREF(__pyx_t_2);
67699  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SolitaryWave, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
67700  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67701 
67702  /* "WaveTools.py":2
67703  *
67704  * """Tools for working with water waves. # <<<<<<<<<<<<<<
67705  *
67706  * The primary objective of this module is to provide solutions (exact and
67707  */
67708  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error)
67709  __Pyx_GOTREF(__pyx_t_2);
67710  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 2, __pyx_L1_error)
67711  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
67712 
67713  /* "carray.to_py":124
67714  *
67715  * @cname("__Pyx_carray_to_tuple_double")
67716  * cdef inline tuple __Pyx_carray_to_tuple_double(base_type *v, Py_ssize_t length): # <<<<<<<<<<<<<<
67717  * cdef size_t i
67718  * cdef object value
67719  */
67720 
67721  /*--- Wrapped vars code ---*/
67722 
67723  goto __pyx_L0;
67724  __pyx_L1_error:;
67725  __Pyx_XDECREF(__pyx_t_1);
67726  __Pyx_XDECREF(__pyx_t_2);
67727  __Pyx_XDECREF(__pyx_t_3);
67728  __Pyx_XDECREF(__pyx_t_4);
67729  __Pyx_XDECREF(__pyx_t_5);
67730  __Pyx_XDECREF(__pyx_t_6);
67731  if (__pyx_m) {
67732  if (__pyx_d) {
67733  __Pyx_AddTraceback("init WaveTools", __pyx_clineno, __pyx_lineno, __pyx_filename);
67734  }
67735  Py_CLEAR(__pyx_m);
67736  } else if (!PyErr_Occurred()) {
67737  PyErr_SetString(PyExc_ImportError, "init WaveTools");
67738  }
67739  __pyx_L0:;
67740  __Pyx_RefNannyFinishContext();
67741  #if CYTHON_PEP489_MULTI_PHASE_INIT
67742  return (__pyx_m != NULL) ? 0 : -1;
67743  #elif PY_MAJOR_VERSION >= 3
67744  return __pyx_m;
67745  #else
67746  return;
67747  #endif
67748 }
67749 
67750 /* --- Runtime support code --- */
67751 /* Refnanny */
67752 #if CYTHON_REFNANNY
67753 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
67754  PyObject *m = NULL, *p = NULL;
67755  void *r = NULL;
67756  m = PyImport_ImportModule(modname);
67757  if (!m) goto end;
67758  p = PyObject_GetAttrString(m, "RefNannyAPI");
67759  if (!p) goto end;
67760  r = PyLong_AsVoidPtr(p);
67761 end:
67762  Py_XDECREF(p);
67763  Py_XDECREF(m);
67764  return (__Pyx_RefNannyAPIStruct *)r;
67765 }
67766 #endif
67767 
67768 /* PyObjectGetAttrStr */
67769 #if CYTHON_USE_TYPE_SLOTS
67770 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
67771  PyTypeObject* tp = Py_TYPE(obj);
67772  if (likely(tp->tp_getattro))
67773  return tp->tp_getattro(obj, attr_name);
67774 #if PY_MAJOR_VERSION < 3
67775  if (likely(tp->tp_getattr))
67776  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
67777 #endif
67778  return PyObject_GetAttr(obj, attr_name);
67779 }
67780 #endif
67781 
67782 /* GetBuiltinName */
67783 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
67784  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
67785  if (unlikely(!result)) {
67786  PyErr_Format(PyExc_NameError,
67787 #if PY_MAJOR_VERSION >= 3
67788  "name '%U' is not defined", name);
67789 #else
67790  "name '%.200s' is not defined", PyString_AS_STRING(name));
67791 #endif
67792  }
67793  return result;
67794 }
67795 
67796 /* RaiseDoubleKeywords */
67797 static void __Pyx_RaiseDoubleKeywordsError(
67798  const char* func_name,
67799  PyObject* kw_name)
67800 {
67801  PyErr_Format(PyExc_TypeError,
67802  #if PY_MAJOR_VERSION >= 3
67803  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
67804  #else
67805  "%s() got multiple values for keyword argument '%s'", func_name,
67806  PyString_AsString(kw_name));
67807  #endif
67808 }
67809 
67810 /* ParseKeywords */
67811 static int __Pyx_ParseOptionalKeywords(
67812  PyObject *kwds,
67813  PyObject **argnames[],
67814  PyObject *kwds2,
67815  PyObject *values[],
67816  Py_ssize_t num_pos_args,
67817  const char* function_name)
67818 {
67819  PyObject *key = 0, *value = 0;
67820  Py_ssize_t pos = 0;
67821  PyObject*** name;
67822  PyObject*** first_kw_arg = argnames + num_pos_args;
67823  while (PyDict_Next(kwds, &pos, &key, &value)) {
67824  name = first_kw_arg;
67825  while (*name && (**name != key)) name++;
67826  if (*name) {
67827  values[name-argnames] = value;
67828  continue;
67829  }
67830  name = first_kw_arg;
67831  #if PY_MAJOR_VERSION < 3
67832  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
67833  while (*name) {
67834  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
67835  && _PyString_Eq(**name, key)) {
67836  values[name-argnames] = value;
67837  break;
67838  }
67839  name++;
67840  }
67841  if (*name) continue;
67842  else {
67843  PyObject*** argname = argnames;
67844  while (argname != first_kw_arg) {
67845  if ((**argname == key) || (
67846  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
67847  && _PyString_Eq(**argname, key))) {
67848  goto arg_passed_twice;
67849  }
67850  argname++;
67851  }
67852  }
67853  } else
67854  #endif
67855  if (likely(PyUnicode_Check(key))) {
67856  while (*name) {
67857  int cmp = (**name == key) ? 0 :
67858  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
67859  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
67860  #endif
67861  PyUnicode_Compare(**name, key);
67862  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
67863  if (cmp == 0) {
67864  values[name-argnames] = value;
67865  break;
67866  }
67867  name++;
67868  }
67869  if (*name) continue;
67870  else {
67871  PyObject*** argname = argnames;
67872  while (argname != first_kw_arg) {
67873  int cmp = (**argname == key) ? 0 :
67874  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
67875  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
67876  #endif
67877  PyUnicode_Compare(**argname, key);
67878  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
67879  if (cmp == 0) goto arg_passed_twice;
67880  argname++;
67881  }
67882  }
67883  } else
67884  goto invalid_keyword_type;
67885  if (kwds2) {
67886  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
67887  } else {
67888  goto invalid_keyword;
67889  }
67890  }
67891  return 0;
67892 arg_passed_twice:
67893  __Pyx_RaiseDoubleKeywordsError(function_name, key);
67894  goto bad;
67895 invalid_keyword_type:
67896  PyErr_Format(PyExc_TypeError,
67897  "%.200s() keywords must be strings", function_name);
67898  goto bad;
67899 invalid_keyword:
67900  PyErr_Format(PyExc_TypeError,
67901  #if PY_MAJOR_VERSION < 3
67902  "%.200s() got an unexpected keyword argument '%.200s'",
67903  function_name, PyString_AsString(key));
67904  #else
67905  "%s() got an unexpected keyword argument '%U'",
67906  function_name, key);
67907  #endif
67908 bad:
67909  return -1;
67910 }
67911 
67912 /* RaiseArgTupleInvalid */
67913 static void __Pyx_RaiseArgtupleInvalid(
67914  const char* func_name,
67915  int exact,
67916  Py_ssize_t num_min,
67917  Py_ssize_t num_max,
67918  Py_ssize_t num_found)
67919 {
67920  Py_ssize_t num_expected;
67921  const char *more_or_less;
67922  if (num_found < num_min) {
67923  num_expected = num_min;
67924  more_or_less = "at least";
67925  } else {
67926  num_expected = num_max;
67927  more_or_less = "at most";
67928  }
67929  if (exact) {
67930  more_or_less = "exactly";
67931  }
67932  PyErr_Format(PyExc_TypeError,
67933  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
67934  func_name, more_or_less, num_expected,
67935  (num_expected == 1) ? "" : "s", num_found);
67936 }
67937 
67938 /* GetModuleGlobalName */
67939 #if CYTHON_USE_DICT_VERSIONS
67940 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
67941 #else
67942 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
67943 #endif
67944 {
67945  PyObject *result;
67946 #if !CYTHON_AVOID_BORROWED_REFS
67947 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
67948  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
67949  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
67950  if (likely(result)) {
67951  return __Pyx_NewRef(result);
67952  } else if (unlikely(PyErr_Occurred())) {
67953  return NULL;
67954  }
67955 #else
67956  result = PyDict_GetItem(__pyx_d, name);
67957  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
67958  if (likely(result)) {
67959  return __Pyx_NewRef(result);
67960  }
67961 #endif
67962 #else
67963  result = PyObject_GetItem(__pyx_d, name);
67964  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
67965  if (likely(result)) {
67966  return __Pyx_NewRef(result);
67967  }
67968  PyErr_Clear();
67969 #endif
67970  return __Pyx_GetBuiltinName(name);
67971 }
67972 
67973 /* PyFunctionFastCall */
67974 #if CYTHON_FAST_PYCALL
67975 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
67976  PyObject *globals) {
67977  PyFrameObject *f;
67978  PyThreadState *tstate = __Pyx_PyThreadState_Current;
67979  PyObject **fastlocals;
67980  Py_ssize_t i;
67981  PyObject *result;
67982  assert(globals != NULL);
67983  /* XXX Perhaps we should create a specialized
67984  PyFrame_New() that doesn't take locals, but does
67985  take builtins without sanity checking them.
67986  */
67987  assert(tstate != NULL);
67988  f = PyFrame_New(tstate, co, globals, NULL);
67989  if (f == NULL) {
67990  return NULL;
67991  }
67992  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
67993  for (i = 0; i < na; i++) {
67994  Py_INCREF(*args);
67995  fastlocals[i] = *args++;
67996  }
67997  result = PyEval_EvalFrameEx(f,0);
67998  ++tstate->recursion_depth;
67999  Py_DECREF(f);
68000  --tstate->recursion_depth;
68001  return result;
68002 }
68003 #if 1 || PY_VERSION_HEX < 0x030600B1
68004 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
68005  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
68006  PyObject *globals = PyFunction_GET_GLOBALS(func);
68007  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
68008  PyObject *closure;
68009 #if PY_MAJOR_VERSION >= 3
68010  PyObject *kwdefs;
68011 #endif
68012  PyObject *kwtuple, **k;
68013  PyObject **d;
68014  Py_ssize_t nd;
68015  Py_ssize_t nk;
68016  PyObject *result;
68017  assert(kwargs == NULL || PyDict_Check(kwargs));
68018  nk = kwargs ? PyDict_Size(kwargs) : 0;
68019  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
68020  return NULL;
68021  }
68022  if (
68023 #if PY_MAJOR_VERSION >= 3
68024  co->co_kwonlyargcount == 0 &&
68025 #endif
68026  likely(kwargs == NULL || nk == 0) &&
68027  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
68028  if (argdefs == NULL && co->co_argcount == nargs) {
68029  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
68030  goto done;
68031  }
68032  else if (nargs == 0 && argdefs != NULL
68033  && co->co_argcount == Py_SIZE(argdefs)) {
68034  /* function called with no arguments, but all parameters have
68035  a default value: use default values as arguments .*/
68036  args = &PyTuple_GET_ITEM(argdefs, 0);
68037  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
68038  goto done;
68039  }
68040  }
68041  if (kwargs != NULL) {
68042  Py_ssize_t pos, i;
68043  kwtuple = PyTuple_New(2 * nk);
68044  if (kwtuple == NULL) {
68045  result = NULL;
68046  goto done;
68047  }
68048  k = &PyTuple_GET_ITEM(kwtuple, 0);
68049  pos = i = 0;
68050  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
68051  Py_INCREF(k[i]);
68052  Py_INCREF(k[i+1]);
68053  i += 2;
68054  }
68055  nk = i / 2;
68056  }
68057  else {
68058  kwtuple = NULL;
68059  k = NULL;
68060  }
68061  closure = PyFunction_GET_CLOSURE(func);
68062 #if PY_MAJOR_VERSION >= 3
68063  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
68064 #endif
68065  if (argdefs != NULL) {
68066  d = &PyTuple_GET_ITEM(argdefs, 0);
68067  nd = Py_SIZE(argdefs);
68068  }
68069  else {
68070  d = NULL;
68071  nd = 0;
68072  }
68073 #if PY_MAJOR_VERSION >= 3
68074  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
68075  args, nargs,
68076  k, (int)nk,
68077  d, (int)nd, kwdefs, closure);
68078 #else
68079  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
68080  args, nargs,
68081  k, (int)nk,
68082  d, (int)nd, closure);
68083 #endif
68084  Py_XDECREF(kwtuple);
68085 done:
68086  Py_LeaveRecursiveCall();
68087  return result;
68088 }
68089 #endif
68090 #endif
68091 
68092 /* PyCFunctionFastCall */
68093 #if CYTHON_FAST_PYCCALL
68094 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
68095  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
68096  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
68097  PyObject *self = PyCFunction_GET_SELF(func);
68098  int flags = PyCFunction_GET_FLAGS(func);
68099  assert(PyCFunction_Check(func));
68100  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
68101  assert(nargs >= 0);
68102  assert(nargs == 0 || args != NULL);
68103  /* _PyCFunction_FastCallDict() must not be called with an exception set,
68104  because it may clear it (directly or indirectly) and so the
68105  caller loses its exception */
68106  assert(!PyErr_Occurred());
68107  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
68108  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
68109  } else {
68110  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
68111  }
68112 }
68113 #endif
68114 
68115 /* PyObjectCall */
68116 #if CYTHON_COMPILING_IN_CPYTHON
68117 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
68118  PyObject *result;
68119  ternaryfunc call = func->ob_type->tp_call;
68120  if (unlikely(!call))
68121  return PyObject_Call(func, arg, kw);
68122  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
68123  return NULL;
68124  result = (*call)(func, arg, kw);
68125  Py_LeaveRecursiveCall();
68126  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
68127  PyErr_SetString(
68128  PyExc_SystemError,
68129  "NULL result without error in PyObject_Call");
68130  }
68131  return result;
68132 }
68133 #endif
68134 
68135 /* PyObjectCall2Args */
68136 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
68137  PyObject *args, *result = NULL;
68138  #if CYTHON_FAST_PYCALL
68139  if (PyFunction_Check(function)) {
68140  PyObject *args[2] = {arg1, arg2};
68141  return __Pyx_PyFunction_FastCall(function, args, 2);
68142  }
68143  #endif
68144  #if CYTHON_FAST_PYCCALL
68145  if (__Pyx_PyFastCFunction_Check(function)) {
68146  PyObject *args[2] = {arg1, arg2};
68147  return __Pyx_PyCFunction_FastCall(function, args, 2);
68148  }
68149  #endif
68150  args = PyTuple_New(2);
68151  if (unlikely(!args)) goto done;
68152  Py_INCREF(arg1);
68153  PyTuple_SET_ITEM(args, 0, arg1);
68154  Py_INCREF(arg2);
68155  PyTuple_SET_ITEM(args, 1, arg2);
68156  Py_INCREF(function);
68157  result = __Pyx_PyObject_Call(function, args, NULL);
68158  Py_DECREF(args);
68159  Py_DECREF(function);
68160 done:
68161  return result;
68162 }
68163 
68164 /* PyObjectCallMethO */
68165 #if CYTHON_COMPILING_IN_CPYTHON
68166 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
68167  PyObject *self, *result;
68168  PyCFunction cfunc;
68169  cfunc = PyCFunction_GET_FUNCTION(func);
68170  self = PyCFunction_GET_SELF(func);
68171  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
68172  return NULL;
68173  result = cfunc(self, arg);
68174  Py_LeaveRecursiveCall();
68175  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
68176  PyErr_SetString(
68177  PyExc_SystemError,
68178  "NULL result without error in PyObject_Call");
68179  }
68180  return result;
68181 }
68182 #endif
68183 
68184 /* PyObjectCallOneArg */
68185 #if CYTHON_COMPILING_IN_CPYTHON
68186 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
68187  PyObject *result;
68188  PyObject *args = PyTuple_New(1);
68189  if (unlikely(!args)) return NULL;
68190  Py_INCREF(arg);
68191  PyTuple_SET_ITEM(args, 0, arg);
68192  result = __Pyx_PyObject_Call(func, args, NULL);
68193  Py_DECREF(args);
68194  return result;
68195 }
68196 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
68197 #if CYTHON_FAST_PYCALL
68198  if (PyFunction_Check(func)) {
68199  return __Pyx_PyFunction_FastCall(func, &arg, 1);
68200  }
68201 #endif
68202  if (likely(PyCFunction_Check(func))) {
68203  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
68204  return __Pyx_PyObject_CallMethO(func, arg);
68205 #if CYTHON_FAST_PYCCALL
68206  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
68207  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
68208 #endif
68209  }
68210  }
68211  return __Pyx__PyObject_CallOneArg(func, arg);
68212 }
68213 #else
68214 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
68215  PyObject *result;
68216  PyObject *args = PyTuple_Pack(1, arg);
68217  if (unlikely(!args)) return NULL;
68218  result = __Pyx_PyObject_Call(func, args, NULL);
68219  Py_DECREF(args);
68220  return result;
68221 }
68222 #endif
68223 
68224 /* None */
68225 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
68226  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
68227 }
68228 
68229 /* GetItemInt */
68230 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
68231  PyObject *r;
68232  if (!j) return NULL;
68233  r = PyObject_GetItem(o, j);
68234  Py_DECREF(j);
68235  return r;
68236 }
68237 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
68238  CYTHON_NCP_UNUSED int wraparound,
68239  CYTHON_NCP_UNUSED int boundscheck) {
68240 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
68241  Py_ssize_t wrapped_i = i;
68242  if (wraparound & unlikely(i < 0)) {
68243  wrapped_i += PyList_GET_SIZE(o);
68244  }
68245  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
68246  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
68247  Py_INCREF(r);
68248  return r;
68249  }
68250  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
68251 #else
68252  return PySequence_GetItem(o, i);
68253 #endif
68254 }
68255 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
68256  CYTHON_NCP_UNUSED int wraparound,
68257  CYTHON_NCP_UNUSED int boundscheck) {
68258 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
68259  Py_ssize_t wrapped_i = i;
68260  if (wraparound & unlikely(i < 0)) {
68261  wrapped_i += PyTuple_GET_SIZE(o);
68262  }
68263  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
68264  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
68265  Py_INCREF(r);
68266  return r;
68267  }
68268  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
68269 #else
68270  return PySequence_GetItem(o, i);
68271 #endif
68272 }
68273 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
68274  CYTHON_NCP_UNUSED int wraparound,
68275  CYTHON_NCP_UNUSED int boundscheck) {
68276 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
68277  if (is_list || PyList_CheckExact(o)) {
68278  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
68279  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
68280  PyObject *r = PyList_GET_ITEM(o, n);
68281  Py_INCREF(r);
68282  return r;
68283  }
68284  }
68285  else if (PyTuple_CheckExact(o)) {
68286  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
68287  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
68288  PyObject *r = PyTuple_GET_ITEM(o, n);
68289  Py_INCREF(r);
68290  return r;
68291  }
68292  } else {
68293  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
68294  if (likely(m && m->sq_item)) {
68295  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
68296  Py_ssize_t l = m->sq_length(o);
68297  if (likely(l >= 0)) {
68298  i += l;
68299  } else {
68300  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
68301  return NULL;
68302  PyErr_Clear();
68303  }
68304  }
68305  return m->sq_item(o, i);
68306  }
68307  }
68308 #else
68309  if (is_list || PySequence_Check(o)) {
68310  return PySequence_GetItem(o, i);
68311  }
68312 #endif
68313  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
68314 }
68315 
68316 /* py_abs */
68317 #if CYTHON_USE_PYLONG_INTERNALS
68318 static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
68319  if (likely(Py_SIZE(n) == -1)) {
68320  return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
68321  }
68322 #if CYTHON_COMPILING_IN_CPYTHON
68323  {
68324  PyObject *copy = _PyLong_Copy((PyLongObject*)n);
68325  if (likely(copy)) {
68326  Py_SIZE(copy) = -(Py_SIZE(copy));
68327  }
68328  return copy;
68329  }
68330 #else
68331  return PyNumber_Negative(n);
68332 #endif
68333 }
68334 #endif
68335 
68336 /* SliceObject */
68337 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
68338  Py_ssize_t cstart, Py_ssize_t cstop,
68339  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
68340  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
68341 #if CYTHON_USE_TYPE_SLOTS
68342  PyMappingMethods* mp;
68343 #if PY_MAJOR_VERSION < 3
68344  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
68345  if (likely(ms && ms->sq_slice)) {
68346  if (!has_cstart) {
68347  if (_py_start && (*_py_start != Py_None)) {
68348  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
68349  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
68350  } else
68351  cstart = 0;
68352  }
68353  if (!has_cstop) {
68354  if (_py_stop && (*_py_stop != Py_None)) {
68355  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
68356  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
68357  } else
68358  cstop = PY_SSIZE_T_MAX;
68359  }
68360  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
68361  Py_ssize_t l = ms->sq_length(obj);
68362  if (likely(l >= 0)) {
68363  if (cstop < 0) {
68364  cstop += l;
68365  if (cstop < 0) cstop = 0;
68366  }
68367  if (cstart < 0) {
68368  cstart += l;
68369  if (cstart < 0) cstart = 0;
68370  }
68371  } else {
68372  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
68373  goto bad;
68374  PyErr_Clear();
68375  }
68376  }
68377  return ms->sq_slice(obj, cstart, cstop);
68378  }
68379 #endif
68380  mp = Py_TYPE(obj)->tp_as_mapping;
68381  if (likely(mp && mp->mp_subscript))
68382 #endif
68383  {
68384  PyObject* result;
68385  PyObject *py_slice, *py_start, *py_stop;
68386  if (_py_slice) {
68387  py_slice = *_py_slice;
68388  } else {
68389  PyObject* owned_start = NULL;
68390  PyObject* owned_stop = NULL;
68391  if (_py_start) {
68392  py_start = *_py_start;
68393  } else {
68394  if (has_cstart) {
68395  owned_start = py_start = PyInt_FromSsize_t(cstart);
68396  if (unlikely(!py_start)) goto bad;
68397  } else
68398  py_start = Py_None;
68399  }
68400  if (_py_stop) {
68401  py_stop = *_py_stop;
68402  } else {
68403  if (has_cstop) {
68404  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
68405  if (unlikely(!py_stop)) {
68406  Py_XDECREF(owned_start);
68407  goto bad;
68408  }
68409  } else
68410  py_stop = Py_None;
68411  }
68412  py_slice = PySlice_New(py_start, py_stop, Py_None);
68413  Py_XDECREF(owned_start);
68414  Py_XDECREF(owned_stop);
68415  if (unlikely(!py_slice)) goto bad;
68416  }
68417 #if CYTHON_USE_TYPE_SLOTS
68418  result = mp->mp_subscript(obj, py_slice);
68419 #else
68420  result = PyObject_GetItem(obj, py_slice);
68421 #endif
68422  if (!_py_slice) {
68423  Py_DECREF(py_slice);
68424  }
68425  return result;
68426  }
68427  PyErr_Format(PyExc_TypeError,
68428  "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
68429 bad:
68430  return NULL;
68431 }
68432 
68433 /* PyObjectCallNoArg */
68434 #if CYTHON_COMPILING_IN_CPYTHON
68435 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
68436 #if CYTHON_FAST_PYCALL
68437  if (PyFunction_Check(func)) {
68438  return __Pyx_PyFunction_FastCall(func, NULL, 0);
68439  }
68440 #endif
68441 #ifdef __Pyx_CyFunction_USED
68442  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
68443 #else
68444  if (likely(PyCFunction_Check(func)))
68445 #endif
68446  {
68447  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
68448  return __Pyx_PyObject_CallMethO(func, NULL);
68449  }
68450  }
68451  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
68452 }
68453 #endif
68454 
68455 /* ObjectGetItem */
68456 #if CYTHON_USE_TYPE_SLOTS
68457 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
68458  PyObject *runerr;
68459  Py_ssize_t key_value;
68460  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
68461  if (unlikely(!(m && m->sq_item))) {
68462  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
68463  return NULL;
68464  }
68465  key_value = __Pyx_PyIndex_AsSsize_t(index);
68466  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
68467  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
68468  }
68469  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
68470  PyErr_Clear();
68471  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
68472  }
68473  return NULL;
68474 }
68475 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
68476  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
68477  if (likely(m && m->mp_subscript)) {
68478  return m->mp_subscript(obj, key);
68479  }
68480  return __Pyx_PyObject_GetIndex(obj, key);
68481 }
68482 #endif
68483 
68484 /* PyFloatBinop */
68485 #if !CYTHON_COMPILING_IN_PYPY
68486 static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
68487  const double a = floatval;
68488  double b, result;
68489  if (likely(PyFloat_CheckExact(op2))) {
68490  b = PyFloat_AS_DOUBLE(op2);
68491  } else
68492  #if PY_MAJOR_VERSION < 3
68493  if (likely(PyInt_CheckExact(op2))) {
68494  b = (double) PyInt_AS_LONG(op2);
68495  } else
68496  #endif
68497  if (likely(PyLong_CheckExact(op2))) {
68498  #if CYTHON_USE_PYLONG_INTERNALS
68499  const digit* digits = ((PyLongObject*)op2)->ob_digit;
68500  const Py_ssize_t size = Py_SIZE(op2);
68501  switch (size) {
68502  case 0: b = 0.0; break;
68503  case -1: b = -(double) digits[0]; break;
68504  case 1: b = (double) digits[0]; break;
68505  case -2:
68506  case 2:
68507  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
68508  b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68509  if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
68510  if (size == -2)
68511  b = -b;
68512  break;
68513  }
68514  }
68515  CYTHON_FALLTHROUGH;
68516  case -3:
68517  case 3:
68518  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
68519  b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68520  if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
68521  if (size == -3)
68522  b = -b;
68523  break;
68524  }
68525  }
68526  CYTHON_FALLTHROUGH;
68527  case -4:
68528  case 4:
68529  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
68530  b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68531  if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
68532  if (size == -4)
68533  b = -b;
68534  break;
68535  }
68536  }
68537  CYTHON_FALLTHROUGH;
68538  default:
68539  #else
68540  {
68541  #endif
68542  b = PyLong_AsDouble(op2);
68543  if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
68544  }
68545  } else {
68546  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
68547  }
68548  PyFPE_START_PROTECT("add", return NULL)
68549  result = a + b;
68550  PyFPE_END_PROTECT(result)
68551  return PyFloat_FromDouble(result);
68552 }
68553 #endif
68554 
68555 /* PyFloatBinop */
68556  #if !CYTHON_COMPILING_IN_PYPY
68557 static PyObject* __Pyx_PyFloat_SubtractObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
68558  const double b = floatval;
68559  double a, result;
68560  if (likely(PyFloat_CheckExact(op1))) {
68561  a = PyFloat_AS_DOUBLE(op1);
68562  } else
68563  #if PY_MAJOR_VERSION < 3
68564  if (likely(PyInt_CheckExact(op1))) {
68565  a = (double) PyInt_AS_LONG(op1);
68566  } else
68567  #endif
68568  if (likely(PyLong_CheckExact(op1))) {
68569  #if CYTHON_USE_PYLONG_INTERNALS
68570  const digit* digits = ((PyLongObject*)op1)->ob_digit;
68571  const Py_ssize_t size = Py_SIZE(op1);
68572  switch (size) {
68573  case 0: a = 0.0; break;
68574  case -1: a = -(double) digits[0]; break;
68575  case 1: a = (double) digits[0]; break;
68576  case -2:
68577  case 2:
68578  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
68579  a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68580  if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
68581  if (size == -2)
68582  a = -a;
68583  break;
68584  }
68585  }
68586  CYTHON_FALLTHROUGH;
68587  case -3:
68588  case 3:
68589  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
68590  a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68591  if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
68592  if (size == -3)
68593  a = -a;
68594  break;
68595  }
68596  }
68597  CYTHON_FALLTHROUGH;
68598  case -4:
68599  case 4:
68600  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
68601  a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68602  if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
68603  if (size == -4)
68604  a = -a;
68605  break;
68606  }
68607  }
68608  CYTHON_FALLTHROUGH;
68609  default:
68610  #else
68611  {
68612  #endif
68613  a = PyLong_AsDouble(op1);
68614  if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
68615  }
68616  } else {
68617  return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
68618  }
68619  PyFPE_START_PROTECT("subtract", return NULL)
68620  result = a - b;
68621  PyFPE_END_PROTECT(result)
68622  return PyFloat_FromDouble(result);
68623 }
68624 #endif
68625 
68626 /* SliceObject */
68627  static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
68628  Py_ssize_t cstart, Py_ssize_t cstop,
68629  PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
68630  int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
68631 #if CYTHON_USE_TYPE_SLOTS
68632  PyMappingMethods* mp;
68633 #if PY_MAJOR_VERSION < 3
68634  PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
68635  if (likely(ms && ms->sq_ass_slice)) {
68636  if (!has_cstart) {
68637  if (_py_start && (*_py_start != Py_None)) {
68638  cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
68639  if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
68640  } else
68641  cstart = 0;
68642  }
68643  if (!has_cstop) {
68644  if (_py_stop && (*_py_stop != Py_None)) {
68645  cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
68646  if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
68647  } else
68648  cstop = PY_SSIZE_T_MAX;
68649  }
68650  if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
68651  Py_ssize_t l = ms->sq_length(obj);
68652  if (likely(l >= 0)) {
68653  if (cstop < 0) {
68654  cstop += l;
68655  if (cstop < 0) cstop = 0;
68656  }
68657  if (cstart < 0) {
68658  cstart += l;
68659  if (cstart < 0) cstart = 0;
68660  }
68661  } else {
68662  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
68663  goto bad;
68664  PyErr_Clear();
68665  }
68666  }
68667  return ms->sq_ass_slice(obj, cstart, cstop, value);
68668  }
68669 #endif
68670  mp = Py_TYPE(obj)->tp_as_mapping;
68671  if (likely(mp && mp->mp_ass_subscript))
68672 #endif
68673  {
68674  int result;
68675  PyObject *py_slice, *py_start, *py_stop;
68676  if (_py_slice) {
68677  py_slice = *_py_slice;
68678  } else {
68679  PyObject* owned_start = NULL;
68680  PyObject* owned_stop = NULL;
68681  if (_py_start) {
68682  py_start = *_py_start;
68683  } else {
68684  if (has_cstart) {
68685  owned_start = py_start = PyInt_FromSsize_t(cstart);
68686  if (unlikely(!py_start)) goto bad;
68687  } else
68688  py_start = Py_None;
68689  }
68690  if (_py_stop) {
68691  py_stop = *_py_stop;
68692  } else {
68693  if (has_cstop) {
68694  owned_stop = py_stop = PyInt_FromSsize_t(cstop);
68695  if (unlikely(!py_stop)) {
68696  Py_XDECREF(owned_start);
68697  goto bad;
68698  }
68699  } else
68700  py_stop = Py_None;
68701  }
68702  py_slice = PySlice_New(py_start, py_stop, Py_None);
68703  Py_XDECREF(owned_start);
68704  Py_XDECREF(owned_stop);
68705  if (unlikely(!py_slice)) goto bad;
68706  }
68707 #if CYTHON_USE_TYPE_SLOTS
68708  result = mp->mp_ass_subscript(obj, py_slice, value);
68709 #else
68710  result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
68711 #endif
68712  if (!_py_slice) {
68713  Py_DECREF(py_slice);
68714  }
68715  return result;
68716  }
68717  PyErr_Format(PyExc_TypeError,
68718  "'%.200s' object does not support slice %.10s",
68719  Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
68720 bad:
68721  return -1;
68722 }
68723 
68724 /* pyobject_as_double */
68725  static double __Pyx__PyObject_AsDouble(PyObject* obj) {
68726  PyObject* float_value;
68727 #if !CYTHON_USE_TYPE_SLOTS
68728  float_value = PyNumber_Float(obj); if ((0)) goto bad;
68729 #else
68730  PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
68731  if (likely(nb) && likely(nb->nb_float)) {
68732  float_value = nb->nb_float(obj);
68733  if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
68734  PyErr_Format(PyExc_TypeError,
68735  "__float__ returned non-float (type %.200s)",
68736  Py_TYPE(float_value)->tp_name);
68737  Py_DECREF(float_value);
68738  goto bad;
68739  }
68740  } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
68741 #if PY_MAJOR_VERSION >= 3
68742  float_value = PyFloat_FromString(obj);
68743 #else
68744  float_value = PyFloat_FromString(obj, 0);
68745 #endif
68746  } else {
68747  PyObject* args = PyTuple_New(1);
68748  if (unlikely(!args)) goto bad;
68749  PyTuple_SET_ITEM(args, 0, obj);
68750  float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
68751  PyTuple_SET_ITEM(args, 0, 0);
68752  Py_DECREF(args);
68753  }
68754 #endif
68755  if (likely(float_value)) {
68756  double value = PyFloat_AS_DOUBLE(float_value);
68757  Py_DECREF(float_value);
68758  return value;
68759  }
68760 bad:
68761  return (double)-1;
68762 }
68763 
68764 /* PyIntBinop */
68765  #if !CYTHON_COMPILING_IN_PYPY
68766 static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
68767  #if PY_MAJOR_VERSION < 3
68768  if (likely(PyInt_CheckExact(op1))) {
68769  const long b = intval;
68770  long x;
68771  long a = PyInt_AS_LONG(op1);
68772  x = (long)((unsigned long)a - b);
68773  if (likely((x^a) >= 0 || (x^~b) >= 0))
68774  return PyInt_FromLong(x);
68775  return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
68776  }
68777  #endif
68778  #if CYTHON_USE_PYLONG_INTERNALS
68779  if (likely(PyLong_CheckExact(op1))) {
68780  const long b = intval;
68781  long a, x;
68782 #ifdef HAVE_LONG_LONG
68783  const PY_LONG_LONG llb = intval;
68784  PY_LONG_LONG lla, llx;
68785 #endif
68786  const digit* digits = ((PyLongObject*)op1)->ob_digit;
68787  const Py_ssize_t size = Py_SIZE(op1);
68788  if (likely(__Pyx_sst_abs(size) <= 1)) {
68789  a = likely(size) ? digits[0] : 0;
68790  if (size == -1) a = -a;
68791  } else {
68792  switch (size) {
68793  case -2:
68794  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
68795  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68796  break;
68797 #ifdef HAVE_LONG_LONG
68798  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
68799  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68800  goto long_long;
68801 #endif
68802  }
68803  CYTHON_FALLTHROUGH;
68804  case 2:
68805  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
68806  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68807  break;
68808 #ifdef HAVE_LONG_LONG
68809  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
68810  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68811  goto long_long;
68812 #endif
68813  }
68814  CYTHON_FALLTHROUGH;
68815  case -3:
68816  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
68817  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68818  break;
68819 #ifdef HAVE_LONG_LONG
68820  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
68821  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68822  goto long_long;
68823 #endif
68824  }
68825  CYTHON_FALLTHROUGH;
68826  case 3:
68827  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
68828  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68829  break;
68830 #ifdef HAVE_LONG_LONG
68831  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
68832  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68833  goto long_long;
68834 #endif
68835  }
68836  CYTHON_FALLTHROUGH;
68837  case -4:
68838  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
68839  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68840  break;
68841 #ifdef HAVE_LONG_LONG
68842  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
68843  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68844  goto long_long;
68845 #endif
68846  }
68847  CYTHON_FALLTHROUGH;
68848  case 4:
68849  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
68850  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
68851  break;
68852 #ifdef HAVE_LONG_LONG
68853  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
68854  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
68855  goto long_long;
68856 #endif
68857  }
68858  CYTHON_FALLTHROUGH;
68859  default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
68860  }
68861  }
68862  x = a - b;
68863  return PyLong_FromLong(x);
68864 #ifdef HAVE_LONG_LONG
68865  long_long:
68866  llx = lla - llb;
68867  return PyLong_FromLongLong(llx);
68868 #endif
68869 
68870 
68871  }
68872  #endif
68873  if (PyFloat_CheckExact(op1)) {
68874  const long b = intval;
68875  double a = PyFloat_AS_DOUBLE(op1);
68876  double result;
68877  PyFPE_START_PROTECT("subtract", return NULL)
68878  result = ((double)a) - (double)b;
68879  PyFPE_END_PROTECT(result)
68880  return PyFloat_FromDouble(result);
68881  }
68882  return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
68883 }
68884 #endif
68885 
68886 /* GetTopmostException */
68887  #if CYTHON_USE_EXC_INFO_STACK
68888 static _PyErr_StackItem *
68889 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
68890 {
68891  _PyErr_StackItem *exc_info = tstate->exc_info;
68892  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
68893  exc_info->previous_item != NULL)
68894  {
68895  exc_info = exc_info->previous_item;
68896  }
68897  return exc_info;
68898 }
68899 #endif
68900 
68901 /* SaveResetException */
68902  #if CYTHON_FAST_THREAD_STATE
68903 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
68904  #if CYTHON_USE_EXC_INFO_STACK
68905  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
68906  *type = exc_info->exc_type;
68907  *value = exc_info->exc_value;
68908  *tb = exc_info->exc_traceback;
68909  #else
68910  *type = tstate->exc_type;
68911  *value = tstate->exc_value;
68912  *tb = tstate->exc_traceback;
68913  #endif
68914  Py_XINCREF(*type);
68915  Py_XINCREF(*value);
68916  Py_XINCREF(*tb);
68917 }
68918 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
68919  PyObject *tmp_type, *tmp_value, *tmp_tb;
68920  #if CYTHON_USE_EXC_INFO_STACK
68921  _PyErr_StackItem *exc_info = tstate->exc_info;
68922  tmp_type = exc_info->exc_type;
68923  tmp_value = exc_info->exc_value;
68924  tmp_tb = exc_info->exc_traceback;
68925  exc_info->exc_type = type;
68926  exc_info->exc_value = value;
68927  exc_info->exc_traceback = tb;
68928  #else
68929  tmp_type = tstate->exc_type;
68930  tmp_value = tstate->exc_value;
68931  tmp_tb = tstate->exc_traceback;
68932  tstate->exc_type = type;
68933  tstate->exc_value = value;
68934  tstate->exc_traceback = tb;
68935  #endif
68936  Py_XDECREF(tmp_type);
68937  Py_XDECREF(tmp_value);
68938  Py_XDECREF(tmp_tb);
68939 }
68940 #endif
68941 
68942 /* GetException */
68943  #if CYTHON_FAST_THREAD_STATE
68944 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
68945 #else
68946 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
68947 #endif
68948 {
68949  PyObject *local_type, *local_value, *local_tb;
68950 #if CYTHON_FAST_THREAD_STATE
68951  PyObject *tmp_type, *tmp_value, *tmp_tb;
68952  local_type = tstate->curexc_type;
68953  local_value = tstate->curexc_value;
68954  local_tb = tstate->curexc_traceback;
68955  tstate->curexc_type = 0;
68956  tstate->curexc_value = 0;
68957  tstate->curexc_traceback = 0;
68958 #else
68959  PyErr_Fetch(&local_type, &local_value, &local_tb);
68960 #endif
68961  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
68962 #if CYTHON_FAST_THREAD_STATE
68963  if (unlikely(tstate->curexc_type))
68964 #else
68965  if (unlikely(PyErr_Occurred()))
68966 #endif
68967  goto bad;
68968  #if PY_MAJOR_VERSION >= 3
68969  if (local_tb) {
68970  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
68971  goto bad;
68972  }
68973  #endif
68974  Py_XINCREF(local_tb);
68975  Py_XINCREF(local_type);
68976  Py_XINCREF(local_value);
68977  *type = local_type;
68978  *value = local_value;
68979  *tb = local_tb;
68980 #if CYTHON_FAST_THREAD_STATE
68981  #if CYTHON_USE_EXC_INFO_STACK
68982  {
68983  _PyErr_StackItem *exc_info = tstate->exc_info;
68984  tmp_type = exc_info->exc_type;
68985  tmp_value = exc_info->exc_value;
68986  tmp_tb = exc_info->exc_traceback;
68987  exc_info->exc_type = local_type;
68988  exc_info->exc_value = local_value;
68989  exc_info->exc_traceback = local_tb;
68990  }
68991  #else
68992  tmp_type = tstate->exc_type;
68993  tmp_value = tstate->exc_value;
68994  tmp_tb = tstate->exc_traceback;
68995  tstate->exc_type = local_type;
68996  tstate->exc_value = local_value;
68997  tstate->exc_traceback = local_tb;
68998  #endif
68999  Py_XDECREF(tmp_type);
69000  Py_XDECREF(tmp_value);
69001  Py_XDECREF(tmp_tb);
69002 #else
69003  PyErr_SetExcInfo(local_type, local_value, local_tb);
69004 #endif
69005  return 0;
69006 bad:
69007  *type = 0;
69008  *value = 0;
69009  *tb = 0;
69010  Py_XDECREF(local_type);
69011  Py_XDECREF(local_value);
69012  Py_XDECREF(local_tb);
69013  return -1;
69014 }
69015 
69016 /* ExtTypeTest */
69017  static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
69018  if (unlikely(!type)) {
69019  PyErr_SetString(PyExc_SystemError, "Missing type object");
69020  return 0;
69021  }
69022  if (likely(__Pyx_TypeCheck(obj, type)))
69023  return 1;
69024  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
69025  Py_TYPE(obj)->tp_name, type->tp_name);
69026  return 0;
69027 }
69028 
69029 /* PyErrExceptionMatches */
69030  #if CYTHON_FAST_THREAD_STATE
69031 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
69032  Py_ssize_t i, n;
69033  n = PyTuple_GET_SIZE(tuple);
69034 #if PY_MAJOR_VERSION >= 3
69035  for (i=0; i<n; i++) {
69036  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
69037  }
69038 #endif
69039  for (i=0; i<n; i++) {
69040  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
69041  }
69042  return 0;
69043 }
69044 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
69045  PyObject *exc_type = tstate->curexc_type;
69046  if (exc_type == err) return 1;
69047  if (unlikely(!exc_type)) return 0;
69048  if (unlikely(PyTuple_Check(err)))
69049  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
69050  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
69051 }
69052 #endif
69053 
69054 /* PyErrFetchRestore */
69055  #if CYTHON_FAST_THREAD_STATE
69056 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
69057  PyObject *tmp_type, *tmp_value, *tmp_tb;
69058  tmp_type = tstate->curexc_type;
69059  tmp_value = tstate->curexc_value;
69060  tmp_tb = tstate->curexc_traceback;
69061  tstate->curexc_type = type;
69062  tstate->curexc_value = value;
69063  tstate->curexc_traceback = tb;
69064  Py_XDECREF(tmp_type);
69065  Py_XDECREF(tmp_value);
69066  Py_XDECREF(tmp_tb);
69067 }
69068 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
69069  *type = tstate->curexc_type;
69070  *value = tstate->curexc_value;
69071  *tb = tstate->curexc_traceback;
69072  tstate->curexc_type = 0;
69073  tstate->curexc_value = 0;
69074  tstate->curexc_traceback = 0;
69075 }
69076 #endif
69077 
69078 /* GetAttr */
69079  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
69080 #if CYTHON_USE_TYPE_SLOTS
69081 #if PY_MAJOR_VERSION >= 3
69082  if (likely(PyUnicode_Check(n)))
69083 #else
69084  if (likely(PyString_Check(n)))
69085 #endif
69086  return __Pyx_PyObject_GetAttrStr(o, n);
69087 #endif
69088  return PyObject_GetAttr(o, n);
69089 }
69090 
69091 /* GetAttr3 */
69092  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
69093  __Pyx_PyThreadState_declare
69094  __Pyx_PyThreadState_assign
69095  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
69096  return NULL;
69097  __Pyx_PyErr_Clear();
69098  Py_INCREF(d);
69099  return d;
69100 }
69101 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
69102  PyObject *r = __Pyx_GetAttr(o, n);
69103  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
69104 }
69105 
69106 /* PyFloatBinop */
69107  #if !CYTHON_COMPILING_IN_PYPY
69108 static PyObject* __Pyx_PyFloat_TrueDivideCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
69109  const double a = floatval;
69110  double b, result;
69111  if (likely(PyFloat_CheckExact(op2))) {
69112  b = PyFloat_AS_DOUBLE(op2);
69113  } else
69114  #if PY_MAJOR_VERSION < 3
69115  if (likely(PyInt_CheckExact(op2))) {
69116  b = (double) PyInt_AS_LONG(op2);
69117  } else
69118  #endif
69119  if (likely(PyLong_CheckExact(op2))) {
69120  #if CYTHON_USE_PYLONG_INTERNALS
69121  const digit* digits = ((PyLongObject*)op2)->ob_digit;
69122  const Py_ssize_t size = Py_SIZE(op2);
69123  switch (size) {
69124  case 0: b = 0.0; break;
69125  case -1: b = -(double) digits[0]; break;
69126  case 1: b = (double) digits[0]; break;
69127  case -2:
69128  case 2:
69129  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
69130  b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69131  if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
69132  if (size == -2)
69133  b = -b;
69134  break;
69135  }
69136  }
69137  CYTHON_FALLTHROUGH;
69138  case -3:
69139  case 3:
69140  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
69141  b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69142  if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
69143  if (size == -3)
69144  b = -b;
69145  break;
69146  }
69147  }
69148  CYTHON_FALLTHROUGH;
69149  case -4:
69150  case 4:
69151  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
69152  b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69153  if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
69154  if (size == -4)
69155  b = -b;
69156  break;
69157  }
69158  }
69159  CYTHON_FALLTHROUGH;
69160  default:
69161  #else
69162  {
69163  #endif
69164  b = PyLong_AsDouble(op2);
69165  if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
69166  }
69167  } else {
69168  return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
69169  }
69170  PyFPE_START_PROTECT("divide", return NULL)
69171  result = a / b;
69172  PyFPE_END_PROTECT(result)
69173  return PyFloat_FromDouble(result);
69174 }
69175 #endif
69176 
69177 /* BytesEquals */
69178  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
69179 #if CYTHON_COMPILING_IN_PYPY
69180  return PyObject_RichCompareBool(s1, s2, equals);
69181 #else
69182  if (s1 == s2) {
69183  return (equals == Py_EQ);
69184  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
69185  const char *ps1, *ps2;
69186  Py_ssize_t length = PyBytes_GET_SIZE(s1);
69187  if (length != PyBytes_GET_SIZE(s2))
69188  return (equals == Py_NE);
69189  ps1 = PyBytes_AS_STRING(s1);
69190  ps2 = PyBytes_AS_STRING(s2);
69191  if (ps1[0] != ps2[0]) {
69192  return (equals == Py_NE);
69193  } else if (length == 1) {
69194  return (equals == Py_EQ);
69195  } else {
69196  int result;
69197 #if CYTHON_USE_UNICODE_INTERNALS
69198  Py_hash_t hash1, hash2;
69199  hash1 = ((PyBytesObject*)s1)->ob_shash;
69200  hash2 = ((PyBytesObject*)s2)->ob_shash;
69201  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
69202  return (equals == Py_NE);
69203  }
69204 #endif
69205  result = memcmp(ps1, ps2, (size_t)length);
69206  return (equals == Py_EQ) ? (result == 0) : (result != 0);
69207  }
69208  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
69209  return (equals == Py_NE);
69210  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
69211  return (equals == Py_NE);
69212  } else {
69213  int result;
69214  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
69215  if (!py_result)
69216  return -1;
69217  result = __Pyx_PyObject_IsTrue(py_result);
69218  Py_DECREF(py_result);
69219  return result;
69220  }
69221 #endif
69222 }
69223 
69224 /* UnicodeEquals */
69225  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
69226 #if CYTHON_COMPILING_IN_PYPY
69227  return PyObject_RichCompareBool(s1, s2, equals);
69228 #else
69229 #if PY_MAJOR_VERSION < 3
69230  PyObject* owned_ref = NULL;
69231 #endif
69232  int s1_is_unicode, s2_is_unicode;
69233  if (s1 == s2) {
69234  goto return_eq;
69235  }
69236  s1_is_unicode = PyUnicode_CheckExact(s1);
69237  s2_is_unicode = PyUnicode_CheckExact(s2);
69238 #if PY_MAJOR_VERSION < 3
69239  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
69240  owned_ref = PyUnicode_FromObject(s2);
69241  if (unlikely(!owned_ref))
69242  return -1;
69243  s2 = owned_ref;
69244  s2_is_unicode = 1;
69245  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
69246  owned_ref = PyUnicode_FromObject(s1);
69247  if (unlikely(!owned_ref))
69248  return -1;
69249  s1 = owned_ref;
69250  s1_is_unicode = 1;
69251  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
69252  return __Pyx_PyBytes_Equals(s1, s2, equals);
69253  }
69254 #endif
69255  if (s1_is_unicode & s2_is_unicode) {
69256  Py_ssize_t length;
69257  int kind;
69258  void *data1, *data2;
69259  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
69260  return -1;
69261  length = __Pyx_PyUnicode_GET_LENGTH(s1);
69262  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
69263  goto return_ne;
69264  }
69265 #if CYTHON_USE_UNICODE_INTERNALS
69266  {
69267  Py_hash_t hash1, hash2;
69268  #if CYTHON_PEP393_ENABLED
69269  hash1 = ((PyASCIIObject*)s1)->hash;
69270  hash2 = ((PyASCIIObject*)s2)->hash;
69271  #else
69272  hash1 = ((PyUnicodeObject*)s1)->hash;
69273  hash2 = ((PyUnicodeObject*)s2)->hash;
69274  #endif
69275  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
69276  goto return_ne;
69277  }
69278  }
69279 #endif
69280  kind = __Pyx_PyUnicode_KIND(s1);
69281  if (kind != __Pyx_PyUnicode_KIND(s2)) {
69282  goto return_ne;
69283  }
69284  data1 = __Pyx_PyUnicode_DATA(s1);
69285  data2 = __Pyx_PyUnicode_DATA(s2);
69286  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
69287  goto return_ne;
69288  } else if (length == 1) {
69289  goto return_eq;
69290  } else {
69291  int result = memcmp(data1, data2, (size_t)(length * kind));
69292  #if PY_MAJOR_VERSION < 3
69293  Py_XDECREF(owned_ref);
69294  #endif
69295  return (equals == Py_EQ) ? (result == 0) : (result != 0);
69296  }
69297  } else if ((s1 == Py_None) & s2_is_unicode) {
69298  goto return_ne;
69299  } else if ((s2 == Py_None) & s1_is_unicode) {
69300  goto return_ne;
69301  } else {
69302  int result;
69303  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
69304  #if PY_MAJOR_VERSION < 3
69305  Py_XDECREF(owned_ref);
69306  #endif
69307  if (!py_result)
69308  return -1;
69309  result = __Pyx_PyObject_IsTrue(py_result);
69310  Py_DECREF(py_result);
69311  return result;
69312  }
69313 return_eq:
69314  #if PY_MAJOR_VERSION < 3
69315  Py_XDECREF(owned_ref);
69316  #endif
69317  return (equals == Py_EQ);
69318 return_ne:
69319  #if PY_MAJOR_VERSION < 3
69320  Py_XDECREF(owned_ref);
69321  #endif
69322  return (equals == Py_NE);
69323 #endif
69324 }
69325 
69326 /* PyFloatBinop */
69327  #if !CYTHON_COMPILING_IN_PYPY
69328 static PyObject* __Pyx_PyFloat_EqObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
69329  const double b = floatval;
69330  double a;
69331  if (op1 == op2) {
69332  Py_RETURN_TRUE;
69333  }
69334  if (likely(PyFloat_CheckExact(op1))) {
69335  a = PyFloat_AS_DOUBLE(op1);
69336  } else
69337  #if PY_MAJOR_VERSION < 3
69338  if (likely(PyInt_CheckExact(op1))) {
69339  a = (double) PyInt_AS_LONG(op1);
69340  } else
69341  #endif
69342  if (likely(PyLong_CheckExact(op1))) {
69343  #if CYTHON_USE_PYLONG_INTERNALS
69344  const digit* digits = ((PyLongObject*)op1)->ob_digit;
69345  const Py_ssize_t size = Py_SIZE(op1);
69346  switch (size) {
69347  case 0: a = 0.0; break;
69348  case -1: a = -(double) digits[0]; break;
69349  case 1: a = (double) digits[0]; break;
69350  case -2:
69351  case 2:
69352  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
69353  a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69354  if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
69355  if (size == -2)
69356  a = -a;
69357  break;
69358  }
69359  }
69360  CYTHON_FALLTHROUGH;
69361  case -3:
69362  case 3:
69363  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
69364  a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69365  if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
69366  if (size == -3)
69367  a = -a;
69368  break;
69369  }
69370  }
69371  CYTHON_FALLTHROUGH;
69372  case -4:
69373  case 4:
69374  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
69375  a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69376  if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
69377  if (size == -4)
69378  a = -a;
69379  break;
69380  }
69381  }
69382  CYTHON_FALLTHROUGH;
69383  default:
69384  #else
69385  {
69386  #endif
69387  return (
69388  PyFloat_Type.tp_richcompare(op2, op1, Py_EQ));
69389  }
69390  } else {
69391  return (
69392  PyObject_RichCompare(op1, op2, Py_EQ));
69393  }
69394  if (a == b) {
69395  Py_RETURN_TRUE;
69396  } else {
69397  Py_RETURN_FALSE;
69398  }
69399 }
69400 #endif
69401 
69402 /* PyIntBinop */
69403  #if !CYTHON_COMPILING_IN_PYPY
69404 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
69405  #if PY_MAJOR_VERSION < 3
69406  if (likely(PyInt_CheckExact(op1))) {
69407  const long b = intval;
69408  long x;
69409  long a = PyInt_AS_LONG(op1);
69410  x = (long)((unsigned long)a + b);
69411  if (likely((x^a) >= 0 || (x^b) >= 0))
69412  return PyInt_FromLong(x);
69413  return PyLong_Type.tp_as_number->nb_add(op1, op2);
69414  }
69415  #endif
69416  #if CYTHON_USE_PYLONG_INTERNALS
69417  if (likely(PyLong_CheckExact(op1))) {
69418  const long b = intval;
69419  long a, x;
69420 #ifdef HAVE_LONG_LONG
69421  const PY_LONG_LONG llb = intval;
69422  PY_LONG_LONG lla, llx;
69423 #endif
69424  const digit* digits = ((PyLongObject*)op1)->ob_digit;
69425  const Py_ssize_t size = Py_SIZE(op1);
69426  if (likely(__Pyx_sst_abs(size) <= 1)) {
69427  a = likely(size) ? digits[0] : 0;
69428  if (size == -1) a = -a;
69429  } else {
69430  switch (size) {
69431  case -2:
69432  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
69433  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69434  break;
69435 #ifdef HAVE_LONG_LONG
69436  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
69437  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69438  goto long_long;
69439 #endif
69440  }
69441  CYTHON_FALLTHROUGH;
69442  case 2:
69443  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
69444  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69445  break;
69446 #ifdef HAVE_LONG_LONG
69447  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
69448  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69449  goto long_long;
69450 #endif
69451  }
69452  CYTHON_FALLTHROUGH;
69453  case -3:
69454  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
69455  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69456  break;
69457 #ifdef HAVE_LONG_LONG
69458  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
69459  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69460  goto long_long;
69461 #endif
69462  }
69463  CYTHON_FALLTHROUGH;
69464  case 3:
69465  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
69466  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69467  break;
69468 #ifdef HAVE_LONG_LONG
69469  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
69470  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69471  goto long_long;
69472 #endif
69473  }
69474  CYTHON_FALLTHROUGH;
69475  case -4:
69476  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
69477  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69478  break;
69479 #ifdef HAVE_LONG_LONG
69480  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
69481  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69482  goto long_long;
69483 #endif
69484  }
69485  CYTHON_FALLTHROUGH;
69486  case 4:
69487  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
69488  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69489  break;
69490 #ifdef HAVE_LONG_LONG
69491  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
69492  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
69493  goto long_long;
69494 #endif
69495  }
69496  CYTHON_FALLTHROUGH;
69497  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
69498  }
69499  }
69500  x = a + b;
69501  return PyLong_FromLong(x);
69502 #ifdef HAVE_LONG_LONG
69503  long_long:
69504  llx = lla + llb;
69505  return PyLong_FromLongLong(llx);
69506 #endif
69507 
69508 
69509  }
69510  #endif
69511  if (PyFloat_CheckExact(op1)) {
69512  const long b = intval;
69513  double a = PyFloat_AS_DOUBLE(op1);
69514  double result;
69515  PyFPE_START_PROTECT("add", return NULL)
69516  result = ((double)a) + (double)b;
69517  PyFPE_END_PROTECT(result)
69518  return PyFloat_FromDouble(result);
69519  }
69520  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
69521 }
69522 #endif
69523 
69524 /* Import */
69525  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
69526  PyObject *empty_list = 0;
69527  PyObject *module = 0;
69528  PyObject *global_dict = 0;
69529  PyObject *empty_dict = 0;
69530  PyObject *list;
69531  #if PY_MAJOR_VERSION < 3
69532  PyObject *py_import;
69533  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
69534  if (!py_import)
69535  goto bad;
69536  #endif
69537  if (from_list)
69538  list = from_list;
69539  else {
69540  empty_list = PyList_New(0);
69541  if (!empty_list)
69542  goto bad;
69543  list = empty_list;
69544  }
69545  global_dict = PyModule_GetDict(__pyx_m);
69546  if (!global_dict)
69547  goto bad;
69548  empty_dict = PyDict_New();
69549  if (!empty_dict)
69550  goto bad;
69551  {
69552  #if PY_MAJOR_VERSION >= 3
69553  if (level == -1) {
69554  if (strchr(__Pyx_MODULE_NAME, '.')) {
69555  module = PyImport_ImportModuleLevelObject(
69556  name, global_dict, empty_dict, list, 1);
69557  if (!module) {
69558  if (!PyErr_ExceptionMatches(PyExc_ImportError))
69559  goto bad;
69560  PyErr_Clear();
69561  }
69562  }
69563  level = 0;
69564  }
69565  #endif
69566  if (!module) {
69567  #if PY_MAJOR_VERSION < 3
69568  PyObject *py_level = PyInt_FromLong(level);
69569  if (!py_level)
69570  goto bad;
69571  module = PyObject_CallFunctionObjArgs(py_import,
69572  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
69573  Py_DECREF(py_level);
69574  #else
69575  module = PyImport_ImportModuleLevelObject(
69576  name, global_dict, empty_dict, list, level);
69577  #endif
69578  }
69579  }
69580 bad:
69581  #if PY_MAJOR_VERSION < 3
69582  Py_XDECREF(py_import);
69583  #endif
69584  Py_XDECREF(empty_list);
69585  Py_XDECREF(empty_dict);
69586  return module;
69587 }
69588 
69589 /* ImportFrom */
69590  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
69591  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
69592  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
69593  PyErr_Format(PyExc_ImportError,
69594  #if PY_MAJOR_VERSION < 3
69595  "cannot import name %.230s", PyString_AS_STRING(name));
69596  #else
69597  "cannot import name %S", name);
69598  #endif
69599  }
69600  return value;
69601 }
69602 
69603 /* DictGetItem */
69604  #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
69605 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
69606  PyObject *value;
69607  value = PyDict_GetItemWithError(d, key);
69608  if (unlikely(!value)) {
69609  if (!PyErr_Occurred()) {
69610  if (unlikely(PyTuple_Check(key))) {
69611  PyObject* args = PyTuple_Pack(1, key);
69612  if (likely(args)) {
69613  PyErr_SetObject(PyExc_KeyError, args);
69614  Py_DECREF(args);
69615  }
69616  } else {
69617  PyErr_SetObject(PyExc_KeyError, key);
69618  }
69619  }
69620  return NULL;
69621  }
69622  Py_INCREF(value);
69623  return value;
69624 }
69625 #endif
69626 
69627 /* RaiseTooManyValuesToUnpack */
69628  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
69629  PyErr_Format(PyExc_ValueError,
69630  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
69631 }
69632 
69633 /* RaiseNeedMoreValuesToUnpack */
69634  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
69635  PyErr_Format(PyExc_ValueError,
69636  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
69637  index, (index == 1) ? "" : "s");
69638 }
69639 
69640 /* IterFinish */
69641  static CYTHON_INLINE int __Pyx_IterFinish(void) {
69642 #if CYTHON_FAST_THREAD_STATE
69643  PyThreadState *tstate = __Pyx_PyThreadState_Current;
69644  PyObject* exc_type = tstate->curexc_type;
69645  if (unlikely(exc_type)) {
69646  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
69647  PyObject *exc_value, *exc_tb;
69648  exc_value = tstate->curexc_value;
69649  exc_tb = tstate->curexc_traceback;
69650  tstate->curexc_type = 0;
69651  tstate->curexc_value = 0;
69652  tstate->curexc_traceback = 0;
69653  Py_DECREF(exc_type);
69654  Py_XDECREF(exc_value);
69655  Py_XDECREF(exc_tb);
69656  return 0;
69657  } else {
69658  return -1;
69659  }
69660  }
69661  return 0;
69662 #else
69663  if (unlikely(PyErr_Occurred())) {
69664  if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
69665  PyErr_Clear();
69666  return 0;
69667  } else {
69668  return -1;
69669  }
69670  }
69671  return 0;
69672 #endif
69673 }
69674 
69675 /* UnpackItemEndCheck */
69676  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
69677  if (unlikely(retval)) {
69678  Py_DECREF(retval);
69679  __Pyx_RaiseTooManyValuesError(expected);
69680  return -1;
69681  } else {
69682  return __Pyx_IterFinish();
69683  }
69684  return 0;
69685 }
69686 
69687 /* SetItemInt */
69688  static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
69689  int r;
69690  if (!j) return -1;
69691  r = PyObject_SetItem(o, j, v);
69692  Py_DECREF(j);
69693  return r;
69694 }
69695 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
69696  CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
69697 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
69698  if (is_list || PyList_CheckExact(o)) {
69699  Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
69700  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
69701  PyObject* old = PyList_GET_ITEM(o, n);
69702  Py_INCREF(v);
69703  PyList_SET_ITEM(o, n, v);
69704  Py_DECREF(old);
69705  return 1;
69706  }
69707  } else {
69708  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
69709  if (likely(m && m->sq_ass_item)) {
69710  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
69711  Py_ssize_t l = m->sq_length(o);
69712  if (likely(l >= 0)) {
69713  i += l;
69714  } else {
69715  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
69716  return -1;
69717  PyErr_Clear();
69718  }
69719  }
69720  return m->sq_ass_item(o, i, v);
69721  }
69722  }
69723 #else
69724 #if CYTHON_COMPILING_IN_PYPY
69725  if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
69726 #else
69727  if (is_list || PySequence_Check(o))
69728 #endif
69729  {
69730  return PySequence_SetItem(o, i, v);
69731  }
69732 #endif
69733  return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
69734 }
69735 
69736 /* RaiseException */
69737  #if PY_MAJOR_VERSION < 3
69738 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
69739  CYTHON_UNUSED PyObject *cause) {
69740  __Pyx_PyThreadState_declare
69741  Py_XINCREF(type);
69742  if (!value || value == Py_None)
69743  value = NULL;
69744  else
69745  Py_INCREF(value);
69746  if (!tb || tb == Py_None)
69747  tb = NULL;
69748  else {
69749  Py_INCREF(tb);
69750  if (!PyTraceBack_Check(tb)) {
69751  PyErr_SetString(PyExc_TypeError,
69752  "raise: arg 3 must be a traceback or None");
69753  goto raise_error;
69754  }
69755  }
69756  if (PyType_Check(type)) {
69757 #if CYTHON_COMPILING_IN_PYPY
69758  if (!value) {
69759  Py_INCREF(Py_None);
69760  value = Py_None;
69761  }
69762 #endif
69763  PyErr_NormalizeException(&type, &value, &tb);
69764  } else {
69765  if (value) {
69766  PyErr_SetString(PyExc_TypeError,
69767  "instance exception may not have a separate value");
69768  goto raise_error;
69769  }
69770  value = type;
69771  type = (PyObject*) Py_TYPE(type);
69772  Py_INCREF(type);
69773  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
69774  PyErr_SetString(PyExc_TypeError,
69775  "raise: exception class must be a subclass of BaseException");
69776  goto raise_error;
69777  }
69778  }
69779  __Pyx_PyThreadState_assign
69780  __Pyx_ErrRestore(type, value, tb);
69781  return;
69782 raise_error:
69783  Py_XDECREF(value);
69784  Py_XDECREF(type);
69785  Py_XDECREF(tb);
69786  return;
69787 }
69788 #else
69789 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
69790  PyObject* owned_instance = NULL;
69791  if (tb == Py_None) {
69792  tb = 0;
69793  } else if (tb && !PyTraceBack_Check(tb)) {
69794  PyErr_SetString(PyExc_TypeError,
69795  "raise: arg 3 must be a traceback or None");
69796  goto bad;
69797  }
69798  if (value == Py_None)
69799  value = 0;
69800  if (PyExceptionInstance_Check(type)) {
69801  if (value) {
69802  PyErr_SetString(PyExc_TypeError,
69803  "instance exception may not have a separate value");
69804  goto bad;
69805  }
69806  value = type;
69807  type = (PyObject*) Py_TYPE(value);
69808  } else if (PyExceptionClass_Check(type)) {
69809  PyObject *instance_class = NULL;
69810  if (value && PyExceptionInstance_Check(value)) {
69811  instance_class = (PyObject*) Py_TYPE(value);
69812  if (instance_class != type) {
69813  int is_subclass = PyObject_IsSubclass(instance_class, type);
69814  if (!is_subclass) {
69815  instance_class = NULL;
69816  } else if (unlikely(is_subclass == -1)) {
69817  goto bad;
69818  } else {
69819  type = instance_class;
69820  }
69821  }
69822  }
69823  if (!instance_class) {
69824  PyObject *args;
69825  if (!value)
69826  args = PyTuple_New(0);
69827  else if (PyTuple_Check(value)) {
69828  Py_INCREF(value);
69829  args = value;
69830  } else
69831  args = PyTuple_Pack(1, value);
69832  if (!args)
69833  goto bad;
69834  owned_instance = PyObject_Call(type, args, NULL);
69835  Py_DECREF(args);
69836  if (!owned_instance)
69837  goto bad;
69838  value = owned_instance;
69839  if (!PyExceptionInstance_Check(value)) {
69840  PyErr_Format(PyExc_TypeError,
69841  "calling %R should have returned an instance of "
69842  "BaseException, not %R",
69843  type, Py_TYPE(value));
69844  goto bad;
69845  }
69846  }
69847  } else {
69848  PyErr_SetString(PyExc_TypeError,
69849  "raise: exception class must be a subclass of BaseException");
69850  goto bad;
69851  }
69852  if (cause) {
69853  PyObject *fixed_cause;
69854  if (cause == Py_None) {
69855  fixed_cause = NULL;
69856  } else if (PyExceptionClass_Check(cause)) {
69857  fixed_cause = PyObject_CallObject(cause, NULL);
69858  if (fixed_cause == NULL)
69859  goto bad;
69860  } else if (PyExceptionInstance_Check(cause)) {
69861  fixed_cause = cause;
69862  Py_INCREF(fixed_cause);
69863  } else {
69864  PyErr_SetString(PyExc_TypeError,
69865  "exception causes must derive from "
69866  "BaseException");
69867  goto bad;
69868  }
69869  PyException_SetCause(value, fixed_cause);
69870  }
69871  PyErr_SetObject(type, value);
69872  if (tb) {
69873 #if CYTHON_COMPILING_IN_PYPY
69874  PyObject *tmp_type, *tmp_value, *tmp_tb;
69875  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
69876  Py_INCREF(tb);
69877  PyErr_Restore(tmp_type, tmp_value, tb);
69878  Py_XDECREF(tmp_tb);
69879 #else
69880  PyThreadState *tstate = __Pyx_PyThreadState_Current;
69881  PyObject* tmp_tb = tstate->curexc_traceback;
69882  if (tb != tmp_tb) {
69883  Py_INCREF(tb);
69884  tstate->curexc_traceback = tb;
69885  Py_XDECREF(tmp_tb);
69886  }
69887 #endif
69888  }
69889 bad:
69890  Py_XDECREF(owned_instance);
69891  return;
69892 }
69893 #endif
69894 
69895 /* None */
69896  static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
69897  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
69898 }
69899 
69900 /* PyFloatBinop */
69901  #if !CYTHON_COMPILING_IN_PYPY
69902 static PyObject* __Pyx_PyFloat_TrueDivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
69903  const double b = floatval;
69904  double a, result;
69905  if (likely(PyFloat_CheckExact(op1))) {
69906  a = PyFloat_AS_DOUBLE(op1);
69907  } else
69908  #if PY_MAJOR_VERSION < 3
69909  if (likely(PyInt_CheckExact(op1))) {
69910  a = (double) PyInt_AS_LONG(op1);
69911  } else
69912  #endif
69913  if (likely(PyLong_CheckExact(op1))) {
69914  #if CYTHON_USE_PYLONG_INTERNALS
69915  const digit* digits = ((PyLongObject*)op1)->ob_digit;
69916  const Py_ssize_t size = Py_SIZE(op1);
69917  switch (size) {
69918  case 0: a = 0.0; break;
69919  case -1: a = -(double) digits[0]; break;
69920  case 1: a = (double) digits[0]; break;
69921  case -2:
69922  case 2:
69923  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
69924  a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69925  if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
69926  if (size == -2)
69927  a = -a;
69928  break;
69929  }
69930  }
69931  CYTHON_FALLTHROUGH;
69932  case -3:
69933  case 3:
69934  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
69935  a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69936  if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
69937  if (size == -3)
69938  a = -a;
69939  break;
69940  }
69941  }
69942  CYTHON_FALLTHROUGH;
69943  case -4:
69944  case 4:
69945  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
69946  a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
69947  if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
69948  if (size == -4)
69949  a = -a;
69950  break;
69951  }
69952  }
69953  CYTHON_FALLTHROUGH;
69954  default:
69955  #else
69956  {
69957  #endif
69958  a = PyLong_AsDouble(op1);
69959  if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
69960  }
69961  } else {
69962  return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
69963  }
69964  PyFPE_START_PROTECT("divide", return NULL)
69965  result = a / b;
69966  PyFPE_END_PROTECT(result)
69967  return PyFloat_FromDouble(result);
69968 }
69969 #endif
69970 
69971 /* PyIntCompare */
69972  static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
69973  if (op1 == op2) {
69974  Py_RETURN_TRUE;
69975  }
69976  #if PY_MAJOR_VERSION < 3
69977  if (likely(PyInt_CheckExact(op1))) {
69978  const long b = intval;
69979  long a = PyInt_AS_LONG(op1);
69980  if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
69981  }
69982  #endif
69983  #if CYTHON_USE_PYLONG_INTERNALS
69984  if (likely(PyLong_CheckExact(op1))) {
69985  int unequal;
69986  unsigned long uintval;
69987  Py_ssize_t size = Py_SIZE(op1);
69988  const digit* digits = ((PyLongObject*)op1)->ob_digit;
69989  if (intval == 0) {
69990  if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
69991  } else if (intval < 0) {
69992  if (size >= 0)
69993  Py_RETURN_FALSE;
69994  intval = -intval;
69995  size = -size;
69996  } else {
69997  if (size <= 0)
69998  Py_RETURN_FALSE;
69999  }
70000  uintval = (unsigned long) intval;
70001 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
70002  if (uintval >> (PyLong_SHIFT * 4)) {
70003  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
70004  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
70005  } else
70006 #endif
70007 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
70008  if (uintval >> (PyLong_SHIFT * 3)) {
70009  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
70010  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
70011  } else
70012 #endif
70013 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
70014  if (uintval >> (PyLong_SHIFT * 2)) {
70015  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
70016  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
70017  } else
70018 #endif
70019 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
70020  if (uintval >> (PyLong_SHIFT * 1)) {
70021  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
70022  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
70023  } else
70024 #endif
70025  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
70026  if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
70027  }
70028  #endif
70029  if (PyFloat_CheckExact(op1)) {
70030  const long b = intval;
70031  double a = PyFloat_AS_DOUBLE(op1);
70032  if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
70033  }
70034  return (
70035  PyObject_RichCompare(op1, op2, Py_EQ));
70036 }
70037 
70038 /* PyObjectGetMethod */
70039  static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
70040  PyObject *attr;
70041 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
70042  PyTypeObject *tp = Py_TYPE(obj);
70043  PyObject *descr;
70044  descrgetfunc f = NULL;
70045  PyObject **dictptr, *dict;
70046  int meth_found = 0;
70047  assert (*method == NULL);
70048  if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
70049  attr = __Pyx_PyObject_GetAttrStr(obj, name);
70050  goto try_unpack;
70051  }
70052  if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
70053  return 0;
70054  }
70055  descr = _PyType_Lookup(tp, name);
70056  if (likely(descr != NULL)) {
70057  Py_INCREF(descr);
70058 #if PY_MAJOR_VERSION >= 3
70059  #ifdef __Pyx_CyFunction_USED
70060  if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
70061  #else
70062  if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
70063  #endif
70064 #else
70065  #ifdef __Pyx_CyFunction_USED
70066  if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
70067  #else
70068  if (likely(PyFunction_Check(descr)))
70069  #endif
70070 #endif
70071  {
70072  meth_found = 1;
70073  } else {
70074  f = Py_TYPE(descr)->tp_descr_get;
70075  if (f != NULL && PyDescr_IsData(descr)) {
70076  attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
70077  Py_DECREF(descr);
70078  goto try_unpack;
70079  }
70080  }
70081  }
70082  dictptr = _PyObject_GetDictPtr(obj);
70083  if (dictptr != NULL && (dict = *dictptr) != NULL) {
70084  Py_INCREF(dict);
70085  attr = __Pyx_PyDict_GetItemStr(dict, name);
70086  if (attr != NULL) {
70087  Py_INCREF(attr);
70088  Py_DECREF(dict);
70089  Py_XDECREF(descr);
70090  goto try_unpack;
70091  }
70092  Py_DECREF(dict);
70093  }
70094  if (meth_found) {
70095  *method = descr;
70096  return 1;
70097  }
70098  if (f != NULL) {
70099  attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
70100  Py_DECREF(descr);
70101  goto try_unpack;
70102  }
70103  if (descr != NULL) {
70104  *method = descr;
70105  return 0;
70106  }
70107  PyErr_Format(PyExc_AttributeError,
70108 #if PY_MAJOR_VERSION >= 3
70109  "'%.50s' object has no attribute '%U'",
70110  tp->tp_name, name);
70111 #else
70112  "'%.50s' object has no attribute '%.400s'",
70113  tp->tp_name, PyString_AS_STRING(name));
70114 #endif
70115  return 0;
70116 #else
70117  attr = __Pyx_PyObject_GetAttrStr(obj, name);
70118  goto try_unpack;
70119 #endif
70120 try_unpack:
70121 #if CYTHON_UNPACK_METHODS
70122  if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
70123  PyObject *function = PyMethod_GET_FUNCTION(attr);
70124  Py_INCREF(function);
70125  Py_DECREF(attr);
70126  *method = function;
70127  return 1;
70128  }
70129 #endif
70130  *method = attr;
70131  return 0;
70132 }
70133 
70134 /* PyObjectCallMethod1 */
70135  static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
70136  PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
70137  Py_DECREF(method);
70138  return result;
70139 }
70140 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
70141  PyObject *method = NULL, *result;
70142  int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
70143  if (likely(is_method)) {
70144  result = __Pyx_PyObject_Call2Args(method, obj, arg);
70145  Py_DECREF(method);
70146  return result;
70147  }
70148  if (unlikely(!method)) return NULL;
70149  return __Pyx__PyObject_CallMethod1(method, arg);
70150 }
70151 
70152 /* append */
70153  static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
70154  if (likely(PyList_CheckExact(L))) {
70155  if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
70156  } else {
70157  PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
70158  if (unlikely(!retval))
70159  return -1;
70160  Py_DECREF(retval);
70161  }
70162  return 0;
70163 }
70164 
70165 /* PyObjectSetAttrStr */
70166  #if CYTHON_USE_TYPE_SLOTS
70167 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
70168  PyTypeObject* tp = Py_TYPE(obj);
70169  if (likely(tp->tp_setattro))
70170  return tp->tp_setattro(obj, attr_name, value);
70171 #if PY_MAJOR_VERSION < 3
70172  if (likely(tp->tp_setattr))
70173  return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
70174 #endif
70175  return PyObject_SetAttr(obj, attr_name, value);
70176 }
70177 #endif
70178 
70179 /* HasAttr */
70180  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
70181  PyObject *r;
70182  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
70183  PyErr_SetString(PyExc_TypeError,
70184  "hasattr(): attribute name must be string");
70185  return -1;
70186  }
70187  r = __Pyx_GetAttr(o, n);
70188  if (unlikely(!r)) {
70189  PyErr_Clear();
70190  return 0;
70191  } else {
70192  Py_DECREF(r);
70193  return 1;
70194  }
70195 }
70196 
70197 /* RaiseNoneIterError */
70198  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
70199  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
70200 }
70201 
70202 /* PyObject_GenericGetAttrNoDict */
70203  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
70204 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
70205  PyErr_Format(PyExc_AttributeError,
70206 #if PY_MAJOR_VERSION >= 3
70207  "'%.50s' object has no attribute '%U'",
70208  tp->tp_name, attr_name);
70209 #else
70210  "'%.50s' object has no attribute '%.400s'",
70211  tp->tp_name, PyString_AS_STRING(attr_name));
70212 #endif
70213  return NULL;
70214 }
70215 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
70216  PyObject *descr;
70217  PyTypeObject *tp = Py_TYPE(obj);
70218  if (unlikely(!PyString_Check(attr_name))) {
70219  return PyObject_GenericGetAttr(obj, attr_name);
70220  }
70221  assert(!tp->tp_dictoffset);
70222  descr = _PyType_Lookup(tp, attr_name);
70223  if (unlikely(!descr)) {
70224  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
70225  }
70226  Py_INCREF(descr);
70227  #if PY_MAJOR_VERSION < 3
70228  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
70229  #endif
70230  {
70231  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
70232  if (unlikely(f)) {
70233  PyObject *res = f(descr, obj, (PyObject *)tp);
70234  Py_DECREF(descr);
70235  return res;
70236  }
70237  }
70238  return descr;
70239 }
70240 #endif
70241 
70242 /* PyObject_GenericGetAttr */
70243  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
70244 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
70245  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
70246  return PyObject_GenericGetAttr(obj, attr_name);
70247  }
70248  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
70249 }
70250 #endif
70251 
70252 /* SetupReduce */
70253  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
70254  int ret;
70255  PyObject *name_attr;
70256  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
70257  if (likely(name_attr)) {
70258  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
70259  } else {
70260  ret = -1;
70261  }
70262  if (unlikely(ret < 0)) {
70263  PyErr_Clear();
70264  ret = 0;
70265  }
70266  Py_XDECREF(name_attr);
70267  return ret;
70268 }
70269 static int __Pyx_setup_reduce(PyObject* type_obj) {
70270  int ret = 0;
70271  PyObject *object_reduce = NULL;
70272  PyObject *object_reduce_ex = NULL;
70273  PyObject *reduce = NULL;
70274  PyObject *reduce_ex = NULL;
70275  PyObject *reduce_cython = NULL;
70276  PyObject *setstate = NULL;
70277  PyObject *setstate_cython = NULL;
70278 #if CYTHON_USE_PYTYPE_LOOKUP
70279  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
70280 #else
70281  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
70282 #endif
70283 #if CYTHON_USE_PYTYPE_LOOKUP
70284  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
70285 #else
70286  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
70287 #endif
70288  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
70289  if (reduce_ex == object_reduce_ex) {
70290 #if CYTHON_USE_PYTYPE_LOOKUP
70291  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
70292 #else
70293  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
70294 #endif
70295  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
70296  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
70297  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
70298  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
70299  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
70300  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
70301  if (!setstate) PyErr_Clear();
70302  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
70303  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
70304  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
70305  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
70306  }
70307  PyType_Modified((PyTypeObject*)type_obj);
70308  }
70309  }
70310  goto GOOD;
70311 BAD:
70312  if (!PyErr_Occurred())
70313  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
70314  ret = -1;
70315 GOOD:
70316 #if !CYTHON_USE_PYTYPE_LOOKUP
70317  Py_XDECREF(object_reduce);
70318  Py_XDECREF(object_reduce_ex);
70319 #endif
70320  Py_XDECREF(reduce);
70321  Py_XDECREF(reduce_ex);
70322  Py_XDECREF(reduce_cython);
70323  Py_XDECREF(setstate);
70324  Py_XDECREF(setstate_cython);
70325  return ret;
70326 }
70327 
70328 /* SetVTable */
70329  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
70330 #if PY_VERSION_HEX >= 0x02070000
70331  PyObject *ob = PyCapsule_New(vtable, 0, 0);
70332 #else
70333  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
70334 #endif
70335  if (!ob)
70336  goto bad;
70337  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
70338  goto bad;
70339  Py_DECREF(ob);
70340  return 0;
70341 bad:
70342  Py_XDECREF(ob);
70343  return -1;
70344 }
70345 
70346 /* TypeImport */
70347  #ifndef __PYX_HAVE_RT_ImportType
70348 #define __PYX_HAVE_RT_ImportType
70349 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
70350  size_t size, enum __Pyx_ImportType_CheckSize check_size)
70351 {
70352  PyObject *result = 0;
70353  char warning[200];
70354  Py_ssize_t basicsize;
70355 #ifdef Py_LIMITED_API
70356  PyObject *py_basicsize;
70357 #endif
70358  result = PyObject_GetAttrString(module, class_name);
70359  if (!result)
70360  goto bad;
70361  if (!PyType_Check(result)) {
70362  PyErr_Format(PyExc_TypeError,
70363  "%.200s.%.200s is not a type object",
70364  module_name, class_name);
70365  goto bad;
70366  }
70367 #ifndef Py_LIMITED_API
70368  basicsize = ((PyTypeObject *)result)->tp_basicsize;
70369 #else
70370  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
70371  if (!py_basicsize)
70372  goto bad;
70373  basicsize = PyLong_AsSsize_t(py_basicsize);
70374  Py_DECREF(py_basicsize);
70375  py_basicsize = 0;
70376  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
70377  goto bad;
70378 #endif
70379  if ((size_t)basicsize < size) {
70380  PyErr_Format(PyExc_ValueError,
70381  "%.200s.%.200s size changed, may indicate binary incompatibility. "
70382  "Expected %zd from C header, got %zd from PyObject",
70383  module_name, class_name, size, basicsize);
70384  goto bad;
70385  }
70386  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
70387  PyErr_Format(PyExc_ValueError,
70388  "%.200s.%.200s size changed, may indicate binary incompatibility. "
70389  "Expected %zd from C header, got %zd from PyObject",
70390  module_name, class_name, size, basicsize);
70391  goto bad;
70392  }
70393  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
70394  PyOS_snprintf(warning, sizeof(warning),
70395  "%s.%s size changed, may indicate binary incompatibility. "
70396  "Expected %zd from C header, got %zd from PyObject",
70397  module_name, class_name, size, basicsize);
70398  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
70399  }
70400  return (PyTypeObject *)result;
70401 bad:
70402  Py_XDECREF(result);
70403  return NULL;
70404 }
70405 #endif
70406 
70407 /* FetchCommonType */
70408  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
70409  PyObject* fake_module;
70410  PyTypeObject* cached_type = NULL;
70411  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
70412  if (!fake_module) return NULL;
70413  Py_INCREF(fake_module);
70414  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
70415  if (cached_type) {
70416  if (!PyType_Check((PyObject*)cached_type)) {
70417  PyErr_Format(PyExc_TypeError,
70418  "Shared Cython type %.200s is not a type object",
70419  type->tp_name);
70420  goto bad;
70421  }
70422  if (cached_type->tp_basicsize != type->tp_basicsize) {
70423  PyErr_Format(PyExc_TypeError,
70424  "Shared Cython type %.200s has the wrong size, try recompiling",
70425  type->tp_name);
70426  goto bad;
70427  }
70428  } else {
70429  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
70430  PyErr_Clear();
70431  if (PyType_Ready(type) < 0) goto bad;
70432  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
70433  goto bad;
70434  Py_INCREF(type);
70435  cached_type = type;
70436  }
70437 done:
70438  Py_DECREF(fake_module);
70439  return cached_type;
70440 bad:
70441  Py_XDECREF(cached_type);
70442  cached_type = NULL;
70443  goto done;
70444 }
70445 
70446 /* CythonFunction */
70447  #include <structmember.h>
70448 static PyObject *
70449 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
70450 {
70451  if (unlikely(op->func_doc == NULL)) {
70452  if (op->func.m_ml->ml_doc) {
70453 #if PY_MAJOR_VERSION >= 3
70454  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
70455 #else
70456  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
70457 #endif
70458  if (unlikely(op->func_doc == NULL))
70459  return NULL;
70460  } else {
70461  Py_INCREF(Py_None);
70462  return Py_None;
70463  }
70464  }
70465  Py_INCREF(op->func_doc);
70466  return op->func_doc;
70467 }
70468 static int
70469 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
70470 {
70471  PyObject *tmp = op->func_doc;
70472  if (value == NULL) {
70473  value = Py_None;
70474  }
70475  Py_INCREF(value);
70476  op->func_doc = value;
70477  Py_XDECREF(tmp);
70478  return 0;
70479 }
70480 static PyObject *
70481 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
70482 {
70483  if (unlikely(op->func_name == NULL)) {
70484 #if PY_MAJOR_VERSION >= 3
70485  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
70486 #else
70487  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
70488 #endif
70489  if (unlikely(op->func_name == NULL))
70490  return NULL;
70491  }
70492  Py_INCREF(op->func_name);
70493  return op->func_name;
70494 }
70495 static int
70496 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
70497 {
70498  PyObject *tmp;
70499 #if PY_MAJOR_VERSION >= 3
70500  if (unlikely(value == NULL || !PyUnicode_Check(value)))
70501 #else
70502  if (unlikely(value == NULL || !PyString_Check(value)))
70503 #endif
70504  {
70505  PyErr_SetString(PyExc_TypeError,
70506  "__name__ must be set to a string object");
70507  return -1;
70508  }
70509  tmp = op->func_name;
70510  Py_INCREF(value);
70511  op->func_name = value;
70512  Py_XDECREF(tmp);
70513  return 0;
70514 }
70515 static PyObject *
70516 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
70517 {
70518  Py_INCREF(op->func_qualname);
70519  return op->func_qualname;
70520 }
70521 static int
70522 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
70523 {
70524  PyObject *tmp;
70525 #if PY_MAJOR_VERSION >= 3
70526  if (unlikely(value == NULL || !PyUnicode_Check(value)))
70527 #else
70528  if (unlikely(value == NULL || !PyString_Check(value)))
70529 #endif
70530  {
70531  PyErr_SetString(PyExc_TypeError,
70532  "__qualname__ must be set to a string object");
70533  return -1;
70534  }
70535  tmp = op->func_qualname;
70536  Py_INCREF(value);
70537  op->func_qualname = value;
70538  Py_XDECREF(tmp);
70539  return 0;
70540 }
70541 static PyObject *
70542 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
70543 {
70544  PyObject *self;
70545  self = m->func_closure;
70546  if (self == NULL)
70547  self = Py_None;
70548  Py_INCREF(self);
70549  return self;
70550 }
70551 static PyObject *
70552 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
70553 {
70554  if (unlikely(op->func_dict == NULL)) {
70555  op->func_dict = PyDict_New();
70556  if (unlikely(op->func_dict == NULL))
70557  return NULL;
70558  }
70559  Py_INCREF(op->func_dict);
70560  return op->func_dict;
70561 }
70562 static int
70563 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
70564 {
70565  PyObject *tmp;
70566  if (unlikely(value == NULL)) {
70567  PyErr_SetString(PyExc_TypeError,
70568  "function's dictionary may not be deleted");
70569  return -1;
70570  }
70571  if (unlikely(!PyDict_Check(value))) {
70572  PyErr_SetString(PyExc_TypeError,
70573  "setting function's dictionary to a non-dict");
70574  return -1;
70575  }
70576  tmp = op->func_dict;
70577  Py_INCREF(value);
70578  op->func_dict = value;
70579  Py_XDECREF(tmp);
70580  return 0;
70581 }
70582 static PyObject *
70583 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
70584 {
70585  Py_INCREF(op->func_globals);
70586  return op->func_globals;
70587 }
70588 static PyObject *
70589 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
70590 {
70591  Py_INCREF(Py_None);
70592  return Py_None;
70593 }
70594 static PyObject *
70595 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
70596 {
70597  PyObject* result = (op->func_code) ? op->func_code : Py_None;
70598  Py_INCREF(result);
70599  return result;
70600 }
70601 static int
70602 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
70603  int result = 0;
70604  PyObject *res = op->defaults_getter((PyObject *) op);
70605  if (unlikely(!res))
70606  return -1;
70607  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
70608  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
70609  Py_INCREF(op->defaults_tuple);
70610  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
70611  Py_INCREF(op->defaults_kwdict);
70612  #else
70613  op->defaults_tuple = PySequence_ITEM(res, 0);
70614  if (unlikely(!op->defaults_tuple)) result = -1;
70615  else {
70616  op->defaults_kwdict = PySequence_ITEM(res, 1);
70617  if (unlikely(!op->defaults_kwdict)) result = -1;
70618  }
70619  #endif
70620  Py_DECREF(res);
70621  return result;
70622 }
70623 static int
70624 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
70625  PyObject* tmp;
70626  if (!value) {
70627  value = Py_None;
70628  } else if (value != Py_None && !PyTuple_Check(value)) {
70629  PyErr_SetString(PyExc_TypeError,
70630  "__defaults__ must be set to a tuple object");
70631  return -1;
70632  }
70633  Py_INCREF(value);
70634  tmp = op->defaults_tuple;
70635  op->defaults_tuple = value;
70636  Py_XDECREF(tmp);
70637  return 0;
70638 }
70639 static PyObject *
70640 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
70641  PyObject* result = op->defaults_tuple;
70642  if (unlikely(!result)) {
70643  if (op->defaults_getter) {
70644  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
70645  result = op->defaults_tuple;
70646  } else {
70647  result = Py_None;
70648  }
70649  }
70650  Py_INCREF(result);
70651  return result;
70652 }
70653 static int
70654 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
70655  PyObject* tmp;
70656  if (!value) {
70657  value = Py_None;
70658  } else if (value != Py_None && !PyDict_Check(value)) {
70659  PyErr_SetString(PyExc_TypeError,
70660  "__kwdefaults__ must be set to a dict object");
70661  return -1;
70662  }
70663  Py_INCREF(value);
70664  tmp = op->defaults_kwdict;
70665  op->defaults_kwdict = value;
70666  Py_XDECREF(tmp);
70667  return 0;
70668 }
70669 static PyObject *
70670 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
70671  PyObject* result = op->defaults_kwdict;
70672  if (unlikely(!result)) {
70673  if (op->defaults_getter) {
70674  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
70675  result = op->defaults_kwdict;
70676  } else {
70677  result = Py_None;
70678  }
70679  }
70680  Py_INCREF(result);
70681  return result;
70682 }
70683 static int
70684 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
70685  PyObject* tmp;
70686  if (!value || value == Py_None) {
70687  value = NULL;
70688  } else if (!PyDict_Check(value)) {
70689  PyErr_SetString(PyExc_TypeError,
70690  "__annotations__ must be set to a dict object");
70691  return -1;
70692  }
70693  Py_XINCREF(value);
70694  tmp = op->func_annotations;
70695  op->func_annotations = value;
70696  Py_XDECREF(tmp);
70697  return 0;
70698 }
70699 static PyObject *
70700 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
70701  PyObject* result = op->func_annotations;
70702  if (unlikely(!result)) {
70703  result = PyDict_New();
70704  if (unlikely(!result)) return NULL;
70705  op->func_annotations = result;
70706  }
70707  Py_INCREF(result);
70708  return result;
70709 }
70710 static PyGetSetDef __pyx_CyFunction_getsets[] = {
70711  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
70712  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
70713  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
70714  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
70715  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
70716  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
70717  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
70718  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
70719  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
70720  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
70721  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
70722  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
70723  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
70724  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
70725  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
70726  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
70727  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
70728  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
70729  {0, 0, 0, 0, 0}
70730 };
70731 static PyMemberDef __pyx_CyFunction_members[] = {
70732  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
70733  {0, 0, 0, 0, 0}
70734 };
70735 static PyObject *
70736 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
70737 {
70738 #if PY_MAJOR_VERSION >= 3
70739  return PyUnicode_FromString(m->func.m_ml->ml_name);
70740 #else
70741  return PyString_FromString(m->func.m_ml->ml_name);
70742 #endif
70743 }
70744 static PyMethodDef __pyx_CyFunction_methods[] = {
70745  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
70746  {0, 0, 0, 0}
70747 };
70748 #if PY_VERSION_HEX < 0x030500A0
70749 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
70750 #else
70751 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
70752 #endif
70753 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
70754  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
70755  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
70756  if (op == NULL)
70757  return NULL;
70758  op->flags = flags;
70759  __Pyx_CyFunction_weakreflist(op) = NULL;
70760  op->func.m_ml = ml;
70761  op->func.m_self = (PyObject *) op;
70762  Py_XINCREF(closure);
70763  op->func_closure = closure;
70764  Py_XINCREF(module);
70765  op->func.m_module = module;
70766  op->func_dict = NULL;
70767  op->func_name = NULL;
70768  Py_INCREF(qualname);
70769  op->func_qualname = qualname;
70770  op->func_doc = NULL;
70771  op->func_classobj = NULL;
70772  op->func_globals = globals;
70773  Py_INCREF(op->func_globals);
70774  Py_XINCREF(code);
70775  op->func_code = code;
70776  op->defaults_pyobjects = 0;
70777  op->defaults = NULL;
70778  op->defaults_tuple = NULL;
70779  op->defaults_kwdict = NULL;
70780  op->defaults_getter = NULL;
70781  op->func_annotations = NULL;
70782  PyObject_GC_Track(op);
70783  return (PyObject *) op;
70784 }
70785 static int
70786 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
70787 {
70788  Py_CLEAR(m->func_closure);
70789  Py_CLEAR(m->func.m_module);
70790  Py_CLEAR(m->func_dict);
70791  Py_CLEAR(m->func_name);
70792  Py_CLEAR(m->func_qualname);
70793  Py_CLEAR(m->func_doc);
70794  Py_CLEAR(m->func_globals);
70795  Py_CLEAR(m->func_code);
70796  Py_CLEAR(m->func_classobj);
70797  Py_CLEAR(m->defaults_tuple);
70798  Py_CLEAR(m->defaults_kwdict);
70799  Py_CLEAR(m->func_annotations);
70800  if (m->defaults) {
70801  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
70802  int i;
70803  for (i = 0; i < m->defaults_pyobjects; i++)
70804  Py_XDECREF(pydefaults[i]);
70805  PyObject_Free(m->defaults);
70806  m->defaults = NULL;
70807  }
70808  return 0;
70809 }
70810 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
70811 {
70812  if (__Pyx_CyFunction_weakreflist(m) != NULL)
70813  PyObject_ClearWeakRefs((PyObject *) m);
70814  __Pyx_CyFunction_clear(m);
70815  PyObject_GC_Del(m);
70816 }
70817 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
70818 {
70819  PyObject_GC_UnTrack(m);
70820  __Pyx__CyFunction_dealloc(m);
70821 }
70822 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
70823 {
70824  Py_VISIT(m->func_closure);
70825  Py_VISIT(m->func.m_module);
70826  Py_VISIT(m->func_dict);
70827  Py_VISIT(m->func_name);
70828  Py_VISIT(m->func_qualname);
70829  Py_VISIT(m->func_doc);
70830  Py_VISIT(m->func_globals);
70831  Py_VISIT(m->func_code);
70832  Py_VISIT(m->func_classobj);
70833  Py_VISIT(m->defaults_tuple);
70834  Py_VISIT(m->defaults_kwdict);
70835  if (m->defaults) {
70836  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
70837  int i;
70838  for (i = 0; i < m->defaults_pyobjects; i++)
70839  Py_VISIT(pydefaults[i]);
70840  }
70841  return 0;
70842 }
70843 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
70844 {
70845  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
70846  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
70847  Py_INCREF(func);
70848  return func;
70849  }
70850  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
70851  if (type == NULL)
70852  type = (PyObject *)(Py_TYPE(obj));
70853  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
70854  }
70855  if (obj == Py_None)
70856  obj = NULL;
70857  return __Pyx_PyMethod_New(func, obj, type);
70858 }
70859 static PyObject*
70860 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
70861 {
70862 #if PY_MAJOR_VERSION >= 3
70863  return PyUnicode_FromFormat("<cyfunction %U at %p>",
70864  op->func_qualname, (void *)op);
70865 #else
70866  return PyString_FromFormat("<cyfunction %s at %p>",
70867  PyString_AsString(op->func_qualname), (void *)op);
70868 #endif
70869 }
70870 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
70871  PyCFunctionObject* f = (PyCFunctionObject*)func;
70872  PyCFunction meth = f->m_ml->ml_meth;
70873  Py_ssize_t size;
70874  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
70875  case METH_VARARGS:
70876  if (likely(kw == NULL || PyDict_Size(kw) == 0))
70877  return (*meth)(self, arg);
70878  break;
70879  case METH_VARARGS | METH_KEYWORDS:
70880  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
70881  case METH_NOARGS:
70882  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
70883  size = PyTuple_GET_SIZE(arg);
70884  if (likely(size == 0))
70885  return (*meth)(self, NULL);
70886  PyErr_Format(PyExc_TypeError,
70887  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
70888  f->m_ml->ml_name, size);
70889  return NULL;
70890  }
70891  break;
70892  case METH_O:
70893  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
70894  size = PyTuple_GET_SIZE(arg);
70895  if (likely(size == 1)) {
70896  PyObject *result, *arg0;
70897  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
70898  arg0 = PyTuple_GET_ITEM(arg, 0);
70899  #else
70900  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
70901  #endif
70902  result = (*meth)(self, arg0);
70903  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
70904  Py_DECREF(arg0);
70905  #endif
70906  return result;
70907  }
70908  PyErr_Format(PyExc_TypeError,
70909  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
70910  f->m_ml->ml_name, size);
70911  return NULL;
70912  }
70913  break;
70914  default:
70915  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
70916  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
70917  "longer supported!");
70918  return NULL;
70919  }
70920  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
70921  f->m_ml->ml_name);
70922  return NULL;
70923 }
70924 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
70925  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
70926 }
70927 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
70928  PyObject *result;
70929  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
70930  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
70931  Py_ssize_t argc;
70932  PyObject *new_args;
70933  PyObject *self;
70934  argc = PyTuple_GET_SIZE(args);
70935  new_args = PyTuple_GetSlice(args, 1, argc);
70936  if (unlikely(!new_args))
70937  return NULL;
70938  self = PyTuple_GetItem(args, 0);
70939  if (unlikely(!self)) {
70940  Py_DECREF(new_args);
70941  return NULL;
70942  }
70943  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
70944  Py_DECREF(new_args);
70945  } else {
70946  result = __Pyx_CyFunction_Call(func, args, kw);
70947  }
70948  return result;
70949 }
70950 static PyTypeObject __pyx_CyFunctionType_type = {
70951  PyVarObject_HEAD_INIT(0, 0)
70952  "cython_function_or_method",
70953  sizeof(__pyx_CyFunctionObject),
70954  0,
70955  (destructor) __Pyx_CyFunction_dealloc,
70956  0,
70957  0,
70958  0,
70959 #if PY_MAJOR_VERSION < 3
70960  0,
70961 #else
70962  0,
70963 #endif
70964  (reprfunc) __Pyx_CyFunction_repr,
70965  0,
70966  0,
70967  0,
70968  0,
70969  __Pyx_CyFunction_CallAsMethod,
70970  0,
70971  0,
70972  0,
70973  0,
70974  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
70975  0,
70976  (traverseproc) __Pyx_CyFunction_traverse,
70977  (inquiry) __Pyx_CyFunction_clear,
70978  0,
70979 #if PY_VERSION_HEX < 0x030500A0
70980  offsetof(__pyx_CyFunctionObject, func_weakreflist),
70981 #else
70982  offsetof(PyCFunctionObject, m_weakreflist),
70983 #endif
70984  0,
70985  0,
70986  __pyx_CyFunction_methods,
70987  __pyx_CyFunction_members,
70988  __pyx_CyFunction_getsets,
70989  0,
70990  0,
70991  __Pyx_CyFunction_descr_get,
70992  0,
70993  offsetof(__pyx_CyFunctionObject, func_dict),
70994  0,
70995  0,
70996  0,
70997  0,
70998  0,
70999  0,
71000  0,
71001  0,
71002  0,
71003  0,
71004  0,
71005  0,
71006 #if PY_VERSION_HEX >= 0x030400a1
71007  0,
71008 #endif
71009 };
71010 static int __pyx_CyFunction_init(void) {
71011  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
71012  if (unlikely(__pyx_CyFunctionType == NULL)) {
71013  return -1;
71014  }
71015  return 0;
71016 }
71017 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
71018  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71019  m->defaults = PyObject_Malloc(size);
71020  if (unlikely(!m->defaults))
71021  return PyErr_NoMemory();
71022  memset(m->defaults, 0, size);
71023  m->defaults_pyobjects = pyobjects;
71024  return m->defaults;
71025 }
71026 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
71027  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71028  m->defaults_tuple = tuple;
71029  Py_INCREF(tuple);
71030 }
71031 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
71032  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71033  m->defaults_kwdict = dict;
71034  Py_INCREF(dict);
71035 }
71036 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
71037  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
71038  m->func_annotations = dict;
71039  Py_INCREF(dict);
71040 }
71041 
71042 /* CalculateMetaclass */
71043  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
71044  Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
71045  for (i=0; i < nbases; i++) {
71046  PyTypeObject *tmptype;
71047  PyObject *tmp = PyTuple_GET_ITEM(bases, i);
71048  tmptype = Py_TYPE(tmp);
71049 #if PY_MAJOR_VERSION < 3
71050  if (tmptype == &PyClass_Type)
71051  continue;
71052 #endif
71053  if (!metaclass) {
71054  metaclass = tmptype;
71055  continue;
71056  }
71057  if (PyType_IsSubtype(metaclass, tmptype))
71058  continue;
71059  if (PyType_IsSubtype(tmptype, metaclass)) {
71060  metaclass = tmptype;
71061  continue;
71062  }
71063  PyErr_SetString(PyExc_TypeError,
71064  "metaclass conflict: "
71065  "the metaclass of a derived class "
71066  "must be a (non-strict) subclass "
71067  "of the metaclasses of all its bases");
71068  return NULL;
71069  }
71070  if (!metaclass) {
71071 #if PY_MAJOR_VERSION < 3
71072  metaclass = &PyClass_Type;
71073 #else
71074  metaclass = &PyType_Type;
71075 #endif
71076  }
71077  Py_INCREF((PyObject*) metaclass);
71078  return (PyObject*) metaclass;
71079 }
71080 
71081 /* Py3ClassCreate */
71082  static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
71083  PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
71084  PyObject *ns;
71085  if (metaclass) {
71086  PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
71087  if (prep) {
71088  PyObject *pargs = PyTuple_Pack(2, name, bases);
71089  if (unlikely(!pargs)) {
71090  Py_DECREF(prep);
71091  return NULL;
71092  }
71093  ns = PyObject_Call(prep, pargs, mkw);
71094  Py_DECREF(prep);
71095  Py_DECREF(pargs);
71096  } else {
71097  if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
71098  return NULL;
71099  PyErr_Clear();
71100  ns = PyDict_New();
71101  }
71102  } else {
71103  ns = PyDict_New();
71104  }
71105  if (unlikely(!ns))
71106  return NULL;
71107  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
71108  if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
71109  if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
71110  return ns;
71111 bad:
71112  Py_DECREF(ns);
71113  return NULL;
71114 }
71115 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
71116  PyObject *dict, PyObject *mkw,
71117  int calculate_metaclass, int allow_py2_metaclass) {
71118  PyObject *result, *margs;
71119  PyObject *owned_metaclass = NULL;
71120  if (allow_py2_metaclass) {
71121  owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
71122  if (owned_metaclass) {
71123  metaclass = owned_metaclass;
71124  } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
71125  PyErr_Clear();
71126  } else {
71127  return NULL;
71128  }
71129  }
71130  if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
71131  metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
71132  Py_XDECREF(owned_metaclass);
71133  if (unlikely(!metaclass))
71134  return NULL;
71135  owned_metaclass = metaclass;
71136  }
71137  margs = PyTuple_Pack(3, name, bases, dict);
71138  if (unlikely(!margs)) {
71139  result = NULL;
71140  } else {
71141  result = PyObject_Call(metaclass, margs, mkw);
71142  Py_DECREF(margs);
71143  }
71144  Py_XDECREF(owned_metaclass);
71145  return result;
71146 }
71147 
71148 /* CLineInTraceback */
71149  #ifndef CYTHON_CLINE_IN_TRACEBACK
71150 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
71151  PyObject *use_cline;
71152  PyObject *ptype, *pvalue, *ptraceback;
71153 #if CYTHON_COMPILING_IN_CPYTHON
71154  PyObject **cython_runtime_dict;
71155 #endif
71156  if (unlikely(!__pyx_cython_runtime)) {
71157  return c_line;
71158  }
71159  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
71160 #if CYTHON_COMPILING_IN_CPYTHON
71161  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
71162  if (likely(cython_runtime_dict)) {
71163  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
71164  use_cline, *cython_runtime_dict,
71165  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
71166  } else
71167 #endif
71168  {
71169  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
71170  if (use_cline_obj) {
71171  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
71172  Py_DECREF(use_cline_obj);
71173  } else {
71174  PyErr_Clear();
71175  use_cline = NULL;
71176  }
71177  }
71178  if (!use_cline) {
71179  c_line = 0;
71180  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
71181  }
71182  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
71183  c_line = 0;
71184  }
71185  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
71186  return c_line;
71187 }
71188 #endif
71189 
71190 /* CodeObjectCache */
71191  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
71192  int start = 0, mid = 0, end = count - 1;
71193  if (end >= 0 && code_line > entries[end].code_line) {
71194  return count;
71195  }
71196  while (start < end) {
71197  mid = start + (end - start) / 2;
71198  if (code_line < entries[mid].code_line) {
71199  end = mid;
71200  } else if (code_line > entries[mid].code_line) {
71201  start = mid + 1;
71202  } else {
71203  return mid;
71204  }
71205  }
71206  if (code_line <= entries[mid].code_line) {
71207  return mid;
71208  } else {
71209  return mid + 1;
71210  }
71211 }
71212 static PyCodeObject *__pyx_find_code_object(int code_line) {
71213  PyCodeObject* code_object;
71214  int pos;
71215  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
71216  return NULL;
71217  }
71218  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
71219  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
71220  return NULL;
71221  }
71222  code_object = __pyx_code_cache.entries[pos].code_object;
71223  Py_INCREF(code_object);
71224  return code_object;
71225 }
71226 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
71227  int pos, i;
71228  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
71229  if (unlikely(!code_line)) {
71230  return;
71231  }
71232  if (unlikely(!entries)) {
71233  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
71234  if (likely(entries)) {
71235  __pyx_code_cache.entries = entries;
71236  __pyx_code_cache.max_count = 64;
71237  __pyx_code_cache.count = 1;
71238  entries[0].code_line = code_line;
71239  entries[0].code_object = code_object;
71240  Py_INCREF(code_object);
71241  }
71242  return;
71243  }
71244  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
71245  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
71246  PyCodeObject* tmp = entries[pos].code_object;
71247  entries[pos].code_object = code_object;
71248  Py_DECREF(tmp);
71249  return;
71250  }
71251  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
71252  int new_max = __pyx_code_cache.max_count + 64;
71253  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
71254  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
71255  if (unlikely(!entries)) {
71256  return;
71257  }
71258  __pyx_code_cache.entries = entries;
71259  __pyx_code_cache.max_count = new_max;
71260  }
71261  for (i=__pyx_code_cache.count; i>pos; i--) {
71262  entries[i] = entries[i-1];
71263  }
71264  entries[pos].code_line = code_line;
71265  entries[pos].code_object = code_object;
71266  __pyx_code_cache.count++;
71267  Py_INCREF(code_object);
71268 }
71269 
71270 /* AddTraceback */
71271  #include "compile.h"
71272 #include "frameobject.h"
71273 #include "traceback.h"
71274 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
71275  const char *funcname, int c_line,
71276  int py_line, const char *filename) {
71277  PyCodeObject *py_code = 0;
71278  PyObject *py_srcfile = 0;
71279  PyObject *py_funcname = 0;
71280  #if PY_MAJOR_VERSION < 3
71281  py_srcfile = PyString_FromString(filename);
71282  #else
71283  py_srcfile = PyUnicode_FromString(filename);
71284  #endif
71285  if (!py_srcfile) goto bad;
71286  if (c_line) {
71287  #if PY_MAJOR_VERSION < 3
71288  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
71289  #else
71290  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
71291  #endif
71292  }
71293  else {
71294  #if PY_MAJOR_VERSION < 3
71295  py_funcname = PyString_FromString(funcname);
71296  #else
71297  py_funcname = PyUnicode_FromString(funcname);
71298  #endif
71299  }
71300  if (!py_funcname) goto bad;
71301  py_code = __Pyx_PyCode_New(
71302  0,
71303  0,
71304  0,
71305  0,
71306  0,
71307  __pyx_empty_bytes, /*PyObject *code,*/
71308  __pyx_empty_tuple, /*PyObject *consts,*/
71309  __pyx_empty_tuple, /*PyObject *names,*/
71310  __pyx_empty_tuple, /*PyObject *varnames,*/
71311  __pyx_empty_tuple, /*PyObject *freevars,*/
71312  __pyx_empty_tuple, /*PyObject *cellvars,*/
71313  py_srcfile, /*PyObject *filename,*/
71314  py_funcname, /*PyObject *name,*/
71315  py_line,
71316  __pyx_empty_bytes /*PyObject *lnotab*/
71317  );
71318  Py_DECREF(py_srcfile);
71319  Py_DECREF(py_funcname);
71320  return py_code;
71321 bad:
71322  Py_XDECREF(py_srcfile);
71323  Py_XDECREF(py_funcname);
71324  return NULL;
71325 }
71326 static void __Pyx_AddTraceback(const char *funcname, int c_line,
71327  int py_line, const char *filename) {
71328  PyCodeObject *py_code = 0;
71329  PyFrameObject *py_frame = 0;
71330  PyThreadState *tstate = __Pyx_PyThreadState_Current;
71331  if (c_line) {
71332  c_line = __Pyx_CLineForTraceback(tstate, c_line);
71333  }
71334  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
71335  if (!py_code) {
71336  py_code = __Pyx_CreateCodeObjectForTraceback(
71337  funcname, c_line, py_line, filename);
71338  if (!py_code) goto bad;
71339  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
71340  }
71341  py_frame = PyFrame_New(
71342  tstate, /*PyThreadState *tstate,*/
71343  py_code, /*PyCodeObject *code,*/
71344  __pyx_d, /*PyObject *globals,*/
71345  0 /*PyObject *locals*/
71346  );
71347  if (!py_frame) goto bad;
71348  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
71349  PyTraceBack_Here(py_frame);
71350 bad:
71351  Py_XDECREF(py_code);
71352  Py_XDECREF(py_frame);
71353 }
71354 
71355 /* CIntFromPyVerify */
71356  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
71357  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
71358 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
71359  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
71360 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
71361  {\
71362  func_type value = func_value;\
71363  if (sizeof(target_type) < sizeof(func_type)) {\
71364  if (unlikely(value != (func_type) (target_type) value)) {\
71365  func_type zero = 0;\
71366  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
71367  return (target_type) -1;\
71368  if (is_unsigned && unlikely(value < zero))\
71369  goto raise_neg_overflow;\
71370  else\
71371  goto raise_overflow;\
71372  }\
71373  }\
71374  return (target_type) value;\
71375  }
71376 
71377 /* CIntToPy */
71378  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
71379  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
71380  const int is_unsigned = neg_one > const_zero;
71381  if (is_unsigned) {
71382  if (sizeof(long) < sizeof(long)) {
71383  return PyInt_FromLong((long) value);
71384  } else if (sizeof(long) <= sizeof(unsigned long)) {
71385  return PyLong_FromUnsignedLong((unsigned long) value);
71386 #ifdef HAVE_LONG_LONG
71387  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
71388  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
71389 #endif
71390  }
71391  } else {
71392  if (sizeof(long) <= sizeof(long)) {
71393  return PyInt_FromLong((long) value);
71394 #ifdef HAVE_LONG_LONG
71395  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
71396  return PyLong_FromLongLong((PY_LONG_LONG) value);
71397 #endif
71398  }
71399  }
71400  {
71401  int one = 1; int little = (int)*(unsigned char *)&one;
71402  unsigned char *bytes = (unsigned char *)&value;
71403  return _PyLong_FromByteArray(bytes, sizeof(long),
71404  little, !is_unsigned);
71405  }
71406 }
71407 
71408 /* CIntToPy */
71409  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
71410  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
71411  const int is_unsigned = neg_one > const_zero;
71412  if (is_unsigned) {
71413  if (sizeof(int) < sizeof(long)) {
71414  return PyInt_FromLong((long) value);
71415  } else if (sizeof(int) <= sizeof(unsigned long)) {
71416  return PyLong_FromUnsignedLong((unsigned long) value);
71417 #ifdef HAVE_LONG_LONG
71418  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
71419  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
71420 #endif
71421  }
71422  } else {
71423  if (sizeof(int) <= sizeof(long)) {
71424  return PyInt_FromLong((long) value);
71425 #ifdef HAVE_LONG_LONG
71426  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
71427  return PyLong_FromLongLong((PY_LONG_LONG) value);
71428 #endif
71429  }
71430  }
71431  {
71432  int one = 1; int little = (int)*(unsigned char *)&one;
71433  unsigned char *bytes = (unsigned char *)&value;
71434  return _PyLong_FromByteArray(bytes, sizeof(int),
71435  little, !is_unsigned);
71436  }
71437 }
71438 
71439 /* CIntToPy */
71440  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
71441  const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
71442  const int is_unsigned = neg_one > const_zero;
71443  if (is_unsigned) {
71444  if (sizeof(Py_intptr_t) < sizeof(long)) {
71445  return PyInt_FromLong((long) value);
71446  } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
71447  return PyLong_FromUnsignedLong((unsigned long) value);
71448 #ifdef HAVE_LONG_LONG
71449  } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
71450  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
71451 #endif
71452  }
71453  } else {
71454  if (sizeof(Py_intptr_t) <= sizeof(long)) {
71455  return PyInt_FromLong((long) value);
71456 #ifdef HAVE_LONG_LONG
71457  } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
71458  return PyLong_FromLongLong((PY_LONG_LONG) value);
71459 #endif
71460  }
71461  }
71462  {
71463  int one = 1; int little = (int)*(unsigned char *)&one;
71464  unsigned char *bytes = (unsigned char *)&value;
71465  return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
71466  little, !is_unsigned);
71467  }
71468 }
71469 
71470 /* Declarations */
71471  #if CYTHON_CCOMPLEX
71472  #ifdef __cplusplus
71473  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
71474  return ::std::complex< float >(x, y);
71475  }
71476  #else
71477  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
71478  return x + y*(__pyx_t_float_complex)_Complex_I;
71479  }
71480  #endif
71481 #else
71482  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
71483  __pyx_t_float_complex z;
71484  z.real = x;
71485  z.imag = y;
71486  return z;
71487  }
71488 #endif
71489 
71490 /* Arithmetic */
71491  #if CYTHON_CCOMPLEX
71492 #else
71493  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71494  return (a.real == b.real) && (a.imag == b.imag);
71495  }
71496  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71497  __pyx_t_float_complex z;
71498  z.real = a.real + b.real;
71499  z.imag = a.imag + b.imag;
71500  return z;
71501  }
71502  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71503  __pyx_t_float_complex z;
71504  z.real = a.real - b.real;
71505  z.imag = a.imag - b.imag;
71506  return z;
71507  }
71508  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71509  __pyx_t_float_complex z;
71510  z.real = a.real * b.real - a.imag * b.imag;
71511  z.imag = a.real * b.imag + a.imag * b.real;
71512  return z;
71513  }
71514  #if 1
71515  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71516  if (b.imag == 0) {
71517  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
71518  } else if (fabsf(b.real) >= fabsf(b.imag)) {
71519  if (b.real == 0 && b.imag == 0) {
71520  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
71521  } else {
71522  float r = b.imag / b.real;
71523  float s = 1.0 / (b.real + b.imag * r);
71524  return __pyx_t_float_complex_from_parts(
71525  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
71526  }
71527  } else {
71528  float r = b.real / b.imag;
71529  float s = 1.0 / (b.imag + b.real * r);
71530  return __pyx_t_float_complex_from_parts(
71531  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
71532  }
71533  }
71534  #else
71535  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71536  if (b.imag == 0) {
71537  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
71538  } else {
71539  float denom = b.real * b.real + b.imag * b.imag;
71540  return __pyx_t_float_complex_from_parts(
71541  (a.real * b.real + a.imag * b.imag) / denom,
71542  (a.imag * b.real - a.real * b.imag) / denom);
71543  }
71544  }
71545  #endif
71546  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
71547  __pyx_t_float_complex z;
71548  z.real = -a.real;
71549  z.imag = -a.imag;
71550  return z;
71551  }
71552  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
71553  return (a.real == 0) && (a.imag == 0);
71554  }
71555  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
71556  __pyx_t_float_complex z;
71557  z.real = a.real;
71558  z.imag = -a.imag;
71559  return z;
71560  }
71561  #if 1
71562  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
71563  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
71564  return sqrtf(z.real*z.real + z.imag*z.imag);
71565  #else
71566  return hypotf(z.real, z.imag);
71567  #endif
71568  }
71569  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
71570  __pyx_t_float_complex z;
71571  float r, lnr, theta, z_r, z_theta;
71572  if (b.imag == 0 && b.real == (int)b.real) {
71573  if (b.real < 0) {
71574  float denom = a.real * a.real + a.imag * a.imag;
71575  a.real = a.real / denom;
71576  a.imag = -a.imag / denom;
71577  b.real = -b.real;
71578  }
71579  switch ((int)b.real) {
71580  case 0:
71581  z.real = 1;
71582  z.imag = 0;
71583  return z;
71584  case 1:
71585  return a;
71586  case 2:
71587  z = __Pyx_c_prod_float(a, a);
71588  return __Pyx_c_prod_float(a, a);
71589  case 3:
71590  z = __Pyx_c_prod_float(a, a);
71591  return __Pyx_c_prod_float(z, a);
71592  case 4:
71593  z = __Pyx_c_prod_float(a, a);
71594  return __Pyx_c_prod_float(z, z);
71595  }
71596  }
71597  if (a.imag == 0) {
71598  if (a.real == 0) {
71599  return a;
71600  } else if (b.imag == 0) {
71601  z.real = powf(a.real, b.real);
71602  z.imag = 0;
71603  return z;
71604  } else if (a.real > 0) {
71605  r = a.real;
71606  theta = 0;
71607  } else {
71608  r = -a.real;
71609  theta = atan2f(0, -1);
71610  }
71611  } else {
71612  r = __Pyx_c_abs_float(a);
71613  theta = atan2f(a.imag, a.real);
71614  }
71615  lnr = logf(r);
71616  z_r = expf(lnr * b.real - theta * b.imag);
71617  z_theta = theta * b.real + lnr * b.imag;
71618  z.real = z_r * cosf(z_theta);
71619  z.imag = z_r * sinf(z_theta);
71620  return z;
71621  }
71622  #endif
71623 #endif
71624 
71625 /* Declarations */
71626  #if CYTHON_CCOMPLEX
71627  #ifdef __cplusplus
71628  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
71629  return ::std::complex< double >(x, y);
71630  }
71631  #else
71632  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
71633  return x + y*(__pyx_t_double_complex)_Complex_I;
71634  }
71635  #endif
71636 #else
71637  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
71638  __pyx_t_double_complex z;
71639  z.real = x;
71640  z.imag = y;
71641  return z;
71642  }
71643 #endif
71644 
71645 /* Arithmetic */
71646  #if CYTHON_CCOMPLEX
71647 #else
71648  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71649  return (a.real == b.real) && (a.imag == b.imag);
71650  }
71651  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71652  __pyx_t_double_complex z;
71653  z.real = a.real + b.real;
71654  z.imag = a.imag + b.imag;
71655  return z;
71656  }
71657  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71658  __pyx_t_double_complex z;
71659  z.real = a.real - b.real;
71660  z.imag = a.imag - b.imag;
71661  return z;
71662  }
71663  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71664  __pyx_t_double_complex z;
71665  z.real = a.real * b.real - a.imag * b.imag;
71666  z.imag = a.real * b.imag + a.imag * b.real;
71667  return z;
71668  }
71669  #if 1
71670  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71671  if (b.imag == 0) {
71672  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
71673  } else if (fabs(b.real) >= fabs(b.imag)) {
71674  if (b.real == 0 && b.imag == 0) {
71675  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
71676  } else {
71677  double r = b.imag / b.real;
71678  double s = 1.0 / (b.real + b.imag * r);
71679  return __pyx_t_double_complex_from_parts(
71680  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
71681  }
71682  } else {
71683  double r = b.real / b.imag;
71684  double s = 1.0 / (b.imag + b.real * r);
71685  return __pyx_t_double_complex_from_parts(
71686  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
71687  }
71688  }
71689  #else
71690  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71691  if (b.imag == 0) {
71692  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
71693  } else {
71694  double denom = b.real * b.real + b.imag * b.imag;
71695  return __pyx_t_double_complex_from_parts(
71696  (a.real * b.real + a.imag * b.imag) / denom,
71697  (a.imag * b.real - a.real * b.imag) / denom);
71698  }
71699  }
71700  #endif
71701  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
71702  __pyx_t_double_complex z;
71703  z.real = -a.real;
71704  z.imag = -a.imag;
71705  return z;
71706  }
71707  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
71708  return (a.real == 0) && (a.imag == 0);
71709  }
71710  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
71711  __pyx_t_double_complex z;
71712  z.real = a.real;
71713  z.imag = -a.imag;
71714  return z;
71715  }
71716  #if 1
71717  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
71718  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
71719  return sqrt(z.real*z.real + z.imag*z.imag);
71720  #else
71721  return hypot(z.real, z.imag);
71722  #endif
71723  }
71724  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
71725  __pyx_t_double_complex z;
71726  double r, lnr, theta, z_r, z_theta;
71727  if (b.imag == 0 && b.real == (int)b.real) {
71728  if (b.real < 0) {
71729  double denom = a.real * a.real + a.imag * a.imag;
71730  a.real = a.real / denom;
71731  a.imag = -a.imag / denom;
71732  b.real = -b.real;
71733  }
71734  switch ((int)b.real) {
71735  case 0:
71736  z.real = 1;
71737  z.imag = 0;
71738  return z;
71739  case 1:
71740  return a;
71741  case 2:
71742  z = __Pyx_c_prod_double(a, a);
71743  return __Pyx_c_prod_double(a, a);
71744  case 3:
71745  z = __Pyx_c_prod_double(a, a);
71746  return __Pyx_c_prod_double(z, a);
71747  case 4:
71748  z = __Pyx_c_prod_double(a, a);
71749  return __Pyx_c_prod_double(z, z);
71750  }
71751  }
71752  if (a.imag == 0) {
71753  if (a.real == 0) {
71754  return a;
71755  } else if (b.imag == 0) {
71756  z.real = pow(a.real, b.real);
71757  z.imag = 0;
71758  return z;
71759  } else if (a.real > 0) {
71760  r = a.real;
71761  theta = 0;
71762  } else {
71763  r = -a.real;
71764  theta = atan2(0, -1);
71765  }
71766  } else {
71767  r = __Pyx_c_abs_double(a);
71768  theta = atan2(a.imag, a.real);
71769  }
71770  lnr = log(r);
71771  z_r = exp(lnr * b.real - theta * b.imag);
71772  z_theta = theta * b.real + lnr * b.imag;
71773  z.real = z_r * cos(z_theta);
71774  z.imag = z_r * sin(z_theta);
71775  return z;
71776  }
71777  #endif
71778 #endif
71779 
71780 /* CIntToPy */
71781  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
71782  const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
71783  const int is_unsigned = neg_one > const_zero;
71784  if (is_unsigned) {
71785  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
71786  return PyInt_FromLong((long) value);
71787  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
71788  return PyLong_FromUnsignedLong((unsigned long) value);
71789 #ifdef HAVE_LONG_LONG
71790  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
71791  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
71792 #endif
71793  }
71794  } else {
71795  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
71796  return PyInt_FromLong((long) value);
71797 #ifdef HAVE_LONG_LONG
71798  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
71799  return PyLong_FromLongLong((PY_LONG_LONG) value);
71800 #endif
71801  }
71802  }
71803  {
71804  int one = 1; int little = (int)*(unsigned char *)&one;
71805  unsigned char *bytes = (unsigned char *)&value;
71806  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
71807  little, !is_unsigned);
71808  }
71809 }
71810 
71811 /* CIntFromPy */
71812  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
71813  const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
71814  const int is_unsigned = neg_one > const_zero;
71815 #if PY_MAJOR_VERSION < 3
71816  if (likely(PyInt_Check(x))) {
71817  if (sizeof(long) < sizeof(long)) {
71818  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
71819  } else {
71820  long val = PyInt_AS_LONG(x);
71821  if (is_unsigned && unlikely(val < 0)) {
71822  goto raise_neg_overflow;
71823  }
71824  return (long) val;
71825  }
71826  } else
71827 #endif
71828  if (likely(PyLong_Check(x))) {
71829  if (is_unsigned) {
71830 #if CYTHON_USE_PYLONG_INTERNALS
71831  const digit* digits = ((PyLongObject*)x)->ob_digit;
71832  switch (Py_SIZE(x)) {
71833  case 0: return (long) 0;
71834  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
71835  case 2:
71836  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
71837  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
71838  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71839  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
71840  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
71841  }
71842  }
71843  break;
71844  case 3:
71845  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
71846  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
71847  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71848  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
71849  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
71850  }
71851  }
71852  break;
71853  case 4:
71854  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
71855  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
71856  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71857  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
71858  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
71859  }
71860  }
71861  break;
71862  }
71863 #endif
71864 #if CYTHON_COMPILING_IN_CPYTHON
71865  if (unlikely(Py_SIZE(x) < 0)) {
71866  goto raise_neg_overflow;
71867  }
71868 #else
71869  {
71870  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
71871  if (unlikely(result < 0))
71872  return (long) -1;
71873  if (unlikely(result == 1))
71874  goto raise_neg_overflow;
71875  }
71876 #endif
71877  if (sizeof(long) <= sizeof(unsigned long)) {
71878  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
71879 #ifdef HAVE_LONG_LONG
71880  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
71881  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
71882 #endif
71883  }
71884  } else {
71885 #if CYTHON_USE_PYLONG_INTERNALS
71886  const digit* digits = ((PyLongObject*)x)->ob_digit;
71887  switch (Py_SIZE(x)) {
71888  case 0: return (long) 0;
71889  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
71890  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
71891  case -2:
71892  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
71893  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
71894  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71895  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
71896  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
71897  }
71898  }
71899  break;
71900  case 2:
71901  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
71902  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
71903  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71904  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
71905  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
71906  }
71907  }
71908  break;
71909  case -3:
71910  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
71911  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
71912  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71913  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
71914  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
71915  }
71916  }
71917  break;
71918  case 3:
71919  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
71920  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
71921  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71922  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
71923  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
71924  }
71925  }
71926  break;
71927  case -4:
71928  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
71929  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
71930  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71931  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
71932  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
71933  }
71934  }
71935  break;
71936  case 4:
71937  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
71938  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
71939  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
71940  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
71941  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
71942  }
71943  }
71944  break;
71945  }
71946 #endif
71947  if (sizeof(long) <= sizeof(long)) {
71948  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
71949 #ifdef HAVE_LONG_LONG
71950  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
71951  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
71952 #endif
71953  }
71954  }
71955  {
71956 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
71957  PyErr_SetString(PyExc_RuntimeError,
71958  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
71959 #else
71960  long val;
71961  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
71962  #if PY_MAJOR_VERSION < 3
71963  if (likely(v) && !PyLong_Check(v)) {
71964  PyObject *tmp = v;
71965  v = PyNumber_Long(tmp);
71966  Py_DECREF(tmp);
71967  }
71968  #endif
71969  if (likely(v)) {
71970  int one = 1; int is_little = (int)*(unsigned char *)&one;
71971  unsigned char *bytes = (unsigned char *)&val;
71972  int ret = _PyLong_AsByteArray((PyLongObject *)v,
71973  bytes, sizeof(val),
71974  is_little, !is_unsigned);
71975  Py_DECREF(v);
71976  if (likely(!ret))
71977  return val;
71978  }
71979 #endif
71980  return (long) -1;
71981  }
71982  } else {
71983  long val;
71984  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
71985  if (!tmp) return (long) -1;
71986  val = __Pyx_PyInt_As_long(tmp);
71987  Py_DECREF(tmp);
71988  return val;
71989  }
71990 raise_overflow:
71991  PyErr_SetString(PyExc_OverflowError,
71992  "value too large to convert to long");
71993  return (long) -1;
71994 raise_neg_overflow:
71995  PyErr_SetString(PyExc_OverflowError,
71996  "can't convert negative value to long");
71997  return (long) -1;
71998 }
71999 
72000 /* CIntFromPy */
72001  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
72002  const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
72003  const int is_unsigned = neg_one > const_zero;
72004 #if PY_MAJOR_VERSION < 3
72005  if (likely(PyInt_Check(x))) {
72006  if (sizeof(int) < sizeof(long)) {
72007  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
72008  } else {
72009  long val = PyInt_AS_LONG(x);
72010  if (is_unsigned && unlikely(val < 0)) {
72011  goto raise_neg_overflow;
72012  }
72013  return (int) val;
72014  }
72015  } else
72016 #endif
72017  if (likely(PyLong_Check(x))) {
72018  if (is_unsigned) {
72019 #if CYTHON_USE_PYLONG_INTERNALS
72020  const digit* digits = ((PyLongObject*)x)->ob_digit;
72021  switch (Py_SIZE(x)) {
72022  case 0: return (int) 0;
72023  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
72024  case 2:
72025  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
72026  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
72027  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72028  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
72029  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
72030  }
72031  }
72032  break;
72033  case 3:
72034  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
72035  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
72036  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72037  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
72038  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
72039  }
72040  }
72041  break;
72042  case 4:
72043  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
72044  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
72045  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72046  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
72047  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
72048  }
72049  }
72050  break;
72051  }
72052 #endif
72053 #if CYTHON_COMPILING_IN_CPYTHON
72054  if (unlikely(Py_SIZE(x) < 0)) {
72055  goto raise_neg_overflow;
72056  }
72057 #else
72058  {
72059  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
72060  if (unlikely(result < 0))
72061  return (int) -1;
72062  if (unlikely(result == 1))
72063  goto raise_neg_overflow;
72064  }
72065 #endif
72066  if (sizeof(int) <= sizeof(unsigned long)) {
72067  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
72068 #ifdef HAVE_LONG_LONG
72069  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
72070  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
72071 #endif
72072  }
72073  } else {
72074 #if CYTHON_USE_PYLONG_INTERNALS
72075  const digit* digits = ((PyLongObject*)x)->ob_digit;
72076  switch (Py_SIZE(x)) {
72077  case 0: return (int) 0;
72078  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
72079  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
72080  case -2:
72081  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
72082  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
72083  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72084  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
72085  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
72086  }
72087  }
72088  break;
72089  case 2:
72090  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
72091  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
72092  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72093  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
72094  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
72095  }
72096  }
72097  break;
72098  case -3:
72099  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
72100  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
72101  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72102  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
72103  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
72104  }
72105  }
72106  break;
72107  case 3:
72108  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
72109  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
72110  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72111  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
72112  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
72113  }
72114  }
72115  break;
72116  case -4:
72117  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
72118  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
72119  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72120  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
72121  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
72122  }
72123  }
72124  break;
72125  case 4:
72126  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
72127  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
72128  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72129  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
72130  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
72131  }
72132  }
72133  break;
72134  }
72135 #endif
72136  if (sizeof(int) <= sizeof(long)) {
72137  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
72138 #ifdef HAVE_LONG_LONG
72139  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
72140  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
72141 #endif
72142  }
72143  }
72144  {
72145 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
72146  PyErr_SetString(PyExc_RuntimeError,
72147  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
72148 #else
72149  int val;
72150  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
72151  #if PY_MAJOR_VERSION < 3
72152  if (likely(v) && !PyLong_Check(v)) {
72153  PyObject *tmp = v;
72154  v = PyNumber_Long(tmp);
72155  Py_DECREF(tmp);
72156  }
72157  #endif
72158  if (likely(v)) {
72159  int one = 1; int is_little = (int)*(unsigned char *)&one;
72160  unsigned char *bytes = (unsigned char *)&val;
72161  int ret = _PyLong_AsByteArray((PyLongObject *)v,
72162  bytes, sizeof(val),
72163  is_little, !is_unsigned);
72164  Py_DECREF(v);
72165  if (likely(!ret))
72166  return val;
72167  }
72168 #endif
72169  return (int) -1;
72170  }
72171  } else {
72172  int val;
72173  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
72174  if (!tmp) return (int) -1;
72175  val = __Pyx_PyInt_As_int(tmp);
72176  Py_DECREF(tmp);
72177  return val;
72178  }
72179 raise_overflow:
72180  PyErr_SetString(PyExc_OverflowError,
72181  "value too large to convert to int");
72182  return (int) -1;
72183 raise_neg_overflow:
72184  PyErr_SetString(PyExc_OverflowError,
72185  "can't convert negative value to int");
72186  return (int) -1;
72187 }
72188 
72189 /* CIntFromPy */
72190  static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
72191  const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
72192  const int is_unsigned = neg_one > const_zero;
72193 #if PY_MAJOR_VERSION < 3
72194  if (likely(PyInt_Check(x))) {
72195  if (sizeof(size_t) < sizeof(long)) {
72196  __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
72197  } else {
72198  long val = PyInt_AS_LONG(x);
72199  if (is_unsigned && unlikely(val < 0)) {
72200  goto raise_neg_overflow;
72201  }
72202  return (size_t) val;
72203  }
72204  } else
72205 #endif
72206  if (likely(PyLong_Check(x))) {
72207  if (is_unsigned) {
72208 #if CYTHON_USE_PYLONG_INTERNALS
72209  const digit* digits = ((PyLongObject*)x)->ob_digit;
72210  switch (Py_SIZE(x)) {
72211  case 0: return (size_t) 0;
72212  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
72213  case 2:
72214  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
72215  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
72216  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72217  } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
72218  return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
72219  }
72220  }
72221  break;
72222  case 3:
72223  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
72224  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
72225  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72226  } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
72227  return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
72228  }
72229  }
72230  break;
72231  case 4:
72232  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
72233  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
72234  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72235  } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
72236  return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
72237  }
72238  }
72239  break;
72240  }
72241 #endif
72242 #if CYTHON_COMPILING_IN_CPYTHON
72243  if (unlikely(Py_SIZE(x) < 0)) {
72244  goto raise_neg_overflow;
72245  }
72246 #else
72247  {
72248  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
72249  if (unlikely(result < 0))
72250  return (size_t) -1;
72251  if (unlikely(result == 1))
72252  goto raise_neg_overflow;
72253  }
72254 #endif
72255  if (sizeof(size_t) <= sizeof(unsigned long)) {
72256  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
72257 #ifdef HAVE_LONG_LONG
72258  } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
72259  __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
72260 #endif
72261  }
72262  } else {
72263 #if CYTHON_USE_PYLONG_INTERNALS
72264  const digit* digits = ((PyLongObject*)x)->ob_digit;
72265  switch (Py_SIZE(x)) {
72266  case 0: return (size_t) 0;
72267  case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
72268  case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
72269  case -2:
72270  if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
72271  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
72272  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72273  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
72274  return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
72275  }
72276  }
72277  break;
72278  case 2:
72279  if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
72280  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
72281  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72282  } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
72283  return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
72284  }
72285  }
72286  break;
72287  case -3:
72288  if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
72289  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
72290  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72291  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
72292  return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
72293  }
72294  }
72295  break;
72296  case 3:
72297  if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
72298  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
72299  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72300  } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
72301  return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
72302  }
72303  }
72304  break;
72305  case -4:
72306  if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
72307  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
72308  __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72309  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
72310  return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
72311  }
72312  }
72313  break;
72314  case 4:
72315  if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
72316  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
72317  __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
72318  } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
72319  return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
72320  }
72321  }
72322  break;
72323  }
72324 #endif
72325  if (sizeof(size_t) <= sizeof(long)) {
72326  __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
72327 #ifdef HAVE_LONG_LONG
72328  } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
72329  __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
72330 #endif
72331  }
72332  }
72333  {
72334 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
72335  PyErr_SetString(PyExc_RuntimeError,
72336  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
72337 #else
72338  size_t val;
72339  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
72340  #if PY_MAJOR_VERSION < 3
72341  if (likely(v) && !PyLong_Check(v)) {
72342  PyObject *tmp = v;
72343  v = PyNumber_Long(tmp);
72344  Py_DECREF(tmp);
72345  }
72346  #endif
72347  if (likely(v)) {
72348  int one = 1; int is_little = (int)*(unsigned char *)&one;
72349  unsigned char *bytes = (unsigned char *)&val;
72350  int ret = _PyLong_AsByteArray((PyLongObject *)v,
72351  bytes, sizeof(val),
72352  is_little, !is_unsigned);
72353  Py_DECREF(v);
72354  if (likely(!ret))
72355  return val;
72356  }
72357 #endif
72358  return (size_t) -1;
72359  }
72360  } else {
72361  size_t val;
72362  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
72363  if (!tmp) return (size_t) -1;
72364  val = __Pyx_PyInt_As_size_t(tmp);
72365  Py_DECREF(tmp);
72366  return val;
72367  }
72368 raise_overflow:
72369  PyErr_SetString(PyExc_OverflowError,
72370  "value too large to convert to size_t");
72371  return (size_t) -1;
72372 raise_neg_overflow:
72373  PyErr_SetString(PyExc_OverflowError,
72374  "can't convert negative value to size_t");
72375  return (size_t) -1;
72376 }
72377 
72378 /* FastTypeChecks */
72379  #if CYTHON_COMPILING_IN_CPYTHON
72380 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
72381  while (a) {
72382  a = a->tp_base;
72383  if (a == b)
72384  return 1;
72385  }
72386  return b == &PyBaseObject_Type;
72387 }
72388 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
72389  PyObject *mro;
72390  if (a == b) return 1;
72391  mro = a->tp_mro;
72392  if (likely(mro)) {
72393  Py_ssize_t i, n;
72394  n = PyTuple_GET_SIZE(mro);
72395  for (i = 0; i < n; i++) {
72396  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
72397  return 1;
72398  }
72399  return 0;
72400  }
72401  return __Pyx_InBases(a, b);
72402 }
72403 #if PY_MAJOR_VERSION == 2
72404 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
72405  PyObject *exception, *value, *tb;
72406  int res;
72407  __Pyx_PyThreadState_declare
72408  __Pyx_PyThreadState_assign
72409  __Pyx_ErrFetch(&exception, &value, &tb);
72410  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
72411  if (unlikely(res == -1)) {
72412  PyErr_WriteUnraisable(err);
72413  res = 0;
72414  }
72415  if (!res) {
72416  res = PyObject_IsSubclass(err, exc_type2);
72417  if (unlikely(res == -1)) {
72418  PyErr_WriteUnraisable(err);
72419  res = 0;
72420  }
72421  }
72422  __Pyx_ErrRestore(exception, value, tb);
72423  return res;
72424 }
72425 #else
72426 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
72427  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
72428  if (!res) {
72429  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
72430  }
72431  return res;
72432 }
72433 #endif
72434 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
72435  Py_ssize_t i, n;
72436  assert(PyExceptionClass_Check(exc_type));
72437  n = PyTuple_GET_SIZE(tuple);
72438 #if PY_MAJOR_VERSION >= 3
72439  for (i=0; i<n; i++) {
72440  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
72441  }
72442 #endif
72443  for (i=0; i<n; i++) {
72444  PyObject *t = PyTuple_GET_ITEM(tuple, i);
72445  #if PY_MAJOR_VERSION < 3
72446  if (likely(exc_type == t)) return 1;
72447  #endif
72448  if (likely(PyExceptionClass_Check(t))) {
72449  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
72450  } else {
72451  }
72452  }
72453  return 0;
72454 }
72455 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
72456  if (likely(err == exc_type)) return 1;
72457  if (likely(PyExceptionClass_Check(err))) {
72458  if (likely(PyExceptionClass_Check(exc_type))) {
72459  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
72460  } else if (likely(PyTuple_Check(exc_type))) {
72461  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
72462  } else {
72463  }
72464  }
72465  return PyErr_GivenExceptionMatches(err, exc_type);
72466 }
72467 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
72468  assert(PyExceptionClass_Check(exc_type1));
72469  assert(PyExceptionClass_Check(exc_type2));
72470  if (likely(err == exc_type1 || err == exc_type2)) return 1;
72471  if (likely(PyExceptionClass_Check(err))) {
72472  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
72473  }
72474  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
72475 }
72476 #endif
72477 
72478 /* SwapException */
72479  #if CYTHON_FAST_THREAD_STATE
72480 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
72481  PyObject *tmp_type, *tmp_value, *tmp_tb;
72482  #if CYTHON_USE_EXC_INFO_STACK
72483  _PyErr_StackItem *exc_info = tstate->exc_info;
72484  tmp_type = exc_info->exc_type;
72485  tmp_value = exc_info->exc_value;
72486  tmp_tb = exc_info->exc_traceback;
72487  exc_info->exc_type = *type;
72488  exc_info->exc_value = *value;
72489  exc_info->exc_traceback = *tb;
72490  #else
72491  tmp_type = tstate->exc_type;
72492  tmp_value = tstate->exc_value;
72493  tmp_tb = tstate->exc_traceback;
72494  tstate->exc_type = *type;
72495  tstate->exc_value = *value;
72496  tstate->exc_traceback = *tb;
72497  #endif
72498  *type = tmp_type;
72499  *value = tmp_value;
72500  *tb = tmp_tb;
72501 }
72502 #else
72503 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
72504  PyObject *tmp_type, *tmp_value, *tmp_tb;
72505  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
72506  PyErr_SetExcInfo(*type, *value, *tb);
72507  *type = tmp_type;
72508  *value = tmp_value;
72509  *tb = tmp_tb;
72510 }
72511 #endif
72512 
72513 /* CoroutineBase */
72514  #include <structmember.h>
72515 #include <frameobject.h>
72516 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
72517 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
72518  PyObject *et, *ev, *tb;
72519  PyObject *value = NULL;
72520  __Pyx_ErrFetch(&et, &ev, &tb);
72521  if (!et) {
72522  Py_XDECREF(tb);
72523  Py_XDECREF(ev);
72524  Py_INCREF(Py_None);
72525  *pvalue = Py_None;
72526  return 0;
72527  }
72528  if (likely(et == PyExc_StopIteration)) {
72529  if (!ev) {
72530  Py_INCREF(Py_None);
72531  value = Py_None;
72532  }
72533 #if PY_VERSION_HEX >= 0x030300A0
72534  else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
72535  value = ((PyStopIterationObject *)ev)->value;
72536  Py_INCREF(value);
72537  Py_DECREF(ev);
72538  }
72539 #endif
72540  else if (unlikely(PyTuple_Check(ev))) {
72541  if (PyTuple_GET_SIZE(ev) >= 1) {
72542 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
72543  value = PyTuple_GET_ITEM(ev, 0);
72544  Py_INCREF(value);
72545 #else
72546  value = PySequence_ITEM(ev, 0);
72547 #endif
72548  } else {
72549  Py_INCREF(Py_None);
72550  value = Py_None;
72551  }
72552  Py_DECREF(ev);
72553  }
72554  else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
72555  value = ev;
72556  }
72557  if (likely(value)) {
72558  Py_XDECREF(tb);
72559  Py_DECREF(et);
72560  *pvalue = value;
72561  return 0;
72562  }
72563  } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
72564  __Pyx_ErrRestore(et, ev, tb);
72565  return -1;
72566  }
72567  PyErr_NormalizeException(&et, &ev, &tb);
72568  if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
72569  __Pyx_ErrRestore(et, ev, tb);
72570  return -1;
72571  }
72572  Py_XDECREF(tb);
72573  Py_DECREF(et);
72574 #if PY_VERSION_HEX >= 0x030300A0
72575  value = ((PyStopIterationObject *)ev)->value;
72576  Py_INCREF(value);
72577  Py_DECREF(ev);
72578 #else
72579  {
72580  PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
72581  Py_DECREF(ev);
72582  if (likely(args)) {
72583  value = PySequence_GetItem(args, 0);
72584  Py_DECREF(args);
72585  }
72586  if (unlikely(!value)) {
72587  __Pyx_ErrRestore(NULL, NULL, NULL);
72588  Py_INCREF(Py_None);
72589  value = Py_None;
72590  }
72591  }
72592 #endif
72593  *pvalue = value;
72594  return 0;
72595 }
72596 static CYTHON_INLINE
72597 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
72598  PyObject *t, *v, *tb;
72599  t = exc_state->exc_type;
72600  v = exc_state->exc_value;
72601  tb = exc_state->exc_traceback;
72602  exc_state->exc_type = NULL;
72603  exc_state->exc_value = NULL;
72604  exc_state->exc_traceback = NULL;
72605  Py_XDECREF(t);
72606  Py_XDECREF(v);
72607  Py_XDECREF(tb);
72608 }
72609 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
72610 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
72611  const char *msg;
72612  if ((0)) {
72613  #ifdef __Pyx_Coroutine_USED
72614  } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
72615  msg = "coroutine already executing";
72616  #endif
72617  #ifdef __Pyx_AsyncGen_USED
72618  } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
72619  msg = "async generator already executing";
72620  #endif
72621  } else {
72622  msg = "generator already executing";
72623  }
72624  PyErr_SetString(PyExc_ValueError, msg);
72625 }
72626 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
72627 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
72628  const char *msg;
72629  if ((0)) {
72630  #ifdef __Pyx_Coroutine_USED
72631  } else if (__Pyx_Coroutine_Check(gen)) {
72632  msg = "can't send non-None value to a just-started coroutine";
72633  #endif
72634  #ifdef __Pyx_AsyncGen_USED
72635  } else if (__Pyx_AsyncGen_CheckExact(gen)) {
72636  msg = "can't send non-None value to a just-started async generator";
72637  #endif
72638  } else {
72639  msg = "can't send non-None value to a just-started generator";
72640  }
72641  PyErr_SetString(PyExc_TypeError, msg);
72642 }
72643 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
72644 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
72645  #ifdef __Pyx_Coroutine_USED
72646  if (!closing && __Pyx_Coroutine_Check(gen)) {
72647  PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
72648  } else
72649  #endif
72650  if (value) {
72651  #ifdef __Pyx_AsyncGen_USED
72652  if (__Pyx_AsyncGen_CheckExact(gen))
72653  PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
72654  else
72655  #endif
72656  PyErr_SetNone(PyExc_StopIteration);
72657  }
72658 }
72659 static
72660 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
72661  __Pyx_PyThreadState_declare
72662  PyThreadState *tstate;
72663  __Pyx_ExcInfoStruct *exc_state;
72664  PyObject *retval;
72665  assert(!self->is_running);
72666  if (unlikely(self->resume_label == 0)) {
72667  if (unlikely(value && value != Py_None)) {
72668  return __Pyx_Coroutine_NotStartedError((PyObject*)self);
72669  }
72670  }
72671  if (unlikely(self->resume_label == -1)) {
72672  return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
72673  }
72674 #if CYTHON_FAST_THREAD_STATE
72675  __Pyx_PyThreadState_assign
72676  tstate = __pyx_tstate;
72677 #else
72678  tstate = __Pyx_PyThreadState_Current;
72679 #endif
72680  exc_state = &self->gi_exc_state;
72681  if (exc_state->exc_type) {
72682  #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
72683  #else
72684  if (exc_state->exc_traceback) {
72685  PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
72686  PyFrameObject *f = tb->tb_frame;
72687  Py_XINCREF(tstate->frame);
72688  assert(f->f_back == NULL);
72689  f->f_back = tstate->frame;
72690  }
72691  #endif
72692  }
72693 #if CYTHON_USE_EXC_INFO_STACK
72694  exc_state->previous_item = tstate->exc_info;
72695  tstate->exc_info = exc_state;
72696 #else
72697  if (exc_state->exc_type) {
72698  __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
72699  } else {
72700  __Pyx_Coroutine_ExceptionClear(exc_state);
72701  __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
72702  }
72703 #endif
72704  self->is_running = 1;
72705  retval = self->body((PyObject *) self, tstate, value);
72706  self->is_running = 0;
72707 #if CYTHON_USE_EXC_INFO_STACK
72708  exc_state = &self->gi_exc_state;
72709  tstate->exc_info = exc_state->previous_item;
72710  exc_state->previous_item = NULL;
72711  __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
72712 #endif
72713  return retval;
72714 }
72715 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
72716  PyObject *exc_tb = exc_state->exc_traceback;
72717  if (likely(exc_tb)) {
72718 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
72719 #else
72720  PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
72721  PyFrameObject *f = tb->tb_frame;
72722  Py_CLEAR(f->f_back);
72723 #endif
72724  }
72725 }
72726 static CYTHON_INLINE
72727 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
72728  if (unlikely(!retval)) {
72729  __Pyx_PyThreadState_declare
72730  __Pyx_PyThreadState_assign
72731  if (!__Pyx_PyErr_Occurred()) {
72732  PyObject *exc = PyExc_StopIteration;
72733  #ifdef __Pyx_AsyncGen_USED
72734  if (__Pyx_AsyncGen_CheckExact(gen))
72735  exc = __Pyx_PyExc_StopAsyncIteration;
72736  #endif
72737  __Pyx_PyErr_SetNone(exc);
72738  }
72739  }
72740  return retval;
72741 }
72742 static CYTHON_INLINE
72743 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
72744  PyObject *ret;
72745  PyObject *val = NULL;
72746  __Pyx_Coroutine_Undelegate(gen);
72747  __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
72748  ret = __Pyx_Coroutine_SendEx(gen, val, 0);
72749  Py_XDECREF(val);
72750  return ret;
72751 }
72752 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
72753  PyObject *retval;
72754  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
72755  PyObject *yf = gen->yieldfrom;
72756  if (unlikely(gen->is_running))
72757  return __Pyx_Coroutine_AlreadyRunningError(gen);
72758  if (yf) {
72759  PyObject *ret;
72760  gen->is_running = 1;
72761  #ifdef __Pyx_Generator_USED
72762  if (__Pyx_Generator_CheckExact(yf)) {
72763  ret = __Pyx_Coroutine_Send(yf, value);
72764  } else
72765  #endif
72766  #ifdef __Pyx_Coroutine_USED
72767  if (__Pyx_Coroutine_Check(yf)) {
72768  ret = __Pyx_Coroutine_Send(yf, value);
72769  } else
72770  #endif
72771  #ifdef __Pyx_AsyncGen_USED
72772  if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
72773  ret = __Pyx_async_gen_asend_send(yf, value);
72774  } else
72775  #endif
72776  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
72777  if (PyGen_CheckExact(yf)) {
72778  ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
72779  } else
72780  #endif
72781  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
72782  if (PyCoro_CheckExact(yf)) {
72783  ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
72784  } else
72785  #endif
72786  {
72787  if (value == Py_None)
72788  ret = Py_TYPE(yf)->tp_iternext(yf);
72789  else
72790  ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
72791  }
72792  gen->is_running = 0;
72793  if (likely(ret)) {
72794  return ret;
72795  }
72796  retval = __Pyx_Coroutine_FinishDelegation(gen);
72797  } else {
72798  retval = __Pyx_Coroutine_SendEx(gen, value, 0);
72799  }
72800  return __Pyx_Coroutine_MethodReturn(self, retval);
72801 }
72802 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
72803  PyObject *retval = NULL;
72804  int err = 0;
72805  #ifdef __Pyx_Generator_USED
72806  if (__Pyx_Generator_CheckExact(yf)) {
72807  retval = __Pyx_Coroutine_Close(yf);
72808  if (!retval)
72809  return -1;
72810  } else
72811  #endif
72812  #ifdef __Pyx_Coroutine_USED
72813  if (__Pyx_Coroutine_Check(yf)) {
72814  retval = __Pyx_Coroutine_Close(yf);
72815  if (!retval)
72816  return -1;
72817  } else
72818  if (__Pyx_CoroutineAwait_CheckExact(yf)) {
72819  retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
72820  if (!retval)
72821  return -1;
72822  } else
72823  #endif
72824  #ifdef __Pyx_AsyncGen_USED
72825  if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
72826  retval = __Pyx_async_gen_asend_close(yf, NULL);
72827  } else
72828  if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
72829  retval = __Pyx_async_gen_athrow_close(yf, NULL);
72830  } else
72831  #endif
72832  {
72833  PyObject *meth;
72834  gen->is_running = 1;
72835  meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
72836  if (unlikely(!meth)) {
72837  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
72838  PyErr_WriteUnraisable(yf);
72839  }
72840  PyErr_Clear();
72841  } else {
72842  retval = PyObject_CallFunction(meth, NULL);
72843  Py_DECREF(meth);
72844  if (!retval)
72845  err = -1;
72846  }
72847  gen->is_running = 0;
72848  }
72849  Py_XDECREF(retval);
72850  return err;
72851 }
72852 static PyObject *__Pyx_Generator_Next(PyObject *self) {
72853  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
72854  PyObject *yf = gen->yieldfrom;
72855  if (unlikely(gen->is_running))
72856  return __Pyx_Coroutine_AlreadyRunningError(gen);
72857  if (yf) {
72858  PyObject *ret;
72859  gen->is_running = 1;
72860  #ifdef __Pyx_Generator_USED
72861  if (__Pyx_Generator_CheckExact(yf)) {
72862  ret = __Pyx_Generator_Next(yf);
72863  } else
72864  #endif
72865  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
72866  if (PyGen_CheckExact(yf)) {
72867  ret = _PyGen_Send((PyGenObject*)yf, NULL);
72868  } else
72869  #endif
72870  #ifdef __Pyx_Coroutine_USED
72871  if (__Pyx_Coroutine_Check(yf)) {
72872  ret = __Pyx_Coroutine_Send(yf, Py_None);
72873  } else
72874  #endif
72875  ret = Py_TYPE(yf)->tp_iternext(yf);
72876  gen->is_running = 0;
72877  if (likely(ret)) {
72878  return ret;
72879  }
72880  return __Pyx_Coroutine_FinishDelegation(gen);
72881  }
72882  return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
72883 }
72884 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
72885  return __Pyx_Coroutine_Close(self);
72886 }
72887 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
72888  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
72889  PyObject *retval, *raised_exception;
72890  PyObject *yf = gen->yieldfrom;
72891  int err = 0;
72892  if (unlikely(gen->is_running))
72893  return __Pyx_Coroutine_AlreadyRunningError(gen);
72894  if (yf) {
72895  Py_INCREF(yf);
72896  err = __Pyx_Coroutine_CloseIter(gen, yf);
72897  __Pyx_Coroutine_Undelegate(gen);
72898  Py_DECREF(yf);
72899  }
72900  if (err == 0)
72901  PyErr_SetNone(PyExc_GeneratorExit);
72902  retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
72903  if (unlikely(retval)) {
72904  const char *msg;
72905  Py_DECREF(retval);
72906  if ((0)) {
72907  #ifdef __Pyx_Coroutine_USED
72908  } else if (__Pyx_Coroutine_Check(self)) {
72909  msg = "coroutine ignored GeneratorExit";
72910  #endif
72911  #ifdef __Pyx_AsyncGen_USED
72912  } else if (__Pyx_AsyncGen_CheckExact(self)) {
72913 #if PY_VERSION_HEX < 0x03060000
72914  msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
72915 #else
72916  msg = "async generator ignored GeneratorExit";
72917 #endif
72918  #endif
72919  } else {
72920  msg = "generator ignored GeneratorExit";
72921  }
72922  PyErr_SetString(PyExc_RuntimeError, msg);
72923  return NULL;
72924  }
72925  raised_exception = PyErr_Occurred();
72926  if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
72927  if (raised_exception) PyErr_Clear();
72928  Py_INCREF(Py_None);
72929  return Py_None;
72930  }
72931  return NULL;
72932 }
72933 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
72934  PyObject *args, int close_on_genexit) {
72935  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
72936  PyObject *yf = gen->yieldfrom;
72937  if (unlikely(gen->is_running))
72938  return __Pyx_Coroutine_AlreadyRunningError(gen);
72939  if (yf) {
72940  PyObject *ret;
72941  Py_INCREF(yf);
72942  if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
72943  int err = __Pyx_Coroutine_CloseIter(gen, yf);
72944  Py_DECREF(yf);
72945  __Pyx_Coroutine_Undelegate(gen);
72946  if (err < 0)
72947  return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
72948  goto throw_here;
72949  }
72950  gen->is_running = 1;
72951  if (0
72952  #ifdef __Pyx_Generator_USED
72953  || __Pyx_Generator_CheckExact(yf)
72954  #endif
72955  #ifdef __Pyx_Coroutine_USED
72956  || __Pyx_Coroutine_Check(yf)
72957  #endif
72958  ) {
72959  ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
72960  #ifdef __Pyx_Coroutine_USED
72961  } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
72962  ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
72963  #endif
72964  } else {
72965  PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
72966  if (unlikely(!meth)) {
72967  Py_DECREF(yf);
72968  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
72969  gen->is_running = 0;
72970  return NULL;
72971  }
72972  PyErr_Clear();
72973  __Pyx_Coroutine_Undelegate(gen);
72974  gen->is_running = 0;
72975  goto throw_here;
72976  }
72977  if (likely(args)) {
72978  ret = PyObject_CallObject(meth, args);
72979  } else {
72980  ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
72981  }
72982  Py_DECREF(meth);
72983  }
72984  gen->is_running = 0;
72985  Py_DECREF(yf);
72986  if (!ret) {
72987  ret = __Pyx_Coroutine_FinishDelegation(gen);
72988  }
72989  return __Pyx_Coroutine_MethodReturn(self, ret);
72990  }
72991 throw_here:
72992  __Pyx_Raise(typ, val, tb, NULL);
72993  return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
72994 }
72995 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
72996  PyObject *typ;
72997  PyObject *val = NULL;
72998  PyObject *tb = NULL;
72999  if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
73000  return NULL;
73001  return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
73002 }
73003 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
73004  Py_VISIT(exc_state->exc_type);
73005  Py_VISIT(exc_state->exc_value);
73006  Py_VISIT(exc_state->exc_traceback);
73007  return 0;
73008 }
73009 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
73010  Py_VISIT(gen->closure);
73011  Py_VISIT(gen->classobj);
73012  Py_VISIT(gen->yieldfrom);
73013  return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
73014 }
73015 static int __Pyx_Coroutine_clear(PyObject *self) {
73016  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
73017  Py_CLEAR(gen->closure);
73018  Py_CLEAR(gen->classobj);
73019  Py_CLEAR(gen->yieldfrom);
73020  __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
73021 #ifdef __Pyx_AsyncGen_USED
73022  if (__Pyx_AsyncGen_CheckExact(self)) {
73023  Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
73024  }
73025 #endif
73026  Py_CLEAR(gen->gi_code);
73027  Py_CLEAR(gen->gi_name);
73028  Py_CLEAR(gen->gi_qualname);
73029  Py_CLEAR(gen->gi_modulename);
73030  return 0;
73031 }
73032 static void __Pyx_Coroutine_dealloc(PyObject *self) {
73033  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
73034  PyObject_GC_UnTrack(gen);
73035  if (gen->gi_weakreflist != NULL)
73036  PyObject_ClearWeakRefs(self);
73037  if (gen->resume_label >= 0) {
73038  PyObject_GC_Track(self);
73039 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
73040  if (PyObject_CallFinalizerFromDealloc(self))
73041 #else
73042  Py_TYPE(gen)->tp_del(self);
73043  if (self->ob_refcnt > 0)
73044 #endif
73045  {
73046  return;
73047  }
73048  PyObject_GC_UnTrack(self);
73049  }
73050 #ifdef __Pyx_AsyncGen_USED
73051  if (__Pyx_AsyncGen_CheckExact(self)) {
73052  /* We have to handle this case for asynchronous generators
73053  right here, because this code has to be between UNTRACK
73054  and GC_Del. */
73055  Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
73056  }
73057 #endif
73058  __Pyx_Coroutine_clear(self);
73059  PyObject_GC_Del(gen);
73060 }
73061 static void __Pyx_Coroutine_del(PyObject *self) {
73062  PyObject *error_type, *error_value, *error_traceback;
73063  __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
73064  __Pyx_PyThreadState_declare
73065  if (gen->resume_label < 0) {
73066  return;
73067  }
73068 #if !CYTHON_USE_TP_FINALIZE
73069  assert(self->ob_refcnt == 0);
73070  self->ob_refcnt = 1;
73071 #endif
73072  __Pyx_PyThreadState_assign
73073  __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
73074 #ifdef __Pyx_AsyncGen_USED
73075  if (__Pyx_AsyncGen_CheckExact(self)) {
73076  __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
73077  PyObject *finalizer = agen->ag_finalizer;
73078  if (finalizer && !agen->ag_closed) {
73079  PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
73080  if (unlikely(!res)) {
73081  PyErr_WriteUnraisable(self);
73082  } else {
73083  Py_DECREF(res);
73084  }
73085  __Pyx_ErrRestore(error_type, error_value, error_traceback);
73086  return;
73087  }
73088  }
73089 #endif
73090  if (unlikely(gen->resume_label == 0 && !error_value)) {
73091 #ifdef __Pyx_Coroutine_USED
73092 #ifdef __Pyx_Generator_USED
73093  if (!__Pyx_Generator_CheckExact(self))
73094 #endif
73095  {
73096  PyObject_GC_UnTrack(self);
73097 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
73098  if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
73099  PyErr_WriteUnraisable(self);
73100 #else
73101  {PyObject *msg;
73102  char *cmsg;
73103  #if CYTHON_COMPILING_IN_PYPY
73104  msg = NULL;
73105  cmsg = (char*) "coroutine was never awaited";
73106  #else
73107  char *cname;
73108  PyObject *qualname;
73109  qualname = gen->gi_qualname;
73110  cname = PyString_AS_STRING(qualname);
73111  msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
73112  if (unlikely(!msg)) {
73113  PyErr_Clear();
73114  cmsg = (char*) "coroutine was never awaited";
73115  } else {
73116  cmsg = PyString_AS_STRING(msg);
73117  }
73118  #endif
73119  if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
73120  PyErr_WriteUnraisable(self);
73121  Py_XDECREF(msg);}
73122 #endif
73123  PyObject_GC_Track(self);
73124  }
73125 #endif
73126  } else {
73127  PyObject *res = __Pyx_Coroutine_Close(self);
73128  if (unlikely(!res)) {
73129  if (PyErr_Occurred())
73130  PyErr_WriteUnraisable(self);
73131  } else {
73132  Py_DECREF(res);
73133  }
73134  }
73135  __Pyx_ErrRestore(error_type, error_value, error_traceback);
73136 #if !CYTHON_USE_TP_FINALIZE
73137  assert(self->ob_refcnt > 0);
73138  if (--self->ob_refcnt == 0) {
73139  return;
73140  }
73141  {
73142  Py_ssize_t refcnt = self->ob_refcnt;
73143  _Py_NewReference(self);
73144  self->ob_refcnt = refcnt;
73145  }
73146 #if CYTHON_COMPILING_IN_CPYTHON
73147  assert(PyType_IS_GC(self->ob_type) &&
73148  _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
73149  _Py_DEC_REFTOTAL;
73150 #endif
73151 #ifdef COUNT_ALLOCS
73152  --Py_TYPE(self)->tp_frees;
73153  --Py_TYPE(self)->tp_allocs;
73154 #endif
73155 #endif
73156 }
73157 static PyObject *
73158 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
73159 {
73160  PyObject *name = self->gi_name;
73161  if (unlikely(!name)) name = Py_None;
73162  Py_INCREF(name);
73163  return name;
73164 }
73165 static int
73166 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
73167 {
73168  PyObject *tmp;
73169 #if PY_MAJOR_VERSION >= 3
73170  if (unlikely(value == NULL || !PyUnicode_Check(value)))
73171 #else
73172  if (unlikely(value == NULL || !PyString_Check(value)))
73173 #endif
73174  {
73175  PyErr_SetString(PyExc_TypeError,
73176  "__name__ must be set to a string object");
73177  return -1;
73178  }
73179  tmp = self->gi_name;
73180  Py_INCREF(value);
73181  self->gi_name = value;
73182  Py_XDECREF(tmp);
73183  return 0;
73184 }
73185 static PyObject *
73186 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
73187 {
73188  PyObject *name = self->gi_qualname;
73189  if (unlikely(!name)) name = Py_None;
73190  Py_INCREF(name);
73191  return name;
73192 }
73193 static int
73194 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
73195 {
73196  PyObject *tmp;
73197 #if PY_MAJOR_VERSION >= 3
73198  if (unlikely(value == NULL || !PyUnicode_Check(value)))
73199 #else
73200  if (unlikely(value == NULL || !PyString_Check(value)))
73201 #endif
73202  {
73203  PyErr_SetString(PyExc_TypeError,
73204  "__qualname__ must be set to a string object");
73205  return -1;
73206  }
73207  tmp = self->gi_qualname;
73208  Py_INCREF(value);
73209  self->gi_qualname = value;
73210  Py_XDECREF(tmp);
73211  return 0;
73212 }
73213 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
73214  PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
73215  PyObject *name, PyObject *qualname, PyObject *module_name) {
73216  __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
73217  if (unlikely(!gen))
73218  return NULL;
73219  return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
73220 }
73221 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
73222  __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
73223  PyObject *name, PyObject *qualname, PyObject *module_name) {
73224  gen->body = body;
73225  gen->closure = closure;
73226  Py_XINCREF(closure);
73227  gen->is_running = 0;
73228  gen->resume_label = 0;
73229  gen->classobj = NULL;
73230  gen->yieldfrom = NULL;
73231  gen->gi_exc_state.exc_type = NULL;
73232  gen->gi_exc_state.exc_value = NULL;
73233  gen->gi_exc_state.exc_traceback = NULL;
73234 #if CYTHON_USE_EXC_INFO_STACK
73235  gen->gi_exc_state.previous_item = NULL;
73236 #endif
73237  gen->gi_weakreflist = NULL;
73238  Py_XINCREF(qualname);
73239  gen->gi_qualname = qualname;
73240  Py_XINCREF(name);
73241  gen->gi_name = name;
73242  Py_XINCREF(module_name);
73243  gen->gi_modulename = module_name;
73244  Py_XINCREF(code);
73245  gen->gi_code = code;
73246  PyObject_GC_Track(gen);
73247  return gen;
73248 }
73249 
73250 /* PatchModuleWithCoroutine */
73251  static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
73252 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
73253  int result;
73254  PyObject *globals, *result_obj;
73255  globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
73256  result = PyDict_SetItemString(globals, "_cython_coroutine_type",
73257  #ifdef __Pyx_Coroutine_USED
73258  (PyObject*)__pyx_CoroutineType);
73259  #else
73260  Py_None);
73261  #endif
73262  if (unlikely(result < 0)) goto ignore;
73263  result = PyDict_SetItemString(globals, "_cython_generator_type",
73264  #ifdef __Pyx_Generator_USED
73265  (PyObject*)__pyx_GeneratorType);
73266  #else
73267  Py_None);
73268  #endif
73269  if (unlikely(result < 0)) goto ignore;
73270  if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
73271  if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
73272  result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
73273  if (unlikely(!result_obj)) goto ignore;
73274  Py_DECREF(result_obj);
73275  Py_DECREF(globals);
73276  return module;
73277 ignore:
73278  Py_XDECREF(globals);
73279  PyErr_WriteUnraisable(module);
73280  if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
73281  Py_DECREF(module);
73282  module = NULL;
73283  }
73284 #else
73285  py_code++;
73286 #endif
73287  return module;
73288 }
73289 
73290 /* PatchGeneratorABC */
73291  #ifndef CYTHON_REGISTER_ABCS
73292 #define CYTHON_REGISTER_ABCS 1
73293 #endif
73294 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
73295 static PyObject* __Pyx_patch_abc_module(PyObject *module);
73296 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
73297  module = __Pyx_Coroutine_patch_module(
73298  module, ""
73299 "if _cython_generator_type is not None:\n"
73300 " try: Generator = _module.Generator\n"
73301 " except AttributeError: pass\n"
73302 " else: Generator.register(_cython_generator_type)\n"
73303 "if _cython_coroutine_type is not None:\n"
73304 " try: Coroutine = _module.Coroutine\n"
73305 " except AttributeError: pass\n"
73306 " else: Coroutine.register(_cython_coroutine_type)\n"
73307  );
73308  return module;
73309 }
73310 #endif
73311 static int __Pyx_patch_abc(void) {
73312 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
73313  static int abc_patched = 0;
73314  if (CYTHON_REGISTER_ABCS && !abc_patched) {
73315  PyObject *module;
73316  module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
73317  if (!module) {
73318  PyErr_WriteUnraisable(NULL);
73319  if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
73320  ((PY_MAJOR_VERSION >= 3) ?
73321  "Cython module failed to register with collections.abc module" :
73322  "Cython module failed to register with collections module"), 1) < 0)) {
73323  return -1;
73324  }
73325  } else {
73326  module = __Pyx_patch_abc_module(module);
73327  abc_patched = 1;
73328  if (unlikely(!module))
73329  return -1;
73330  Py_DECREF(module);
73331  }
73332  module = PyImport_ImportModule("backports_abc");
73333  if (module) {
73334  module = __Pyx_patch_abc_module(module);
73335  Py_XDECREF(module);
73336  }
73337  if (!module) {
73338  PyErr_Clear();
73339  }
73340  }
73341 #else
73342  if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
73343 #endif
73344  return 0;
73345 }
73346 
73347 /* Generator */
73348  static PyMethodDef __pyx_Generator_methods[] = {
73349  {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
73350  (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
73351  {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
73352  (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
73353  {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
73354  (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
73355  {0, 0, 0, 0}
73356 };
73357 static PyMemberDef __pyx_Generator_memberlist[] = {
73358  {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
73359  {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
73360  (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
73361  {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
73362  {0, 0, 0, 0, 0}
73363 };
73364 static PyGetSetDef __pyx_Generator_getsets[] = {
73365  {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
73366  (char*) PyDoc_STR("name of the generator"), 0},
73367  {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
73368  (char*) PyDoc_STR("qualified name of the generator"), 0},
73369  {0, 0, 0, 0, 0}
73370 };
73371 static PyTypeObject __pyx_GeneratorType_type = {
73372  PyVarObject_HEAD_INIT(0, 0)
73373  "generator",
73374  sizeof(__pyx_CoroutineObject),
73375  0,
73376  (destructor) __Pyx_Coroutine_dealloc,
73377  0,
73378  0,
73379  0,
73380  0,
73381  0,
73382  0,
73383  0,
73384  0,
73385  0,
73386  0,
73387  0,
73388  0,
73389  0,
73390  0,
73391  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
73392  0,
73393  (traverseproc) __Pyx_Coroutine_traverse,
73394  0,
73395  0,
73396  offsetof(__pyx_CoroutineObject, gi_weakreflist),
73397  0,
73398  (iternextfunc) __Pyx_Generator_Next,
73399  __pyx_Generator_methods,
73400  __pyx_Generator_memberlist,
73401  __pyx_Generator_getsets,
73402  0,
73403  0,
73404  0,
73405  0,
73406  0,
73407  0,
73408  0,
73409  0,
73410  0,
73411  0,
73412  0,
73413  0,
73414  0,
73415  0,
73416  0,
73417 #if CYTHON_USE_TP_FINALIZE
73418  0,
73419 #else
73420  __Pyx_Coroutine_del,
73421 #endif
73422  0,
73423 #if CYTHON_USE_TP_FINALIZE
73424  __Pyx_Coroutine_del,
73425 #elif PY_VERSION_HEX >= 0x030400a1
73426  0,
73427 #endif
73428 };
73429 static int __pyx_Generator_init(void) {
73430  __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
73431  __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
73432  __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
73433  if (unlikely(!__pyx_GeneratorType)) {
73434  return -1;
73435  }
73436  return 0;
73437 }
73438 
73439 /* CheckBinaryVersion */
73440  static int __Pyx_check_binary_version(void) {
73441  char ctversion[4], rtversion[4];
73442  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
73443  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
73444  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
73445  char message[200];
73446  PyOS_snprintf(message, sizeof(message),
73447  "compiletime version %s of module '%.100s' "
73448  "does not match runtime version %s",
73449  ctversion, __Pyx_MODULE_NAME, rtversion);
73450  return PyErr_WarnEx(NULL, message, 1);
73451  }
73452  return 0;
73453 }
73454 
73455 /* InitStrings */
73456  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
73457  while (t->p) {
73458  #if PY_MAJOR_VERSION < 3
73459  if (t->is_unicode) {
73460  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
73461  } else if (t->intern) {
73462  *t->p = PyString_InternFromString(t->s);
73463  } else {
73464  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
73465  }
73466  #else
73467  if (t->is_unicode | t->is_str) {
73468  if (t->intern) {
73469  *t->p = PyUnicode_InternFromString(t->s);
73470  } else if (t->encoding) {
73471  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
73472  } else {
73473  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
73474  }
73475  } else {
73476  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
73477  }
73478  #endif
73479  if (!*t->p)
73480  return -1;
73481  if (PyObject_Hash(*t->p) == -1)
73482  return -1;
73483  ++t;
73484  }
73485  return 0;
73486 }
73487 
73488 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
73489  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
73490 }
73491 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
73492  Py_ssize_t ignore;
73493  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
73494 }
73495 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
73496 #if !CYTHON_PEP393_ENABLED
73497 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
73498  char* defenc_c;
73499  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
73500  if (!defenc) return NULL;
73501  defenc_c = PyBytes_AS_STRING(defenc);
73502 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
73503  {
73504  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
73505  char* c;
73506  for (c = defenc_c; c < end; c++) {
73507  if ((unsigned char) (*c) >= 128) {
73508  PyUnicode_AsASCIIString(o);
73509  return NULL;
73510  }
73511  }
73512  }
73513 #endif
73514  *length = PyBytes_GET_SIZE(defenc);
73515  return defenc_c;
73516 }
73517 #else
73518 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
73519  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
73520 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
73521  if (likely(PyUnicode_IS_ASCII(o))) {
73522  *length = PyUnicode_GET_LENGTH(o);
73523  return PyUnicode_AsUTF8(o);
73524  } else {
73525  PyUnicode_AsASCIIString(o);
73526  return NULL;
73527  }
73528 #else
73529  return PyUnicode_AsUTF8AndSize(o, length);
73530 #endif
73531 }
73532 #endif
73533 #endif
73534 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
73535 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
73536  if (
73537 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
73538  __Pyx_sys_getdefaultencoding_not_ascii &&
73539 #endif
73540  PyUnicode_Check(o)) {
73541  return __Pyx_PyUnicode_AsStringAndSize(o, length);
73542  } else
73543 #endif
73544 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
73545  if (PyByteArray_Check(o)) {
73546  *length = PyByteArray_GET_SIZE(o);
73547  return PyByteArray_AS_STRING(o);
73548  } else
73549 #endif
73550  {
73551  char* result;
73552  int r = PyBytes_AsStringAndSize(o, &result, length);
73553  if (unlikely(r < 0)) {
73554  return NULL;
73555  } else {
73556  return result;
73557  }
73558  }
73559 }
73560 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
73561  int is_true = x == Py_True;
73562  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
73563  else return PyObject_IsTrue(x);
73564 }
73565 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
73566  int retval;
73567  if (unlikely(!x)) return -1;
73568  retval = __Pyx_PyObject_IsTrue(x);
73569  Py_DECREF(x);
73570  return retval;
73571 }
73572 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
73573 #if PY_MAJOR_VERSION >= 3
73574  if (PyLong_Check(result)) {
73575  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
73576  "__int__ returned non-int (type %.200s). "
73577  "The ability to return an instance of a strict subclass of int "
73578  "is deprecated, and may be removed in a future version of Python.",
73579  Py_TYPE(result)->tp_name)) {
73580  Py_DECREF(result);
73581  return NULL;
73582  }
73583  return result;
73584  }
73585 #endif
73586  PyErr_Format(PyExc_TypeError,
73587  "__%.4s__ returned non-%.4s (type %.200s)",
73588  type_name, type_name, Py_TYPE(result)->tp_name);
73589  Py_DECREF(result);
73590  return NULL;
73591 }
73592 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
73593 #if CYTHON_USE_TYPE_SLOTS
73594  PyNumberMethods *m;
73595 #endif
73596  const char *name = NULL;
73597  PyObject *res = NULL;
73598 #if PY_MAJOR_VERSION < 3
73599  if (likely(PyInt_Check(x) || PyLong_Check(x)))
73600 #else
73601  if (likely(PyLong_Check(x)))
73602 #endif
73603  return __Pyx_NewRef(x);
73604 #if CYTHON_USE_TYPE_SLOTS
73605  m = Py_TYPE(x)->tp_as_number;
73606  #if PY_MAJOR_VERSION < 3
73607  if (m && m->nb_int) {
73608  name = "int";
73609  res = m->nb_int(x);
73610  }
73611  else if (m && m->nb_long) {
73612  name = "long";
73613  res = m->nb_long(x);
73614  }
73615  #else
73616  if (likely(m && m->nb_int)) {
73617  name = "int";
73618  res = m->nb_int(x);
73619  }
73620  #endif
73621 #else
73622  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
73623  res = PyNumber_Int(x);
73624  }
73625 #endif
73626  if (likely(res)) {
73627 #if PY_MAJOR_VERSION < 3
73628  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
73629 #else
73630  if (unlikely(!PyLong_CheckExact(res))) {
73631 #endif
73632  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
73633  }
73634  }
73635  else if (!PyErr_Occurred()) {
73636  PyErr_SetString(PyExc_TypeError,
73637  "an integer is required");
73638  }
73639  return res;
73640 }
73641 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
73642  Py_ssize_t ival;
73643  PyObject *x;
73644 #if PY_MAJOR_VERSION < 3
73645  if (likely(PyInt_CheckExact(b))) {
73646  if (sizeof(Py_ssize_t) >= sizeof(long))
73647  return PyInt_AS_LONG(b);
73648  else
73649  return PyInt_AsSsize_t(b);
73650  }
73651 #endif
73652  if (likely(PyLong_CheckExact(b))) {
73653  #if CYTHON_USE_PYLONG_INTERNALS
73654  const digit* digits = ((PyLongObject*)b)->ob_digit;
73655  const Py_ssize_t size = Py_SIZE(b);
73656  if (likely(__Pyx_sst_abs(size) <= 1)) {
73657  ival = likely(size) ? digits[0] : 0;
73658  if (size == -1) ival = -ival;
73659  return ival;
73660  } else {
73661  switch (size) {
73662  case 2:
73663  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
73664  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
73665  }
73666  break;
73667  case -2:
73668  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
73669  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
73670  }
73671  break;
73672  case 3:
73673  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
73674  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
73675  }
73676  break;
73677  case -3:
73678  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
73679  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
73680  }
73681  break;
73682  case 4:
73683  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
73684  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
73685  }
73686  break;
73687  case -4:
73688  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
73689  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
73690  }
73691  break;
73692  }
73693  }
73694  #endif
73695  return PyLong_AsSsize_t(b);
73696  }
73697  x = PyNumber_Index(b);
73698  if (!x) return -1;
73699  ival = PyInt_AsSsize_t(x);
73700  Py_DECREF(x);
73701  return ival;
73702 }
73703 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
73704  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
73705 }
73706 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
73707  return PyInt_FromSize_t(ival);
73708 }
73709 
73710 
73711 #endif /* Py_PYTHON_H */
proteus::fp
double fp(const double &g, const double &h, const double &hZ)
Definition: GN_SW2DCV.h:98
proteus::__cpp_vel_mode_p
void __cpp_vel_mode_p(double *U, double x[nDim], double t, double kDir[nDim], double kAbs, double omega, double phi, double amplitude, double mwl, double depth, double waveDir[nDim], double vDir[nDim], double tanhkd, double gAbs, bool fast)
Definition: WaveTools.h:136
proteus::__cpp_uDir
void __cpp_uDir(double *U, double x[nDim], double t, double *kDir, double *kAbs, double *omega, double *phi, double *amplitude, double mwl, double depth, int N, double *waveDir, double vDir[nDim], double *tanhF, double gAbs, bool fast)
Definition: WaveTools.h:303
proteus::__cpp_eta2nd
double __cpp_eta2nd(double x[nDim], double t, double *kDir, double *ki, double *omega, double *phi, double *amplitude, int N, double *sinhKd, double *tanhKd, bool fast)
Definition: WaveTools.h:441
f
Double f
Definition: Headers.h:64
proteus::__cpp_eta_long
double __cpp_eta_long(double x[nDim], double t, double *kDir, double *ki, double *omega, double *phi, double *amplitude, int N, double *sinhKd, double *tanhKd, double gAbs, bool fast)
Definition: WaveTools.h:510
s
Double s
Definition: Headers.h:84
proteus::__cpp_etaWindow
double __cpp_etaWindow(double x[nDim], double x0[nDim], double t, double *t0, double *kDir, double *omega, double *phi, double *amplitude, int N, int Nw, bool fast)
Definition: WaveTools.h:380
proteus::__cpp_uFenton
void __cpp_uFenton(double *U, double x[nDim], double t, double kDir[nDim], double kAbs, double omega, double phi0, double amplitude, double mwl, double depth, double gAbs, int Nf, double *Bcoeff, double mV[nDim], double waveDir[nDim], double vDir[nDim], double *tanhF, bool fast)
Definition: WaveTools.h:209
L
Double L
Definition: Headers.h:72
n
Int n
Definition: Headers.h:28
df
double df(double C, double b, double a, int q, int r)
Definition: analyticalSolutions.c:2209
phi
Double phi
Definition: Headers.h:76
proteus::fastcos
double fastcos(double phi, bool fast)
Definition: WaveTools.h:46
num
Int num
Definition: Headers.h:32
H
Double H
Definition: Headers.h:65
U
Double U
Definition: Headers.h:88
v
Double v
Definition: Headers.h:95
proteus::__cpp_eta_mode
double __cpp_eta_mode(double x[nDim], double t, double kDir[nDim], double omega, double phi, double amplitude, bool fast)
Definition: WaveTools.h:92
T
Double T
Definition: Headers.h:87
proteus::__cpp_findWindow
int __cpp_findWindow(double t, double handover, double t0, double Twindow, int Nwindows, double *windows_handover)
Definition: WaveTools.h:332
z
Double * z
Definition: Headers.h:49
u
Double u
Definition: Headers.h:89
ns
Int ns
Definition: Headers.h:30
c
Double c
Definition: Headers.h:54
proteus::__cpp_etaFenton
double __cpp_etaFenton(double x[nDim], double t, double kDir[nDim], double kAbs, double omega, double phi0, double amplitude, int Nf, double *Ycoeff, bool fast)
Definition: WaveTools.h:184
proteus::__cpp_eta_short
double __cpp_eta_short(double x[nDim], double t, double *kDir, double *ki, double *omega, double *phi, double *amplitude, int N, double *sinhKd, double *tanhKd, double gAbs, bool fast)
Definition: WaveTools.h:466
proteus::__cpp_uWindow
double * __cpp_uWindow(double *U, double x[nDim], double x0[nDim], double t, double *t0, double *kDir, double *kAbs, double *omega, double *phi, double *amplitude, double mwl, double depth, int N, int Nw, double *waveDir, double *vDir, double *tanhF, double gAbs, bool fast)
Definition: WaveTools.h:409
proteus::__cpp_uDirect
void __cpp_uDirect(double *U, double x[nDim], double x0[nDim], double t, double *kDir, double *kAbs, double *omega, double *phi, double *amplitude, double mwl, double depth, int N, double *waveDir, double vDir[nDim], double *tanhKd, double gAbs, bool fast)
Definition: WaveTools.h:365
r
Double r
Definition: Headers.h:83
proteus::__cpp_etaDirect
double __cpp_etaDirect(double x[nDim], double x0[nDim], double t, double *kDir, double *omega, double *phi, double *amplitude, int N, bool fast)
Definition: WaveTools.h:348
proteus::__cpp_uRandom
void __cpp_uRandom(double *U, double x[nDim], double t, double *kDir, double *kAbs, double *omega, double *phi, double *amplitude, double mwl, double depth, int N, double waveDir[nDim], double vDir[nDim], double *tanhF, double gAbs, bool fast)
Definition: WaveTools.h:276
pos
double pos(double a)
Definition: testFMMandFSW.cpp:8
proteus::__cpp_etaRandom
double __cpp_etaRandom(double x[nDim], double t, double *kDir, double *omega, double *phi, double *amplitude, int N, bool fast)
Definition: WaveTools.h:256
WaveTools.h
proteus::fastcosh
void fastcosh(double *hype, double k, double Z, bool fast)
Definition: WaveTools.h:20